搜索看看
数据开放接口 / 获取监控DOCKER容器的指标数据接口
1、示例,下面【2】是参数说明:
请求URL:http://localhost:9999/dockerInfo/agentList 请求方式:POST 请求参数(Content-Type:application/json): { "wgToken":"65d05df102851c6535322e73b2f99c06", "hostname":"192.168.1.1" } 返回结果: { "msg":"", "code":"0", "data":[ { "dockerImage": "mcr.microsoft.com/mssql/server:2017-latest", "userTime": "1.48", "warnLevel": "ERROR", "active": "1", "pageSize": 20, "memPer": 516, "dockerCreated": "2024-09-01 11:02:24", "dockerStatus": "Up 9 hours", "dockerPort": "1433:1433,", "hostname": "10.0.2.19", "dockerSize": "1348.48", "createTime": 1725278614000, "appType": "2", "dockerId": "sqlserver", "dockerCommand": "/opt/mssql/bin/nonroot_msg.sh /opt/mssql/bin/sqlservr", "dockerState": "running", "dockerName": "sqlserver", "state": "1", "id": "1830206651869822976", "page": 1, "gatherDockerNames": "/sqlserver" } ] }
2、参数说明:
请求参数(Content-Type:application/json): { "wgToken":"必填,server/config/application.yml里的wgToken配置项的md5加密字符串,大小写均可", "hostname":"必填,主机ip,完全匹配,非模糊查询", } 返回结果: { "msg":"错误信息", "code":"0成功1错误", "data":[ { "dockerImage": "dockerImage", "userTime": "cpu使用率%", "warnLevel": "告警级别", "active": "监控状态,1监控中,2已停止", "memPer": "内存使用MB,-1标识异常", "dockerCreated": "docker容器创建时间", "dockerStatus": "docker容器Status", "dockerPort": "docker容器端口映射", "hostname": "监控主机IP", "dockerSize": "容器中所有文件的总大小(以MB为单位)", "createTime": "添加时间,毫秒", "appType": "获取docker途径,1 CONTAINER ID,2 DOCKER NAME", "dockerId": "docker容器ID", "dockerCommand": "docker容器启动命令", "dockerState": "docker容器运行状态", "dockerName": "docker容器名称", "state": "状态,1正常,2下线", "id": "1830206651869822976", "gatherDockerNames": "docker容器NAMES" } ] }