This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-doc/nezha接口文档.md

95 KiB
Raw Blame History

NEZHA接口文档 v1.0.0

1 规范说明

1.1 通信协议

HTTP协议

1.2 请求方法

HttpRequest Method SQL 实现方式 说明
GET SELECT GET请求 服务器获取资源(一项或多项)
POST INSERT POST请求 服务器新建一个资源,返回操作结果
PUT UPDATE PUT 请求 服务器更新资源(向客户端提供改变后的完整资源)
PATCH UPDATE PATCH请求 服务器更新资源(向客户端提供改变的属性)
DELETE UPDATE/DELETE DELETE请求 从服务器删除资源,返回空文档

1.3 字符编码

HTTP通讯均采用UTF-8字符集编码格式。

1.4 格式说明

元素出现要求说明:

符号 说明
R 报文中该元素必须出现Required
O 报文中该元素可选出现Optional
C 报文中该元素在一定条件下出现Conditional

1.5 响应报文结构

1.5.1 结构说明

所有接口响应均采用JSON格式如无特殊说明每次请求的返回值中都包含下列字段

参数名称 类型 出现要求 描述
code int R 响应码代码定义请见“附录A 响应吗说明”
msg string R 响应描述
data object R 每个接口特有的参数,详见每个接口定义
totalCount int C 总结果数,批量分页查询时需要
list Object[] C 当前页查询结果,批量查询时需要

1.5.2 响应报文示例

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "Channel": "A10086",
            "Type": 7004
        }]
    }
}

2. 接口定义

2.1 设备管理

2.1.1 节点管理

2.1.1.1 节点列表查询
  • 接口说明: 节点列表查询
  • 接口地址: /node/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
ip String O 查询ip
state String O 设备状态1在线2下线
type String O 设备类型 数字1
tag Integer O 设备标签
cabinetId Integer O 机柜
roomId Integer O 机房
groupId Integer C 节点组ID
name String O 名称

示例:

GET /node/list?pageSize=20&currPage=1&ip=192.168.1.1&state=1&tag=1&type=1&cabinetId=12&order=asc

返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
name String R  
hostName String R 主机名
ip String R ip
uuid Integer R 全局唯一
type String R 设备类型,返回国际化翻译后的“服务器”、“网元”
tag Integer R 设备标签id与sys_dict的type:node-type关联
tagName String R 设备标签名称(翻译后)
userName String R snmpv3 用户名
password String R snmpv3 密码
state String R 设备状态1在线2下线
roomName String R 机房名称
cabinetInfo Object R 机柜
id Integer R 机柜ID
name String R 机柜名称
uSize Integer R u位大小
cabinetStart Integer R 机柜起始位置
snmpPort Integer R snmp默认端口号
snmpCommunity String R snmp团体字
remark String R 备注
systemInfo Object[] R 所在业务系统
id Integer R 业务系统id
name String R 业务系统名称

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "name": "node1",
            "hostName": "ysp-01",
            "ip": "192.168.10.1",
            "uuid": 1,
            "type": "服务器",
            "tag": 9,
            "tagName": "server9",
            "userName": "",
            "password": "",
            "state": "1",
            "roomName": "机房1",
            "cabinetInfo": {
                "id": 3,
                "name": "cab1"
            },
            "uSize": 1,
            "cabinetStart": 1,
            "snmpPort": 1,
            "snmpCommunity": "",
            "remark": "",
            "systemInfo": [{
                "id": 1,
                "name": "业务系统1"
            }]
        }]
    }
}
2.1.1.2 节点详情查询
  • 接口说明: 节点详情查询
  • 接口地址: /node/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
uuid Integer R 唯一标识

示例:

GET /node/detail?uuid=5
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data object R  
name String R
hostName String R 主机名
ip String R ip
uuid Integer R 全局唯一
type String R 设备类型,返回国际化翻译后的“服务器”、“网元”
tag Integer R 设备标签id与sys_dict的type:node-type关联
tagName String R 设备标签名称(翻译后)
userName String R snmpv3 用户名
password String R snmpv3 密码
state String R 设备状态1在线2下线
roomName String R 机房名称
cabinetInfo Object R 机柜
id Integer R 机柜ID
name String R 机柜名称
uSize Integer R u位大小
cabinetStart Integer R 机柜起始位置
snmpPort Integer R snmp默认端口号
snmpCommunity String R snmp团体字
remark String R 备注
systemInfo Object[] R 所在业务系统
id Integer R 业务系统id
name String R 业务系统名称

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "name": "node1",
        "hostName": "ysp-01",
        "ip": "192.168.10.1",
        "uuid": 1,
        "type": "服务器",
        "tag": 9,
        "tagName": "server9",
        "userName": "",
        "password": "",
        "state": "1",
        "roomName": "机房1",
        "cabinetInfo": {
            "id": 3,
            "name": "cab1"
        },
        "uSize": 1,
        "cabinetStart": 1,
        "snmpPort": 1,
        "snmpCommunity": "",
        "remark": "",
        "systemInfo": [{
            "id": 1,
            "name": "业务系统1"
        }]
    }
}
2.1.1.3 节点新增
  • 接口说明: 节点新增
  • 接口地址: /node/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
ip String R ip
type String R 设备类型 1server2net传数字1或2
tag Integer O 设备标签id
cabinetId Integer O 机柜
cabinetStart Integer O 机柜起始位置
name String R 名称
userName String O snmpv3 用户名
password String O snmpv3 密码
snmpPort Integer O snmp端口号
snmpCommunity String O snmp团体字
uSize Integer O U位大小
remark String O 备注

示例:

{
    "name": "",
    "ip": "",
    "type": "2",
    "tag": 1,
    "userName": "snnnn",
    "password": "mpppp",
    "cabinetId": 1,
    "uSize": 1,
    "cabinetStart": 1,
    "snmpPort": 161,
    "snmpCommunity": "public",
    "remark": "en"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

成功
{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "机柜该位置无法使用"
}
2.1.1.4 节点修改
  • 接口说明: 节点修改
  • 接口地址: /node/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
uuid Integer R 唯一标识
ip String R 查询ip
type String R 设备类型 1server2net传数字1或2
tag Integer O 设备标签
cabinetId Integer O 机柜
cabinetStart Integer O 机柜起始位置
name String R 名称
userName String O snmpv3 用户名
password String O snmpv3 密码
snmpPort Integer O snmp端口号
snmpCommunity String O snmp团体字
uSize Integer O U位大小
remark String O 备注

示例:

{
    "uuid": 121,
    "name": "",
    "ip": "",
    "type": "1",
    "tag": 1,
    "userName": "snnnn",
    "password": "mpppp",
    "cabinetId": 1,
    "uSize": 1,
    "cabinetStart": 1,
    "snmpPort": 161,
    "snmpCommunity": "public",
    "remark": "enac"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

成功
{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "机柜该位置无法使用"
}
2.1.1.5 节点状态变更
  • 接口说明: 节点状态变更(上线/下线/删除)
  • 接口地址: /node/changeState
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
uuids Integer[] R 唯一标识
state String R 变更的状态1在线2下线3删除

示例:

{
    "uuids": [2,6],
    "state": "1"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg String R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.1.1.6 查询可用机柜
  • 接口说明: 节点修改
  • 接口地址: /node/selectCab
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
uuid Integer O 唯一标识,为空表示正在新增节点
uSize Integer R u位大小

示例:

GET /node/selectCab?uuid=5&uSize=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
list Object R  
roomId Integer R 机房id
roomName String R 机房名称
cabinets Object[] R 机柜
id Integer R 机柜id
name String R 机柜名称
starts Integer[] R 机柜起始位置

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "list": [{
            "roomId": 2,
            "roomName": "room1",
            "cabinets": [{
                "id": 1,
                "name": "机柜1",
                "starts": [1,2,8,9,10]
            }]
        }]
    }
}
2.1.1.7 IP校验
  • 接口说明: IP校验
  • 接口地址: /node/ipCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
uuid Integer O 唯一标识,为空表示正在新增节点
ip String R IP

示例:

GET /node/ipCheck?uuid=5&ip=192.11.14.20
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg String R  

示例:

成功
{
	"code": 200,
    "msg": "success"
}
失败
{
	"code": 600,
    "msg": "IP已被占用"
}
2.1.1.8 节点名称校验
  • 接口说明: 节点名称校验
  • 接口地址: /node/nodeNameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
uuid Integer O 唯一标识,为空表示正在新增节点
name String R 节点名称

示例:

GET /node/nodeNameCheck?uuid=5&name=atc2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg String R  

示例:

成功
{
	"code": 200,
    "msg": "success"
}
失败
{
	"code": 600,
    "msg": "名称已被占用"
}

2.1.2 节点组管理

2.1.2.1 节点组列表查询
  • 接口说明: 节点组列表查询
  • 接口地址: /nodegroup/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述

示例:

GET /nodegroup/list
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
list Object[] R  
systemId Integer R 业务系统id
systemName String R 业务系统名称
groups Object[] R 接电阻
id Integer R 节点组id
name String R 节点组名称
allowAss String R 能否分配节点 0不能1可以
allowSub String R 能否增加子节点组 0不能1可以
pid Integer R 父ID默认0

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "list": [{
            "systemId": 1,
            "systemName": "system1",
            "groups": [
                {"id": 8, "name": "group1", "pid": 0, "allowAss": "0", "allowSub": "1"},
                {"id": 9, "name": "group1-1", "pid": 8, "allowAss": "0", "allowSub": "1"},
                {"id": 28, "name": "group1-1-9", "pid": 9, "allowAss": "1", "allowSub": "0"}
            ]
        }]
    }
}
2.1.2.2 节点组详情查询
  • 接口说明: 节点组详情查询
  • 接口地址: /nodegroup/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R 节点组ID

示例:

GET /nodegroup/detail?id=3
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R  
name String R 节点组名称
pid Integer R 父ID默认0
pname String R 父名称
remark String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 8,
        "name": "group1",
        "pid": 2,
        "pname": "group0",
        "remark": "呵呵"
    }
}
2.1.2.3 节点组下的节点列表查询
  • 接口说明: 节点组下属节点列表查询,同 "2.1.1.1 节点列表查询",请求参数"groupId"为必须参数
2.1.2.4 节点组新增
  • 接口说明: 节点组新增
  • 接口地址: /nodegroup/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 名称
systemId Integer O 业务系统ID
pid Integer R 父ID
remark String O 备注

示例:

{
    "name": "节点组4",
    "systemId": 1,
    "pid": 1,
    "remark": "en"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}
2.1.2.5 节点组修改
  • 接口说明: 节点组修改
  • 接口地址: /nodegroup/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 名称
remark String O 备注

示例:

{
    "id": 35,
    "name": "节点组4",
    "remark": "enaccc"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}
2.1.2.6 节点组删除
  • 接口说明: 节点组删除
  • 接口地址: /nodegroup/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
	"id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.1.2.7 可分配节点查询
  • 接口说明: 查询可以分配给指定节点组的节点
  • 接口地址: /nodegroup/assList
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
groupId Integer R 节点组id
systemId Integer R 业务系统id
ip String O ip查询条件,支持模糊查询

示例:

GET /nodegroup/assList?groupId=3&systemId=1&ip=192
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
name String R 名称
hostName String R 主机名
ip String R ip
uuid Integer R 全局唯一
type String R 设备类型,返回国际化翻译后的“服务器”、“网元”
tagName String R 设备标签名称与sys_dict code关联type:node-type

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "name": "node1",
            "hostName": "ysp-01",
            "ip": "192.168.10.1",
            "uuid": 1,
            "type": "服务器",
            "tagName": "server9"
        }]
    }
}
2.1.2.8 节点组分配节点
  • 接口说明: 建立节点组--节点关系
  • 接口地址: /nodegroup/saveNodeRel
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
id Integer R 节点组id
uuids Integer[] R 节点id

示例:

{
    "id": 2,
    "uuids": [3, 43]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.1.2.9 节点组移除节点
  • 接口说明: 解除节点组--节点关系
  • 接口地址: /nodegroup/deleteNodeRel
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R 节点组id
uuids Integer[] R 节点id

示例:

{
    "id": 2,
    "uuids": [3, 11]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.1.2.10 节点组名称校验
  • 接口说明: 节点组名称校验,同父节点下名称不能重复
  • 接口地址: /nodegroup/groupNameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer O 节点组ID为空表示正在新增节点组
name String R 名称
pid Integer R 父节点组id

示例:

GET /nodegroup/groupNameCheck?pid=5&id=15&name=group2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}

2.1.3 机房管理

2.1.3.1 机房列表查询
  • 接口说明: 机房列表查询
  • 接口地址: /room/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
name String O 机房名称
area Integer O 所属区域

示例:

GET /room/list?pageSize=10&currPage=2&name=room2&area=43
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R 主键
name String R 机房名称
rows Integer R 行数
cols Integer R 列数
addr Integer R 地区
remarks String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "room2",
            "rows": 4,
            "cols": 6,
            "addr": 1,
            "remarks": ""
        }]
    }
}
2.1.3.2 机房详情查询
  • 接口说明: 机房列表查询
  • 接口地址: /room/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R 机房id

示例:

GET /room/detail?id=4
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R 主键
name String R 机房名称
rows Integer R 行数
cols Integer R 列数
addr Integer R 地区
remarks String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "room2",
        "rows": 4,
        "cols": 6,
        "addr": 1,
        "remarks": ""
    }
}
2.1.3.3 机房新增
  • 接口说明: 机房新增
  • 接口地址: /room/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 名称
rows Integer R 行数
cols Integer R 列数
addr Integer R 地区
remark String O 备注

示例:

{
    "name": "room9",
    "rows": 2,
    "cols": 4,
    "addr": 54,
    "remark": "en"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}
2.1.3.4 机房修改
  • 接口说明: 机房修改
  • 接口地址: /room/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 名称
rows Integer R 行数
cols Integer R 列数
addr Integer R 地区
remark String O 备注

示例:

{
    "id": 9,
    "name": "room9",
    "rows": 2,
    "cols": 4,
    "addr": 54,
    "remark": "en"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}
2.1.3.5 机房删除
  • 接口说明: 机房删除
  • 接口地址: /room/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "存在关联的机柜"
}
2.1.3.6 机房名称校验
  • 接口说明: 机房名称校验,不能重复
  • 接口地址: /room/roomNameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增节点组
name String R 父id

示例:

GET /room/roomNameCheck?pid=5&id=15
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}
2.1.3.7 机房修改时行列校验
  • 接口说明: 机房修改时行列校验,行、列数不能小于已被机柜占用的数
  • 接口地址: /room/roomSizeCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String R 唯一标识
cols Integer R 列数
rows Integer R 行数

示例:

GET /room/roomSizeCheck?id=15&cols=5&rows=3
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
失败
{
    "code": 600,
    "msg": "原因"
}
2.1.3.8 机房内机柜列表查询
  • 接口说明: 查询机房内的机柜列表,同"2.1.4.1 机柜列表查询""roomId"为必须参数

2.1.4 机柜管理

2.1.4.1 机柜列表查询
  • 接口说明: 机柜列表查询
  • 接口地址: /cab/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
name String O 机柜名称
roomId Integer O 所属机房id

示例:

GET /cab/list?pageSize=10&currPage=2&name=cab3&roomId=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R 主键
name String R 机柜名称
roomName String R 机房名称
row Integer R 行号
col Integer R 列号
ubit Integer R u位数量
remarks String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": [{
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "cab2",
            "roomName": "room2",
            "rows": 4,
            "cols": 6,
            "ubit": 1,
            "remarks": ""
        }]
    }]
}
2.1.4.2 机柜详情查询
  • 接口说明: 机柜列表查询
  • 接口地址: /cab/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer O 机柜id

示例:

GET /cab/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R 主键
name String R 机柜名称
roomName String R 机房名称
row Integer R 行号
col Integer R 列号
ubit Integer R u位数量
nodes Object[] R 包含的节点
uuid Integer R uuid
ip String R ip
name String R 节点名称
uSize Integer R u位大小
uStart Integer R 起始U位
remarks String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "cab2",
        "roomName": "room2",
        "rows": 4,
        "cols": 6,
        "nodes": [{
            "uuid": 5,
            "ip": "1.2.3.4",
            "name": "node2",
            "uSize": 3,
            "uStart": 1
        }],
        "ubit": 1,
        "remarks": ""
    }
}
2.1.4.3 机柜新增
  • 接口说明: 机柜新增
  • 接口地址: /cab/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 名称
roomId Integer R 机房id
row Integer R 行号
col Integer R 列号
ubit Integer R U位数量
remark String O 备注

示例:

{
    "name": "cab9",
	"roomId": 1,
    "row": 2,
    "col": 4,
    "ubit": 12,
	"remark": "en"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "xxx"
}
2.1.4.4 机柜修改
  • 接口说明: 机柜修改
  • 接口地址: /cab/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 名称
row Integer R 行号
col Integer R 列号
ubit Integer R U位数量
remark String O 备注

示例:

{
    "id": 9,
    "name": "cab9",
    "row": 2,
    "col": 4,
    "ubit": 12,
    "remark": "en"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "xxx"
}
2.1.4.5 机柜删除
  • 接口说明: 机柜删除
  • 接口地址: /cab/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "success/存在关联的节点"
}
2.1.4.6 机柜名称校验
  • 接口说明: 机柜名称校验,同机房下名称不能重复
  • 接口地址: /cab/cabNameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增
name String R 名称
roomId Integer R 机房id

示例:

GET /cab/cabNameCheck?id=5&roomId=15&name=cab54
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "xxx"
}
2.1.4.7 校验U位数量是否可用
  • 接口说明: 机柜名称校验,同机房下名称不能重复
  • 接口地址: /cab/cabUbitCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增
ubit Integer R U位数量

示例:

GET /cab/cabUbitCheck?id=5&ubit=15
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "xxx"
}
2.1.4.8 查询机柜可选的机房及行号列号
  • 接口说明: 查询机柜下可选的机房及行号列号
  • 接口地址: /cab/optionalRoom
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增

示例:

GET /cab/cabUbitCheck?id=5
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg String R  
data Object R  
list Object[] R  
roomId Integer R 房间id
roomName String R 房间名称
rows Object[] R 可用行
row Integer R 可用行号
cols Integer[] R 可用列号

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "list": [{
            "roomId": 1,
            "roomName": "room88",
            "rows": [{
                "row": 1,
                "cols": [1,3,4]
            },
            {
                "row": 2,
                "cols": [1,2,3,4,7,8,9]
            }]
        }]
    }
}

2.2 权限

2.2.1 业务系统

2.2.1.1 业务系统列表查询
  • 接口说明: 业务系统列表查询
  • 接口地址: /system/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
usergroupId Integer C 用户组id

示例:

GET /system/list?pageSize=10&currPage=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R 编号
name String R 系统名称
builtIn Integer R 是否内置内置不可删除1内置0非内置
remarks String R 备注信息
createDate Date R 创建时间
updateDate Date R 更新时间
delFlag Integer R 删除标记 1删除0未删除默认0

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "system1",
            "builtIn": 1,
            "remarks": "",
            "delFlag": 0,
            "createDate": "2019-07-10 10:10:10",
            "updateDate": "2019-07-10 10:10:10"
        }]
    }
}
2.2.1.2 业务系统详情查询
  • 接口说明: 业务系统详情查询
  • 接口地址: /system/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer O 业务系统id

示例:

GET /system/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R 编号
name String R 系统名称
builtIn Integer R 是否内置内置不可删除1内置0非内置
createBy Integer R 创建者
createDate Date R 创建时间
updateBy Integer R 更新者
updateDate Date R 更新时间
remarks String R 备注信息
delFlag Integer R 删除标记 1删除0未删除默认0
usergroups Object[] R 用户组列表
id Integer R 用户组ID
name Integer R 用户组名称

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "system2",
        "builtIn": 1,
        "createBy": 1,
        "createDate": "2019-07-10 10:10:10",
        "updateBy": 1,
        "updateDate": "2019-07-10 10:10:10",
        "remarks": "",
        "delFlag": 1,
        "usergroups": [{
            "id": 2,
            "name": "group1"
        },
        {
            "id": 3,
            "name": "group2"
        }]
    }
}
2.2.1.3 业务系统新增
  • 接口说明: 业务系统新增
  • 接口地址: /system/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 名称
remark String O 备注
usergroupIds Integer[] O 用户组id,分配现有节点组

示例:

{
    "name": "system22",
    "remark": "en",
    "usergroupIds": [1,2,3,4]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "xxx"
}
2.2.1.4 业务系统修改
  • 接口说明: 业务系统修改
  • 接口地址: /system/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 名称
remark String O 备注
usergroupIds Integer[] O 用户组id

示例:

{
    "id": 9,
    "name": "cab9",
    "remark": "en",
    "usergroupIds": [1,2,3,4]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600
    "msg": "xxx"
}
2.2.1.5 业务系统删除
  • 接口说明: 业务系统删除
  • 接口地址: /system/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200
    "msg": "xxx"
}
2.2.1.6 查询业务系统下的节点
  • 接口说明: 查询业务系统下的节点
  • 接口地址: /system/nodes
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R 业务系统id

示例:

GET /system/nodes?id=5
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg String R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
name String R 名称
hostName String R 主机名
ip String R ip
uuid Integer R 全局唯一
type Integer R 设备类型1、server,2、net
tagName String R 设备标签名称
tag Integer R 设备标签与sys_dict关联
state String R 设备状态1在线2下线3删除
remark String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "a",
            "hostName": "b",
            "ip": "112.21.122.212",
            "uuid": 1,
            "tagName": "atc",
            "type": 1,
            "tag": 1,
            "state": 1,
            "remark": ""
        }]
    }
}
2.2.1.7 业务系统分配节点
  • 接口说明: 建立业务系统--节点关系
  • 接口地址: /system/saveNodeRel
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R 业务系统id
uuids Integer[] R 节点id

示例:

GET /system/saveNodeRel?id=3&uuids=4
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.2.1.8 业务系统移除节点
  • 接口说明: 解除业务系统--节点关系
  • 接口地址: /system/deleteNodeRel
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R 业务系统id
uuids Integer[] R 节点id

示例:

GET /system/deleteRel?id=3&uuids=4,42,3
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.2.1.9 业务系统名称校验
  • 接口说明: 业务系统名称校验,同父节点下名称不能重复
  • 接口地址: /system/nameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增业务系统
name String R 名称

示例:

GET /system/nameCheck?id=5&name=system2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.2.1.10 用户组列表
  • 接口说明: 用于新增/修改业务系统时展示用户组,同 "2.2.2.1 用户组列表查询",请求参数"systemId"为必须参数

2.2.2 用户组

2.2.2.1 用户组列表查询
  • 接口说明: 用户组列表查询
  • 接口地址: /usergroup/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
systemId Integer C 业务系统id

示例:

GET /usergroup/list?pageSize=10&currPage=2&systemId=4
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R 主键
name String R 用户组名称
remark String R 备注信息
systemInfos Object[] R 业务系统
id Integer R 业务系统id
name String R 业务系统名称
users Object[] R 用户组内的用户
id Integer R 用户id
username String R 用户登录名

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "usergroup1",
            "remarks": "",
            “systemInfos": [{
                "id": 1,
                "name": "system1"
            }],
            "users": [{
                "id": 1,
                "username": "admin"
            }]
        }]
    }
}
2.2.2.2 用户组详情查询
  • 接口说明: 用户组详情查询
  • 接口地址: /usergroup/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer O 用户组id

示例:

GET /usergroup/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R 主键
name String R 用户组名称
remark String R 备注信息
systemInfos Object[] R 业务系统
id Integer R 业务系统id
name String R 业务系统名称
users Object[] R 用户组内的用户
id Integer R 用户id
username String R 用户登录名

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "usergroup1",
        "remarks": "",
        “systemInfos": [{
            "id": 1,
            "name": "system1"
        }],
        "users": [{
            "id": 1,
            "username": "admin"
        }]
    }
}
2.2.2.3 用户组新增
  • 接口说明: 用户组新增
  • 接口地址: /usergroup/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 名称
remark String O 备注
systemIds Integer[] O 业务系统id
userIds Integer[] O 用户id

示例:

{
    "name": "usergroup22",
    "remark": "en",
    "systemIds": [1,2,3,4],
    "userIds": [1,3]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.2.2.4 用户组修改
  • 接口说明: 用户组修改
  • 接口地址: /usergroup/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 名称
remark String O 备注
systemIds Integer[] O 业务系统id
userIds Integer[] O 用户id

示例:

{
    "id": 9,
    "name": "cab9",
    "remark": "en",
    "systemIds": [1,2,3,4],
    "userIds": [1,3]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.2.2.5 用户组删除
  • 接口说明: 用户组删除
  • 接口地址: /usergroup/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.2.2.6 业务系统列表
  • 接口说明: 用于新增/修改用户组时展示业务系统,同 "2.2.1.1 业务系统列表查询",请求参数"usergroupId"为必须参数
2.2.2.7 用户组名称校验
  • 接口说明: 用户组名称校验,不能重复
  • 接口地址: /usergroup/nameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增
name String R 名称

示例:

GET /usergroup/nameCheck?id=5&name=ug2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}

2.3 监测配置

2.3.1 监测类别

2.3.1.1 监测类别列表查询
  • 接口说明: 监测类别列表查询
  • 接口地址: /deteType/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
name String O 监测类别

示例:

GET /deteType/list?pageSize=10&currPage=2&name=cpu
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R  
name String R 名称,唯一索引
method String R 1、脚本2、snmp3、内置默认1页面显示翻译后内容
interval Integer R 监控间隔单位s默认60
content String R 1、脚本储存路径2、oid可以为空3、类全路径
buildIn String R 1、隐藏界面不显示2、内置不允许修改3、用户自定义默认3
version Integer R 更新version加1默认1
i18nCode String R name 的国际化 code不为空时页面显示翻译后的内容为空直接显示name
remark String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
           "id": 1,
           "name": "",
           "viewLevel": "",
           "method": "",
           "interval": 1,
           "content": "",
           "buildIn": "",
           "tableName": "",
           "version": 1,
           "i18nCode": "",
           "remark": ""
        }]
    }
}
2.3.1.2 监测类别详情查询
  • 接口说明: 监测类别详情查询,返回监测类别、元数据和参数
  • 接口地址: /deteType/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R 类别id

示例:

GET /deteType/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R  
name String R 名称,唯一索引
method String R 1、脚本2、snmp3、内置默认1显示翻译后的内容
interval Integer R 监控间隔单位s默认60
content String R 1、脚本储存路径2、oid可以为空3、类全路径
i18nCode String R name 的国际化 code不为空时name显示翻译后的内容为空直接显示
remark String R 备注
opTime String R 操作时间
deteTypeMetas Object[] R 元数据列表
id Integer R  
name String R 显示名称,唯一索引
typeId Integer R 类别id
fieldType String R 字段分类1:Tag 数据库添加索引 ,2:field 普通字段, 3:temp 临时字段,数据传输不入库, 4:cal 计算字段根据fieldtemp计算得出
dataType String R 数据类型1:counter需要根据上一个监测周期的数据差值计算2gauge瞬时值 3string 字符类型
dataLenth Integer R 数据长度
sort Integer R 排序
oid String R snmp oid
unit String R 单位
dicType Integer O 字典类型
i18nCode String R name 的国际化 code不为空时name显示翻译后的内容为空直接显示name
remark String R 备注
deteTypeParams Object[] R 类别参数数组
id Integer R
name String R 参数名称
typeId Integer R 类别id
index Integer R 参数索引
default String R 参数默认值
remark String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "enc",
        "method": "脚本",
        "interval": 60,
        "content": "",
        "i18nCode": "cpu监测",
        "remark": "",
        "opTime": "2019-07-10 10:10:10",
        "deteTypeMetas": [{
            "id": 1,
            "name": "earae",
            "typeId": 1,
            "fieldType": "",
            "dataType": "",
            "dataLenth": 1,
            "sort": 1,
            "oid": "",
            "unit": "",
            "dicType": 2,
            "i18nCode": "",
            "remark": ""
        }],
        "deteTypeParams": [{
            "id": 1,
            "name": "cc",
            "typeId": 1,
            "index": 1,
            "default": "",
            "remark": ""
        }]
    }
}
2.3.1.3 监测类别新增
  • 接口说明: 监测类别新增
  • 接口地址: /deteType/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 唯一索引
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
method String R 1、脚本2、snmp3、内置默认1
interval Integer R 监控间隔单位s默认60
content String R 1、脚本储存路径2、oid可以为空3、类全路径
i18nCode String R name 的国际化 code不为空时name显示翻译后的内容为空直接显示
remark String R 备注
deteTypeMetas Object[] R 元数据数据
id Integer R
name String R 显示名称,唯一索引
typeId Integer R 类别id
fieldType String R 字段分类1:Tag 数据库添加索引 ,2:field 普通字段, 3:temp 临时字段,数据传输不入库, 4:cal 计算字段根据fieldtemp计算得出
dataType String R 数据类型1:counter需要根据上一个监测周期的数据差值计算2gauge瞬时值 3string 字符类型
dataLenth Integer R 数据长度
sort Integer R 排序
oid String R snmp oid
unit String R 单位
dicType Integer O 字典类型
i18nCode String R name 的国际化 code不为空时name显示翻译后的内容为空直接显示name
remark String R 备注
deteTypeParams Object[] R 类别参数数组
id Integer R
name String R 参数名称
typeId Integer R 类别id
index Integer R 参数索引
default String R 参数默认值
remark String R 备注

示例:

    {
        "name": "enc",
        "typeId": 1,
        "fieldType": "1",
        "dataType": "2",
        "dataLenth": 1,
        "viewLevel": "2",
        "sort": 1,
        "oid": "",
        "unit": "",
        "fieldName": "",
        "i18nCode": "",
        "remark": "",
		"deteTypeMetas": [{
            "id": 1,
            "name": "earae",
            "typeId": 1,
            "fieldType": "",
            "dataType": "",
            "dataLenth": 1,
            "sort": 1,
            "oid": "",
            "unit": "",
            "dicType": 2,
            "i18nCode": "",
            "remark": ""
        }],
        "deteTypeParams": [{
            "id": 1,
            "name": "cc",
            "typeId": 1,
            "index": 1,
            "default": "",
            "remark": ""
        }]
    }
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.3.1.4 监测类别修改
  • 接口说明: 监测类别修改
  • 接口地址: /deteType/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 唯一索引
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
method String R 1、脚本2、snmp3、内置默认1
interval Integer R 监控间隔单位s默认60
content String R 1、脚本储存路径2、oid可以为空3、类全路径
i18nCode String R name 的国际化 code不为空时name显示翻译后的内容为空直接显示
remark String R 备注
deteTypeMetas Object[] R 元数据数据
id Integer R  
name String R 显示名称,唯一索引
typeId Integer R 类别id
fieldType String R 字段分类1:Tag 数据库添加索引 ,2:field 普通字段, 3:temp 临时字段,数据传输不入库, 4:cal 计算字段根据fieldtemp计算得出
dataType String R 数据类型1:counter需要根据上一个监测周期的数据差值计算2gauge瞬时值 3string 字符类型
dataLenth Integer R 数据长度
sort Integer R 排序
oid String R snmp oid
unit String R 单位
dicType Integer O 字典类型
i18nCode String R name 的国际化 code不为空时name显示翻译后的内容为空直接显示name
remark String R 备注
deteTypeParams Object[] R 类别参数数组
id Integer R
name String R 参数名称
typeId Integer R 类别id
index Integer R 参数索引
default String R 参数默认值
remark String R 备注

示例:

    {
        "id": 223
        "name": "enc",
        "typeId": 1,
        "fieldType": "1",
        "dataType": "2",
        "dataLenth": 1,
        "viewLevel": "2",
        "sort": 1,
        "oid": "",
        "unit": "",
        "fieldName": "",
        "i18nCode": "",
        "remark": "",
		"deteTypeMetas": [{
            "id": 1,
            "name": "earae",
            "typeId": 1,
            "fieldType": "",
            "dataType": "",
            "dataLenth": 1,
            "sort": 1,
            "oid": "",
            "unit": "",
            "dicType": 2,
            "i18nCode": "",
            "remark": ""
        }],
        "deteTypeParams": [{
            "id": 1,
            "name": "cc",
            "typeId": 1,
            "index": 1,
            "default": "",
            "remark": ""
        }]
    }
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.3.1.5 监测类别删除
  • 接口说明: 监测类别删除
  • 接口地址: /deteType/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.3.1.6 元数据字典查询
  • 接口说明: 监测类别字典查询
  • 接口地址: /deteType/dic
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
type Integer C 类型,字典管理页用

示例:

GET /deteType/dic
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
type Integer R 映射类型
mappings Object[] R 映射内容
id String R mapping表主键
val String R 原值
mapping String R 映射后值

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "list": [{
            "type": 18,
            "mappings": [{
                "id": 11,
                "val": "1",
                "mapping": "是"
            }]
        }]
    }
}
2.3.1.7 监测类别名称校验
  • 接口说明: 监测类别名称校验,不能重复
  • 接口地址: /deteType/nameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增监测类别
name String R 名称

示例:

GET /deteType/nameCheck?id=5&name=cpu
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "true/false"
}

2.3.2 监测设置

2.3.2.1 监测设置列表查询
  • 接口说明: 监测类别列表查询
  • 接口地址: /deteSet/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
name String O 监测设置
typeId Integer O 监测类别ID

示例:

GET /deteSet/list?pageSize=10&currPage=2&name=cpu
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R 主键
name String R 设置名称,唯一索引
type Object R 类别
id Integer R 类别ID
name String R 类别名称
buildIn String R 1:内置2用户自定义默认2
params String R 类别定义的参数,多个逗号分隔,参数内逗号需要转义
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
state String R 状态1删除2停止3监控中
remark String R 备注
i18nCode String R name i18n code值
operator Integer R 操作人
opTime Date R 操作时间

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "cpu",
            "type": {
                "id": 2,
                "name": "cpu"
            },
            "buildIn": "1",
            "params": "",
            "viewLevel": "",
            "state": "",
            "remark": "",
            "i18nCode": ""
        }]
    }
}
2.3.2.2 监测设置详情查询
  • 接口说明: 监测设置详情查询
  • 接口地址: /deteSet/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R

示例:

GET /deteSet/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R 主键
name String R 设置名称,唯一索引
type Object R 类别
id Integer R 类别ID
name String R 类别名称
params Object[] R 类别参数
id Integer R 参数id
name String R 参数名称
default String R 参数默认值
buildIn String R 1:内置2用户自定义默认2
params String R 类别定义的参数,多个逗号分隔,参数内逗号需要转义
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
state String R 状态1删除2停止3监控中
remark String R 备注
i18nCode String R name i18n code值
opTime Date R 操作时间
nodeGroups Object[] R 节点组
id Integer R 节点组id
name String R 节点组名称
nodes Object[] R 节点
uuid Integer R 节点id
name String R 节点名称
ip String R 节点ip

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "cpu",
        "type": {
            "id": 2,
            "name": "cpu",
            "params": [{
                "id": 2,
                "name": "a",
                "default": "12"
            }]
        },
        "buildIn": "1",
        "params": "",
        "viewLevel": "",
        "state": "",
        "remark": "",
        "i18nCode": "",
        "nodeGroups": [{
            "id": 1,
            "name": "group1"
        }],
        "nodes": [{
            "uuid": 9,
            "name": "node1",
            "ip": "10.20.30.40"
        }]
    }
}
2.3.2.3 监测设置新增
  • 接口说明: 监测设置新增
  • 接口地址: /deteSet/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 设置名称,唯一索引
typeId Integer R 类别id
params String R 类别定义的参数,多个逗号分隔,参数内逗号需要转义
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
remark String R 备注
i18nCode String R name i18n code值
nodeGroupIds Integer[] R 节点组id
nodeIds String[] R 节点id

示例:

{
    "name": "",
    "typeId": 1,
    "params": "1,'a',3",
    "viewLevel": "",
    "remark": "",
    "i18nCode": "",
    "nodeGroupIds": [1,2,3],
    "nodeIds": ["awe5r4a3w1fa6w8e54rw","hrdshs4tj4aw4e5Q4EQ","rqwerwat5wa5et75ew456"]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.3.2.4 监测设置修改
  • 接口说明: 监测设置修改
  • 接口地址: /deteSet/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 设置名称,唯一索引
typeId Integer R 类别id
params String R 类别定义的参数,多个逗号分隔,参数内逗号需要转义
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
remark String R 备注
i18nCode String R name i18n code值
nodeGroupIds Integer[] R 节点组id
nodeIds Integer[] R 节点id

示例:

{
	"id": 3
    "name": "eeee",
    "typeId": 1,
    "params": "1,'a',3",
    "viewLevel": "1",
    "remark": "",
    "i18nCode": "",
    "nodeGroupIds": [1,2,3],
    "nodes": [4,5,6]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.3.2.5 监测设置删除
  • 接口说明: 监测类别删除
  • 接口地址: /deteSet/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.3.2.6 监测设置名称校验
  • 接口说明: 监测类别名称校验,不能重复
  • 接口地址: /deteSet/nameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增监测类别
name String R 名称

示例:

GET /deteSet/nameCheck?id=5&name=cpu
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "true/false"
}

2.3.3 告警设置

2.3.3.1 告警设置列表查询
  • 接口说明: 监测类别列表查询
  • 接口地址: /deteWarn/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
setId Integer O 监测设置ID
typeId Integer O 监测类别ID

示例:

GET /deteWarn/list?pageSize=10&currPage=2&setId=12
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R  
name String R  
deteType Object R 监测类别
id Integer R 类别id
name String R 类别名称
deteSet Object[] O 监测设置
id Integer R 设置id
name String R 设置名称
meta Object R 告警字段
id Integer R 字段id
name String R 字段名称
trigger String R 1:阈值触发,2变化触发当本次监测数值与上次不一致时触发用于配置文件是否修改等,3主动默认1
mode String R 告警模式1、单台2、汇总
statType String R 1:avg 2:count 3:sum 4:min 5:max默认1
symbol String R 1:> 2:< 3:= 4:equals 5:include 6:exclude 默认1
threshold String R 阈值
tips String R 告警提示信息
level String R 告警级别1:normal2:info3:warning4:error默认3
callbackType String R 回调方式0:无1shell2http默认0
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
remark String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "",
            "deteType": {
                "id": 1,
                "name": "22ww"
            },
            "deteSet": [{
                "id": 2,
                "name": "2211"
            }],
            "meta": {
                "id": 2, 
                "name": "使用率"
            },
            "trigger": "1",
            "mode": "2",
            "statType": "1",
            "symbol": ">",
            "threshold": "15",
            "tips": "enen",
            "level": "1",
            "callbackType": "",
            "viewLevel": "",
            "remark": ""
        }]
    }
}
2.3.3.2 告警设置详情查询
  • 接口说明: 告警设置详情查询
  • 接口地址: /deteWarn/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R  

示例:

GET /deteWarn/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R  
name String R  
deteType Object R 监测类别
id Integer R 类别id
name String R 类别名称
deteSet Object[] O 监测设置
id Integer R 设置id
name String R 设置名称
meta Object R 告警字段
id Integer R 字段id
name String R 字段名称
trigger String R 1:阈值触发,2变化触发当本次监测数值与上次不一致时触发用于配置文件是否修改等,3主动默认1
mode String R 告警模式1、单台2、汇总
statType String R 1:avg 2:count 3:sum 4:min 5:max默认1
symbol String R 1:> 2:< 3:= 4:equals 5:include 6:exclude 默认1
threshold String R 阈值
tips String R 告警提示信息
level String R 告警级别1:normal2:info3:warning4:error默认3
callbackType String R 回调方式0:无1shell2http默认0
callbackContent String R 回调内容
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
remark String R 备注

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "",
        "deteType": {
            "id": 1,
            "name": "22ww"
        },
        "deteSet": [{
            "id": 2,
            "name": "2211"
        }],
        "meta": {
            "id": 2, 
            "name": "使用率"
        },
        "trigger": "1",
        "mode": "2",
        "statType": "1",
        "symbol": ">",
        "threshold": "15",
        "tips": "enen",
        "level": "1",
        "callbackType": "",
        "viewLevel": "",
        "remark": ""
    }
}
2.3.3.3 告警设置新增
  • 接口说明: 告警设置新增
  • 接口地址: /deteWarn/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R  
deteTypeId Integer R 监测类别id
deteSetIds Integer[] O 监测设置id
metaId Integer R 告警字段id
trigger String R 1:阈值触发,2变化触发当本次监测数值与上次不一致时触发用于配置文件是否修改等,3主动默认1
mode String R 告警模式1、单台2、汇总
statType String R 1:avg 2:count 3:sum 4:min 5:max默认1
symbol String R 1:> 2:< 3:= 4:equals 5:include 6:exclude 默认1
threshold String R 阈值
tips String R 告警提示信息
level String R 告警级别1:normal2:info3:warning4:error默认3
callbackType String R 回调方式0:无1shell2http默认0
callbackContent String R 回调内容
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
remark String R 备注

示例:

{
    "name": "",
    "deteTypeId": 32,
    "deteSetIds": [1,2,3],
    "metaId": 1,
    "trigger": "",
    "mode": "",
    "statType": "",
    "symbol": "",
    "threshold": "",
    "tips": "",
    "level": "",
    "callbackType": "",
    "callbackContent": "",
    "viewLevel": "",
    "remark": ""
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.3.3.4 告警设置修改
  • 接口说明: 告警设置修改
  • 接口地址: /deteWarn/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R 主键
name String R  
metaId Integer R 告警字段id
trigger String R 1:阈值触发,2变化触发当本次监测数值与上次不一致时触发用于配置文件是否修改等,3主动默认1
mode String R 告警模式1、单台2、汇总
statType String R 1:avg 2:count 3:sum 4:min 5:max默认1
symbol String R 1:> 2:< 3:= 4:equals 5:include 6:exclude 默认1
threshold String R 阈值
tips String R 告警提示信息
level String R 告警级别1:normal2:info3:warning4:error默认3
callbackType String R 回调方式0:无1shell2http默认0
callbackContent String R 回调内容
viewLevel String R 1:用户组2系统内全部人员3无限制默认2
remark String R 备注

示例:

{
    "id": 133,
    "name": "",
    "metaId": 1,
    "trigger": "",
    "mode": "",
    "statType": "",
    "symbol": "",
    "threshold": "",
    "tips": "",
    "level": "",
    "callbackType": "",
    "callbackContent": "",
    "viewLevel": "",
    "remark": ""
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.3.3.5 告警设置删除
  • 接口说明: 告警类别删除
  • 接口地址: /deteWarn/delete
  • 请求方式: DELETE
请求参数
参数名称 类型 出现要求 描述
id Integer R id

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200,
    "msg": "success"
}
2.3.3.6 告警名称校验
  • 接口说明: 监测类别名称校验,不能重复
  • 接口地址: /deteWarn/nameCheck
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id String O 唯一标识,为空表示正在新增监测类别
name String R 名称

示例:

GET /deteWarn/nameCheck?id=5&name=cpu
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A

示例:

{
    "code": 200/600,
    "msg": "true/false"
}

2.4 任务

2.4.1 任务

2.4.1.1 任务列表查询
  • 接口说明: 任务列表查询
  • 接口地址: /mission/list
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
page Integer O 页码为空时默认为1
limit Integer O 每页记录数为空时默认为10
order String O 排序
isLoop String O 是否周期任务 0不是1
type String O 任务类型 1文件推送2命令执行3升级部署
isLoop String O 是否周期任务 0不是1
name String O 任务名称

示例:

GET /usergroup/list?pageSize=10&currPage=2&name=file&isLoop=0
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R  
name String R 任务名称
type String R 任务类型1、文件推送2、命令执行3、升级部署
state String R 任务状态周期任务有效0、非周期任务1、运行2、暂停3、终止
stateDesc String R 任务状态描述,成功几个失败几个等
viewLevel String R 查看权限 1:用户组2系统内全部人员3无限制默认2
viewer String R 查看人,组名或业务系统名
isLoop String R 是否周期任务0不是1
loopInterval Integer R 周期间隔,单位分钟
param String R 任务参数json方式保存
remark String R 备注
operator String R 操作人登录名
opTime Date R 操作时间

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "name": "task1",
            "type": "2",
            "state": "",
            "stateDesc": "成功1个未完成0个失败5个",
            "viewLevel": "1",
            "viewer": "group1",
            "isLoop": "0",
            "loopInterval": 1,
            "param": "",
            "remark": "",
            "operator": "admin",
            "opTime": "2007-07-07 07:07:07"
        }]
    }
}
2.4.1.2 任务详情查询
  • 接口说明: 任务详情查询
  • 接口地址: /mission/detail
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer O 用户组id

示例:

GET /usergroup/detail?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R  
name String R 任务名称
type String R 任务类型1、文件推送2、命令执行3、升级部署
state String R 任务状态周期任务有效0、非周期任务1、运行2、暂停3、终止
stateDesc String R 任务状态描述,成功几个失败几个等
viewLevel String R 查看权限 1:用户组2系统内全部人员3无限制默认2
viewer String R 查看人,组名或业务系统名
isLoop String R 是否周期任务0不是1
loopInterval Integer R 周期间隔,单位分钟
param String R 任务参数json方式保存
nodeGroups Object[] R 节点组
id Integer R 节点组id
name String R 节点组名称
nodes Object[] R 节点
uuid Integer R 节点id
ip String R 节点ip
name String R 节点名称
remark String R 备注
operator String R 操作人登录名
opTime Date R 操作时间

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "id": 1,
        "name": "task1",
        "type": "2",
        "state": "",
        "stateDesc": "成功1个未完成0个失败5个",
        "viewLevel": "1",
        "viewer": "group1",
        "isLoop": "0",
        "loopInterval": 1,
        "param": "",
		"nodeGroups": [{
			"id": 1,
			"name": "hehe"
		}],
		"nodes": [{
			"uuid": 2,
			"name": "haha",
			"ip": "10.20.20.10"
		}]
        "remark": "",
        "operator": "admin",
        "opTime": "2007-07-07 07:07:07"
    }
}
2.4.1.3 任务新增
  • 接口说明: 任务新增
  • 接口地址: /mission/save
  • 请求方式: POST
请求参数
参数名称 类型 出现要求 描述
name String R 任务名称
type String R 任务类型1、文件推送2、命令执行3、升级部署
state String R 任务状态周期任务有效0、非周期任务1、运行2、暂停3、终止
viewLevel String R 查看权限 1:用户组2系统内全部人员3无限制默认2
isLoop String R 是否周期任务0不是1
loopInterval Integer R 周期间隔,单位分钟
param String R 任务参数json方式保存
nodeGroupIds Integer[] R 节点组id
nodeIds Integer[] R 节点uuid
remark String R 备注

示例:

{
    "name": "",
    "type": "",
    "state": "",
    "viewLevel": "",
    "isLoop": "",
    "loopInterval": 1,
    "param": "",
    "remark": "",
    "nodeGroupIds": [1,2,3],
    "nodeIds": [7,8]
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.4.1.4 任务修改
  • 接口说明: 任务修改,只支持改名称、权限、备注
  • 接口地址: /mission/update
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
name String R 名称
remark String O 备注
viewLevel String R 查看权限 1:用户组2系统内全部人员3无限制默认2

示例:

{
    "id": 9,
    "name": "cab9",
    "remark": "en",
    "viewLevel": "1"
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/600,
    "msg": "success"
}
2.4.1.5 周期任务停用/启用
  • 接口说明: 周期任务停用/启用
  • 接口地址: /mission/loopStateChange
  • 请求方式: PUT
请求参数
参数名称 类型 出现要求 描述
id Integer R id
state String R 0: 停用1启用

示例:

{
    "id": 35
}
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  

示例:

{
    "code": 200/?,
    "msg": "success"
}
2.4.1.6 新增逆向任务
  • 接口说明: 获取逆向任务内容用于升级部署任务回退。获取内容后提交任务接口等同于2.4.1.3 任务新增
  • 接口地址: /mission/converse
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer O 需要逆向的任务的id

示例:

GET /mission/converse?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
id Integer R  
name String R 任务名称
type String R 任务类型1、文件推送2、命令执行3、升级部署
state String R 任务状态周期任务有效0、非周期任务1、运行2、暂停3、终止
stateDesc String R 任务状态描述,成功几个失败几个等
viewLevel String R 查看权限 1:用户组2系统内全部人员3无限制默认2
viewer String R 查看人,组名或业务系统名
isLoop String R 是否周期任务0不是1
loopInterval Integer R 周期间隔,单位分钟
param String R 任务参数json方式保存
nodeGroups Object[] R 节点组
id Integer R 节点组id
name String R 节点组名称
nodes Object[] R 节点
uuid Integer R 节点uuid
ip String R 节点ip
name String R 节点名称
remark String R 备注
operator String R 操作人登录名
opTime Date R 操作时间

示例:

{
    "code": 200,
    "msg": "success",
    "data": [{
        "id": 1,
        "name": "task1",
        "type": "2",
        "state": "",
        "stateDesc": "成功1个未完成0个失败5个",
        "viewLevel": "1",
        "viewer": "group1",
        "isLoop": "0",
        "loopInterval": 1,
        "param": "",
		"nodeGroups": [{
			"id": 1,
			"name": "hehe"
		}],
		"nodes": [{
			"uuid": 2,
			"name": "haha",
			"ip": "10.20.20.10"
		}]
        "remark": "",
        "operator": "admin",
        "opTime": "2007-07-07 07:07:07"
    }]
}
2.4.1.7 结果查看
  • 接口说明: 查看节点的任务执行情况
  • 接口地址: /mission/result
  • 请求方式: GET
请求参数
参数名称 类型 出现要求 描述
id Integer R 任务id

示例:

GET /mission/result?id=2
返回结果
参数名称 类型 出现要求 描述
code int R 响应码,详见 附录A
msg string R  
data Object R  
totalCount int R  
totalPage int R  
currPage int R  
list Object[] R  
id Integer R  
missionId Integer R  
node Object R 节点
uuid Integer R 节点标识
ip String R 节点ip
name String R 节点名称
desc String R 任务结果描述信息
state String R 任务执行状态
cycle Integer R 第几周期
file String R 回传文件路径
opTime Date R 操作时间

示例:

{
    "code": 200,
    "msg": "success",
    "data": {
        "totalCount": 1,
        "totalPage": 1,
        "currPage": 1,
        "list": [{
            "id": 1,
            "missionId": 1,
            "node": {
                "uuid": 4,
                "ip": "10.20.30.40",
                "name": "node1"
            },
            "desc": "",
            "state": "",
            "cycle": 1,
            "file": "",
            "opTime": "2019-07-10 10:10:10"
        }]
    }
}

3 附录A 响应码说明

响应码 说明
200 处理成功
301 解析报文错误
302 无效调用凭证
303 参数不正确
500 系统内部错误
600 校验不通过
999 处理失败