Skip to content

查询设备详情 (GET)

更新时间:

该接口支持根据 ID 查询设备详情。metadata 包含设备的属性、功能、事件、标签。

请求接口

GET /api/device/instance/{id}/detail

TIP

访问权限:需要登录超级设备管理平台获取token,并校验token

请求参数

名称位置类型必选说明
idpathstring设备 ID
X-Access-Tokenheaderstring平台 token

响应参数

以200 Response为例,响应参数如下:

名称类型必选约束说明
» messagestringtruenone返回信息
» resultobjecttruenone返回结果
»» idstringfalsenoneID
»» namestringfalsenone名称
»» productPhotoUrlstringfalsenone产品图片URL
»» devicePhotoUrlstringfalsenone设备图片URL
»» protocolstringfalsenone协议ID
»» protocolNamestringfalsenone协议名称
»» transportstringfalsenone连接协议
»» productIdstringfalsenone产品ID
»» productNamestringfalsenone产品名称
»» deviceTypeobjectfalsenone设备类型
»»» textstringtruenone设备类型名称
»»» valuestringtruenone设备类型标识
»» stateintegerfalsenone状态
»»» textstringtruenone状态名称
»»» valuestringtruenone状态标识
»» addressstringfalsenone-
»» onlineTimeintegerfalsenone上线时间
»» offlineTimeintegerfalsenone离线时间
»» createTimeintegerfalsenone创建时间
»» registerTimeintegerfalsenone注册时间
»» metadatastringfalsenone物模型
»» independentMetadatabooleanfalsenone是否为独立物模型
»» configurationobjectfalsenone配置信息
»»» secureIdstringtruenoneMQTT密钥ID
»»» secureKeystringtruenoneMQTT密钥Key
»»» channelIdstringtruenone通道ID
»» classifiedIdstringfalsenone分类ID
»» classifiedNamestringfalsenone分类名称
»» creatorIdstringfalsenone创建者ID
»» createTimeintegerfalsenone创建时间
»» orgIdstringfalsenone组织ID
»» storePolicystringfalsenone数据存储策略
» statusintegertruenone响应状态码
» timestampintegertruenone时间戳

响应状态码

状态码状态码含义说明数据模型
200OK成功Inline

返回示例

以200 Response为例:

json
{
  "message": "success",
  "result": {
    "id": "one",
    "name": "one",
    "productPhotoUrl": "/images/card/product.png",
    "devicePhotoUrl": "/images/card/product.png",
    "protocol": "d79e86511a67fc42fc0683a3917de033",
    "protocolName": "内置协议",
    "transport": "MQTT",
    "productId": "testMQTT",
    "productName": "testMQTT",
    "deviceType": {
      "text": "网关设备",
      "value": "gateway"
    },
    "state": {
      "text": "离线",
      "value": "offline"
    },
    "address": "/218.17.51.10:15379",
    "onlineTime": 1690961867404,
    "offlineTime": 1690963448244,
    "createTime": 1690883503947,
    "registerTime": 1690883503968,
    "metadata": "{\"functions\":[],\"properties\":[{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"网络\",\"description\":\"网络\",\"id\":\"real_state_net\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"AI加速卡\",\"description\":\"AI加速卡\",\"id\":\"real_state_ai_accelerator_card\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"边缘运行时版本\",\"description\":\"边缘运行时版本\",\"id\":\"real_state_runtime_version\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"Docker版本\",\"description\":\"Docker版本\",\"id\":\"real_state_docker_version\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"系统版本\",\"description\":\"系统版本\",\"id\":\"real_state_system_version\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"操作系统\",\"description\":\"操作系统\",\"id\":\"real_state_system\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储使用率\",\"description\":\"存储使用率\",\"id\":\"real_state_storage_usage_rate\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储大小\",\"description\":\"存储大小\",\"id\":\"real_state_storage_capacity\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"内存使用率\",\"description\":\"内存使用率\",\"id\":\"real_state_ram_usage_rate\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"内存大小\",\"description\":\"内存大小\",\"id\":\"real_state_ram_capacity\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"CPU架构\",\"description\":\"CPU架构\",\"id\":\"real_state_cpu_architecture\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"CPU使用率\",\"description\":\"CPU使用率\",\"id\":\"real_state_cpu_usage_rate\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"CPU大小\",\"description\":\"CPU大小\",\"id\":\"real_state_cpu_capacity\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}}],\"events\":[],\"tags\":[]}",
    "independentMetadata": false,
    "configuration": {
      "secureId": "admin",
      "secureKey": "admin",
      "channelId": "a5bfaab341a7696821e1b6fa924ce7d6"
    },
    "deviceConfiguration": {},
    "cachedConfiguration": {},
    "aloneConfiguration": false,
    "connectServerId": "",
    "edge": false,
    "tags": [],
    "binds": [],
    "features": [
      {
        "id": "eventNotInsertable",
        "name": "物模型事件不可新增",
        "deprecated": false,
        "type": "SimpleFeature"
      },
      {
        "id": "eventNotModifiable",
        "name": "物模型事件不可修改",
        "deprecated": false,
        "type": "SimpleFeature"
      }
    ],
    "relations": [
      {
        "objectId": "one",
        "relation": "werewr",
        "relationName": "few"
      },
      {
        "objectId": "one",
        "relation": "oleman",
        "relationName": "老人"
      }
    ],
    "accessId": "5d54ccff16e93c7d15e92a13d5ee10ec",
    "accessProvider": "mqtt-server-gateway",
    "accessName": "开鸿超级设备接入网关",
    "classifiedId": "-20-201-20101-",
    "classifiedName": "开鸿控制器",
    "presetType": {
      "text": "非内置",
      "value": "none"
    },
    "superDeviceType": {
      "text": "普通设备",
      "value": "normalDevice"
    },
    "mediaDevice": false
  },
  "status": 200,
  "timestamp": 1690964545164
}
{
  "message": "success",
  "result": {
    "id": "one",
    "name": "one",
    "productPhotoUrl": "/images/card/product.png",
    "devicePhotoUrl": "/images/card/product.png",
    "protocol": "d79e86511a67fc42fc0683a3917de033",
    "protocolName": "内置协议",
    "transport": "MQTT",
    "productId": "testMQTT",
    "productName": "testMQTT",
    "deviceType": {
      "text": "网关设备",
      "value": "gateway"
    },
    "state": {
      "text": "离线",
      "value": "offline"
    },
    "address": "/218.17.51.10:15379",
    "onlineTime": 1690961867404,
    "offlineTime": 1690963448244,
    "createTime": 1690883503947,
    "registerTime": 1690883503968,
    "metadata": "{\"functions\":[],\"properties\":[{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"网络\",\"description\":\"网络\",\"id\":\"real_state_net\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"AI加速卡\",\"description\":\"AI加速卡\",\"id\":\"real_state_ai_accelerator_card\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"边缘运行时版本\",\"description\":\"边缘运行时版本\",\"id\":\"real_state_runtime_version\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"Docker版本\",\"description\":\"Docker版本\",\"id\":\"real_state_docker_version\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"系统版本\",\"description\":\"系统版本\",\"id\":\"real_state_system_version\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"操作系统\",\"description\":\"操作系统\",\"id\":\"real_state_system\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储使用率\",\"description\":\"存储使用率\",\"id\":\"real_state_storage_usage_rate\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储大小\",\"description\":\"存储大小\",\"id\":\"real_state_storage_capacity\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"内存使用率\",\"description\":\"内存使用率\",\"id\":\"real_state_ram_usage_rate\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"内存大小\",\"description\":\"内存大小\",\"id\":\"real_state_ram_capacity\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"CPU架构\",\"description\":\"CPU架构\",\"id\":\"real_state_cpu_architecture\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"CPU使用率\",\"description\":\"CPU使用率\",\"id\":\"real_state_cpu_usage_rate\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}},{\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"CPU大小\",\"description\":\"CPU大小\",\"id\":\"real_state_cpu_capacity\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]}}],\"events\":[],\"tags\":[]}",
    "independentMetadata": false,
    "configuration": {
      "secureId": "admin",
      "secureKey": "admin",
      "channelId": "a5bfaab341a7696821e1b6fa924ce7d6"
    },
    "deviceConfiguration": {},
    "cachedConfiguration": {},
    "aloneConfiguration": false,
    "connectServerId": "",
    "edge": false,
    "tags": [],
    "binds": [],
    "features": [
      {
        "id": "eventNotInsertable",
        "name": "物模型事件不可新增",
        "deprecated": false,
        "type": "SimpleFeature"
      },
      {
        "id": "eventNotModifiable",
        "name": "物模型事件不可修改",
        "deprecated": false,
        "type": "SimpleFeature"
      }
    ],
    "relations": [
      {
        "objectId": "one",
        "relation": "werewr",
        "relationName": "few"
      },
      {
        "objectId": "one",
        "relation": "oleman",
        "relationName": "老人"
      }
    ],
    "accessId": "5d54ccff16e93c7d15e92a13d5ee10ec",
    "accessProvider": "mqtt-server-gateway",
    "accessName": "开鸿超级设备接入网关",
    "classifiedId": "-20-201-20101-",
    "classifiedName": "开鸿控制器",
    "presetType": {
      "text": "非内置",
      "value": "none"
    },
    "superDeviceType": {
      "text": "普通设备",
      "value": "normalDevice"
    },
    "mediaDevice": false
  },
  "status": 200,
  "timestamp": 1690964545164
}

- metadata 物模型

  • 去转义格式化之后得到 json 格式的物模型数据。
json
{
	"functions": [],
	"properties": [{
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "网络",
		"description": "网络",
		"id": "real_state_net",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "AI加速卡",
		"description": "AI加速卡",
		"id": "real_state_ai_accelerator_card",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "边缘运行时版本",
		"description": "边缘运行时版本",
		"id": "real_state_runtime_version",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "Docker版本",
		"description": "Docker版本",
		"id": "real_state_docker_version",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "系统版本",
		"description": "系统版本",
		"id": "real_state_system_version",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "操作系统",
		"description": "操作系统",
		"id": "real_state_system",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "存储使用率",
		"description": "存储使用率",
		"id": "real_state_storage_usage_rate",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "存储大小",
		"description": "存储大小",
		"id": "real_state_storage_capacity",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "内存使用率",
		"description": "内存使用率",
		"id": "real_state_ram_usage_rate",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "内存大小",
		"description": "内存大小",
		"id": "real_state_ram_capacity",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "CPU架构",
		"description": "CPU架构",
		"id": "real_state_cpu_architecture",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "CPU使用率",
		"description": "CPU使用率",
		"id": "real_state_cpu_usage_rate",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "CPU大小",
		"description": "CPU大小",
		"id": "real_state_cpu_capacity",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}],
	"events": [],
	"tags": []
}
{
	"functions": [],
	"properties": [{
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "网络",
		"description": "网络",
		"id": "real_state_net",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "AI加速卡",
		"description": "AI加速卡",
		"id": "real_state_ai_accelerator_card",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "边缘运行时版本",
		"description": "边缘运行时版本",
		"id": "real_state_runtime_version",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "Docker版本",
		"description": "Docker版本",
		"id": "real_state_docker_version",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "系统版本",
		"description": "系统版本",
		"id": "real_state_system_version",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "操作系统",
		"description": "操作系统",
		"id": "real_state_system",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "存储使用率",
		"description": "存储使用率",
		"id": "real_state_storage_usage_rate",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "存储大小",
		"description": "存储大小",
		"id": "real_state_storage_capacity",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "内存使用率",
		"description": "内存使用率",
		"id": "real_state_ram_usage_rate",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "内存大小",
		"description": "内存大小",
		"id": "real_state_ram_capacity",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "CPU架构",
		"description": "CPU架构",
		"id": "real_state_cpu_architecture",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "CPU使用率",
		"description": "CPU使用率",
		"id": "real_state_cpu_usage_rate",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}, {
		"valueType": {
			"expands": {},
			"type": "string"
		},
		"name": "CPU大小",
		"description": "CPU大小",
		"id": "real_state_cpu_capacity",
		"expands": {
			"source": "device",
			"metrics": [],
			"type": ["read", "report"]
		}
	}],
	"events": [],
	"tags": []
}