获取设备拓扑
获取设备拓扑列表
Enterprise在首次上线后,会发送http请求去获取同一个工作空间下的所有设备列表及其拓扑,服务端需要把整个设备列表发给Enterprise。同时,当接收到websocket指令通知设备online/offline/update的时候,也是需要调用该接口进行请求设备拓扑列表进行更新。
GET /manage/api/v1/workspaces/{workspace_id}/devices/topologies
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
workspace_id | path | string | true | 工作空间id(在同一个空间下的所有设备都可以互相共享设备拓扑及遥感信息) |
x-auth-token | header | string | true | 访问令牌 |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | tsa.GetWebPrjDeviceForOpenPlatformRsp |
Example responses
{
"code": 0,
"message": "success",
"data": {
"list": [
{
"hosts": [
],
"parents": [
{
"sn": "test",
"model": "test",
"boundStatus": false,
"domain": 41,
"device_callsign": "test",
"device_model": {
"domain": 41,
"type": 410000,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
},
{
"hosts": [
],
"parents": [
{
"sn": "NM1923361026",
"model": "测试机巢2",
"boundStatus": false,
"domain": 3,
"device_callsign": "测试机巢2",
"device_model": {
"domain": 3,
"type": 30001,
"sub_type": 0
},
"online_status": true,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
},
{
"hosts": [
],
"parents": [
{
"sn": "DOCK1748FEV3HMB923391016",
"model": "测试机巢_R10610",
"boundStatus": false,
"domain": 3,
"device_callsign": "测试机巢_R10610",
"device_model": {
"domain": 3,
"type": 30000,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
},
{
"hosts": [
{
"sn": "HMA923359003",
"model": "测试飞机11",
"boundStatus": false,
"gatewaySn": "NM1923261001",
"domain": 0,
"device_callsign": "测试飞机11",
"device_model": {
"domain": 0,
"type": 11000,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
],
"parents": [
{
"sn": "NM1923261001",
"model": "测试机巢1",
"boundStatus": false,
"domain": 3,
"device_callsign": "测试机巢1",
"device_model": {
"domain": 3,
"type": 30001,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
},
{
"hosts": [
{
"sn": "1748FEV3HMB923351062",
"model": "测试飞机(sst)",
"boundStatus": false,
"gatewaySn": "DOCK1748FEV3HMB923351062",
"domain": 0,
"device_callsign": "测试飞机(sst)",
"device_model": {
"domain": 0,
"type": 11000,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
],
"parents": [
{
"sn": "DOCK1748FEV3HMB923351062",
"model": "测试机巢5",
"boundStatus": false,
"domain": 3,
"device_callsign": "测试机巢5",
"device_model": {
"domain": 3,
"type": 30000,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
},
{
"hosts": [
{
"sn": "1748FEV3HMA922482077",
"model": "panfan_test_飞机2077",
"boundStatus": false,
"gatewaySn": "THtest234567",
"domain": 0,
"device_callsign": "panfan_test_飞机2077",
"device_model": {
"domain": 0,
"type": 11000,
"sub_type": 0
},
"online_status": true,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
],
"parents": [
{
"sn": "THtest234567",
"model": "123456",
"boundStatus": false,
"domain": 2,
"device_callsign": "123456",
"device_model": {
"domain": 2,
"type": 20119,
"sub_type": 0
},
"online_status": true,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
},
{
"hosts": [
],
"parents": [
{
"sn": "TH7923351722",
"model": "panfan_rc_test_1722",
"boundStatus": false,
"domain": 2,
"device_callsign": "panfan_rc_test_1722",
"device_model": {
"domain": 2,
"type": 20119,
"sub_type": 0
},
"online_status": false,
"user_callsign": "ws_device",
"icon_urls": {
"normal_icon_url": "",
"selected_icon_url": ""
}
}
]
}
]
}
}
Schemas
tsa.GetWebPrjDeviceForOpenPlatformRsp
{
"code":0,
"message":"success",
"data":{
"list":[
{
"hosts":[
{
"device_callsign":"string",
"device_model":{
"key":"string",
"domain":"string",
"type":"string",
"sub_type":"string"
},
"icon_urls":{
"normal_icon_url":"string",
"selected_icon_url":"string"
},
"online_status":true,
"sn":"string",
"user_callsign":"string",
"user_id":"string"
}
],
"parents":[
{
"device_callsign":"string",
"device_model":{
"key":"string",
"domain":"string",
"type":"string",
"sub_type":"string"
},
"icon_urls":{
"normal_icon_url":"string",
"selected_icon_url":"string"
},
"online_status":true,
"sn":"string",
"user_callsign":"string",
"user_id":"string"
}
]
}
]
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
list | [tsa.DeviceTopoRsp] | false | none | none |
tsa.DeviceTopoRsp
{
"hosts": [
{
"device_callsign": "string",
"device_model": {
"key":"string",
"domain":"string",
"type":"string",
"sub_type":"string"
},
"icon_urls": {
"normal_icon_url": "string",
"selected_icon_url": "string"
},
"online_status": true,
"sn": "string",
"user_callsign": "string",
"user_id": "string"
}
],
"parents": [
{
"device_callsign": "string",
"device_model": {
"key":"string",
"domain":"string",
"type":"string",
"sub_type":"string"
},
"icon_urls": {
"normal_icon_url": "string",
"selected_icon_url": "string"
},
"online_status": true,
"sn": "string",
"user_callsign": "string",
"user_id": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
hosts | [tsa.TopoHostDeviceRsp] | false | none | 飞机设备拓扑集合 |
parents | [tsa.TopoGatewayDeviceRsp] | false | none | 网关设备拓扑集合 |
tsa.TopoGatewayDeviceRsp
{
"device_callsign": "string",
"device_model": {
"key":"string",
"domain":"string",
"type":"string",
"sub_type":"string"
},
"icon_urls": {
"normal_icon_url": "string",
"selected_icon_url": "string"
},
"online_status": true,
"sn": "string",
"user_callsign": "string",
"user_id": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
device_callsign | string | false | none | 设备呼号 |
device_model | tsa.DeviceModelEnum | false | none | 设备枚举值结构体 |
icon_urls | object | false | none | 自定义图标,如果为空,则按device_model 类型自动加载。如果不为空,则按该配置来显示图片 |
» normal_icon_url | string | false | none | 常规状态下的icon |
» selected_icon_url | string | false | none | 选中状态下的icon |
online_status | boolean | false | none | 设备在线状态 |
sn | string | false | none | 设备序列号 |
user_callsign | string | false | none | 用户呼号 |
user_id | string | false | none | 用户id |
tsa.TopoHostDeviceRsp
{
"device_callsign": "string",
"device_model": {
"key":"string",
"domain":"string",
"type":"string",
"sub_type":"string"
},
"icon_urls": {
"normal_icon_url": "string",
"selected_icon_url": "string"
},
"online_status": true,
"sn": "string",
"user_callsign": "string",
"user_id": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
device_callsign | string | false | none | 设备呼号 |
device_model | tsa.DeviceModelEnum | false | none | 设备枚举值结构体 |
icon_urls | object | false | none | 自定义图标,如果为空,则按device_model 类型自动加载。如果不为空,则按该配置来显示图片 |
» normal_icon_url | string | false | none | 常规状态下的icon |
» selected_icon_url | string | false | none | 选中状态下的icon |
online_status | boolean | false | none | 设备在线状态 |
sn | string | false | none | 设备序列号 |
user_callsign | string | false | none | 用户呼号 |
user_id | string | false | none | 用户id |
tsa.DeviceModelEnum
{
"domain": "string",
"key": "string",
"sub_type": "string",
"type": "text"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
domain | string | false | none | 产品枚举值类型 |
key | string | false | none | 产品枚举值主键ID |
sub_type | string | false | none | 产品枚举值子型号 |
type | string | false | none | 产品枚举值主型号 |