其它接口
同步第三方系统的用户和用户区域数据
URL地址:http://<ip>:<port>/api/sync_users_areas
用于同步第三方系统的用户和用户区域数据到3D系统中。HTTP POST方式,请求参数为一个JSON字符串,示例如下:
json
{
"users": [
{
"user_name": "test",
"user_pwd": "2c753ea97914b6b9542bfc5df1ad3c3b",
"ref_area_ids": [
"be980878592efddf9ee398a94178c102",
"21232f297a57a5a743894a0e4a801fc3"
]
}
],
"areas": [
{
"area_id": "be980878592efddf9ee398a94178c102",
"area_name": "用户区域A"
},
{
"area_id": "21232f297a57a5a743894a0e4a801fc3",
"area_name": "用户区域B"
},
{
"area_id": "233ad467ceac8343d7f794adb03718b1",
"area_name": "用户区域C"
}
]
}
JSON字符串由2部分组成,users(用户列表)、areas(用户区域列表)。
用户属性描述
属性名称 | 说明 |
---|---|
user_name | 用户名,字符串类型,必须 |
user_pwd | 用户密码,md5加密,字符串类型,必须 |
ref_area_ids | 关联的用户区域ID列表,字符串数组类型,非必须 |
用户区域属性描述
属性名称 | 说明 |
---|---|
area_id | 用户区域ID,字符串类型,必须 |
area_name | 用户区域名称,字符串类型,必须 |
注意
①“admin”是3D系统默认的超级管理员,“admin”限定为不可关联区域,即可查看所有场景层级;②所有从第三方系统同步过来的用户均赋予“普通用户”角色,即只能查看3D大屏;③所有从第三方系统同步过来的用户的过期时间均设定为永久,即永不过期。
HTTP返回结果为一个JSON字符串,示例如下:
json
{
"code": "1",
"message": "同步用户与用户区域数据成功!"
}
其中,code表示接口执行状态,值为“0”(失败)或“1”(成功);message表示消息。
同步第三方系统的管线数据
URL地址:http://<ip>:<port>/api/sync_pipelines
用于同步第三方系统的管线数据到3D系统中。HTTP POST方式,请求参数为一个JSON字符串,示例如下:
json
[
{
"start_type": "设备",
"start_field1": "S001",
"start_field2": "BYQ001",
"start_field3": "",
"start_name": "变压器1",
"end_type": "设备",
"end_field1": "S001",
"end_field2": "BYQ002",
"end_field3": "",
"end_name": "变压器2",
"style_name": "默认1",
"extension": ""
},
{
"start_type": "端口",
"start_field1": "C155",
"start_field2": "6e2e61f0",
"start_field3": "8",
"start_name": "FortiGate 60D/8",
"end_type": "端口",
"end_field1": "C364",
"end_field2": "c087892f",
"end_field3": "1",
"end_name": "intel b75软路由/1",
"style_name": "",
"extension": ""
}
]
管线数据属性描述
属性名称 | 说明 |
---|---|
start_type | 开始端点类型,字符串类型,必须,值为“设备”、“端口”之一 |
start_field1 | 开始端点字段1,字符串类型,必须,开始端点类型为“设备”时表示监控站点ID,为“端口”时表示机柜ID |
start_field2 | 开始端点字段2,字符串类型,必须,开始端点类型为“设备”时表示设备ID,为“端口”时表示资产设备ID |
start_field3 | 开始端点字段3,字符串类型,非必须,开始端点类型为“设备”时为空,为“端口”时表示设备端口ID |
start_name | 开始端点名称,字符串类型,必须 |
end_type | 结束端点类型,字符串类型,必须,值为“设备”、“端口”之一 |
end_field1 | 结束端点字段1,字符串类型,必须,结束端点类型为“设备”时表示监控站点ID,为“端口”时表示机柜ID |
end_field2 | 结束端点字段2,字符串类型,必须,结束端点类型为“设备”时表示设备ID,为“端口”时表示资产设备ID |
end_field3 | 结束端点字段3,字符串类型,非必须,结束端点类型为“设备”时为空,为“端口”时表示设备端口ID |
end_name | 结束端点名称,字符串类型,必须 |
style_name | 管线样式名称,字符串类型,非必须 |
extension | 扩展字段,字符串类型,非必须 |
HTTP返回结果为一个JSON字符串,示例如下:
json
{
"code": "1",
"message": "成功同步 2 条管线数据!"
}
其中,code表示接口执行状态,值为“0”(失败)或“1”(成功);message表示消息。