本帖最后由 keer_zu 于 2020-10-26 10:07 编辑
测试设备服务
device-random这个service包含Random-Boolean-Device、Random-Integer-Device、 Random-Integer-Generator01等多个设备
拿Random-Integer-Generator01为例:
获取该设备信息:
GET http://192.168.138.128:48082/api/v1/device/name/Random-Integer-Generator01
我使用postman,运行在windows,这里的IP192.168.138.128是虚拟机的ip地址。
详细内容如下:
{
"id": "09d43a05-aca0-42f2-a3e0-76360ae9d573",
"name": "Random-Integer-Generator01",
"adminState": "UNLOCKED",
"operatingState": "ENABLED",
"lastConnected": 0,
"lastReported": 0,
"labels": [
"device-random-example"
],
"location": null,
"commands": [
{
"created": 1603089038273,
"modified": 1603089038273,
"id": "fb00eb8f-faff-4b4f-a65c-0772824c8c28",
"name": "GenerateRandomValue_Int8",
"get": {
"path": "/api/v1/device/{deviceId}/GenerateRandomValue_Int8",
"responses": [
{
"code": "503",
"description": "service unavailable"
}
],
"url": "http://edgex-core-command:48082/api/v1/device/09d43a05-aca0-42f2-a3e0-76360ae9d573/command/fb00eb8f-faff-4b4f-a65c-0772824c8c28"
},
"put": {
"path": "/api/v1/device/{deviceId}/GenerateRandomValue_Int8",
"parameterNames": [
"Min_Int8",
"Max_Int8"
],
"url": "http://edgex-core-command:48082/api/v1/device/09d43a05-aca0-42f2-a3e0-76360ae9d573/command/fb00eb8f-faff-4b4f-a65c-0772824c8c28"
}
},
{
"created": 1603089038273,
"modified": 1603089038273,
"id": "790ff76e-5481-485c-a7cd-5c79bd7d216e",
"name": "GenerateRandomValue_Int16",
"get": {
"path": "/api/v1/device/{deviceId}/GenerateRandomValue_Int16",
"responses": [
{
"code": "503",
"description": "service unavailable"
}
],
"url": "http://edgex-core-command:48082/api/v1/device/09d43a05-aca0-42f2-a3e0-76360ae9d573/command/790ff76e-5481-485c-a7cd-5c79bd7d216e"
},
"put": {
"path": "/api/v1/device/{deviceId}/GenerateRandomValue_Int16",
"parameterNames": [
"Min_Int16",
"Max_Int16"
],
"url": "http://edgex-core-command:48082/api/v1/device/09d43a05-aca0-42f2-a3e0-76360ae9d573/command/790ff76e-5481-485c-a7cd-5c79bd7d216e"
}
},
{
"created": 1603089038273,
"modified": 1603089038273,
"id": "35b53068-d0fb-43d3-82d0-00b34de362a8",
"name": "GenerateRandomValue_Int32",
"get": {
"path": "/api/v1/device/{deviceId}/GenerateRandomValue_Int32",
"responses": [
{
"code": "503",
"description": "service unavailable"
}
],
"url": "http://edgex-core-command:48082/api/v1/device/09d43a05-aca0-42f2-a3e0-76360ae9d573/command/35b53068-d0fb-43d3-82d0-00b34de362a8"
},
"put": {
"path": "/api/v1/device/{deviceId}/GenerateRandomValue_Int32",
"parameterNames": [
"Min_Int32",
"Max_Int32"
],
"url": "http://edgex-core-command:48082/api/v1/device/09d43a05-aca0-42f2-a3e0-76360ae9d573/command/35b53068-d0fb-43d3-82d0-00b34de362a8"
}
}
]
}
Random-Integer-Generator01设备有 GenerateRandomValue_Int8、GenerateRandomValue_Int16、GenerateRandomValue_Int32这 3 种属性
|
@21ic小管家 干货,编辑推荐