Obtain Device Topology List

2022-07-19
No Rating

Obtain Device Topology List

In the first connection, DJI Pilot 2 will send out a http request to obtain all devices list and topology list. On the server end, it needs to synchronize the device list to the DJI Pilot 2. Also, if it receives a instruction of device online/offline/update from WebSocket, it needs the same interface to request the update of device topology list. GET /manage/api/v1/workspaces/{workspace_id}/devices/topologies

Parameters

NameInTypeRequiredDescription
workspace_idpathstringtrueworkspace id
x-auth-tokenheaderstringtrueaccess token

Responses

StatusMeaningDescriptionSchema
200OKopen in new windowOKtsa.GetWebPrjDeviceForOpenPlatformRsp

Example responses

{
	"code": 0,
	"message": "success",
	"data": {
		"list": [{
			"hosts": [{
				"sn": "drone01",
				"device_model": {
					"key": "0-60-0",
					"domain": "0",
					"type": "60",
					"sub_type": "0"
				},
				"online_status": true,
				"device_callsign": "救援飞机",
				"user_id": "string",
				"user_callsign": "string",
				"icon_urls": {
					"normal_icon_url": "resource://pilot/drawable/tsa_aircraft_others_normal",
					"selected_icon_url": "resource://pilot/drawable/tsa_aircraft_others_pressed"
				}
			}],
			"parents": [{
				"sn": "rc02",
				"online_status": true,
				"device_model": {
					"key": "2-56-0",
					"domain": "2",
					"type": "56",
					"sub_type": "0"
				},
				"device_callsign": "遥控器D",
				"user_id": "string",
				"user_callsign": "string",
				"icon_urls": {
					"normal_icon_url": "resource://pilot/drawable/tsa_aircraft_others_normal",
					"selected_icon_url": "resource://pilot/drawable/tsa_aircraft_others_pressed"
				}
			}]
		}]
	}
}

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

NameTypeRequiredRestrictionsDescription
list[tsa.DeviceTopoRsp]falsenonenone

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

NameTypeRequiredRestrictionsDescription
hosts[tsa.TopoHostDeviceRsp]falsenonedrone device topology collection
parents[tsa.TopoGatewayDeviceRsp]falsenonegateway device topology collection

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

NameTypeRequiredRestrictionsDescription
device_callsignstringfalsenonedevice callsign
device_modeltsa.DeviceModelEnumfalsenonedevice enum object
icon_urlsobjectfalsenoneCustom icon; if empty, it will be automatically loaded by device_model type. If not empty, display the picture according to this configuration
» normal_icon_urlstringfalsenoneicon in normal state
» selected_icon_urlstringfalsenoneicon in the selected state
online_statusbooleanfalsenonedevice online status
snstringfalsenoneserial number
user_callsignstringfalsenoneuser callsign
user_idstringfalsenoneuser 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

NameTypeRequiredRestrictionsDescription
device_callsignstringfalsenonedevice callsign
device_modeltsa.DeviceModelEnumfalsenonedevice enum object
icon_urlsobjectfalsenonecustom icon; if empty, it will be automatically loaded by device_model type. If not empty, display the picture according to this configuration
» normal_icon_urlstringfalsenoneicon in normal state
» selected_icon_urlstringfalsenoneicon in the selected state
online_statusbooleanfalsenonedevice online status
snstringfalsenoneserial number
user_callsignstringfalsenoneuser callsign
user_idstringfalsenoneuser id

tsa.DeviceModelEnum

{
  "domain": "string",
  "key": "string",
  "sub_type": "string",
  "type": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
domainstringfalsenoneproduct enum
keystringfalsenoneproduct enum id
sub_typestringfalsenoneproduct enum subtype
typestringfalsenoneproduct enum type