添加要管理的设备。
{
"division_id": "fd5faa1e-623a-47a9-831b-b9397c33395f",
"device_identifier": "New Device",
"device_profile_id": "a81a431a-be7b-4f2e-8afd-b2778491511f",
"fields": [
{
"id": "417c328e-604c-4e94-9112-ee58f12277fb",
"value": "mandatory value"
},
{
"id": "90eb4de2-ae8a-48a0-a904-d30c5ab6e1de",
"value": "optional value"
}
]
}
{
"id": "64c02969-3890-4da8-a5ef-b574fd72887e",
"account_id": "1d1ec1ec-6502-11e9-a923-1681be663d3e",
"division": {
"id": "fd5faa1e-623a-47a9-831b-b9397c33395f",
"name": "Mock Division 1"
},
"device_identifier": "New Device",
"device_profile": {
"id": "a81a431a-be7b-4f2e-8afd-b2778491511f",
"name": "Device Profile"
},
"created": "2020-04-22T07:13:20Z",
"updated": "2020-04-22T07:13:20Z",
"status": "ACTIVE",
"fields": [
{
"id": "417c328e-604c-4e94-9112-ee58f12277fb",
"name": "Mandatory Field",
"value": "mandatory value",
"mandatory": true
},
{
"id": "90eb4de2-ae8a-48a0-a904-d30c5ab6e1de",
"name": "Optional Field",
"value": "optional value",
"mandatory": false
}
]
}
{
"errors": [
{
"code": "invalid_input",
"message": "Device with division fd5faa1e-623a-47a9-831b-b9397c33395f and identifier New Device already exist"
}
]
}
名称 | 请求/选项 | 类型 | 描述 |
---|---|---|---|
division_id | string | 分区 ID | |
device_identifier | string | 设备标识符。不应为空,最大不超过 255。应该在分区内唯一 | |
device_profile_id | 必填 | string | 要作为设备创建模板使用的设备配置文件的 ID |
fields | array | 字段数组 | |
.. id | string | 字段 ID(对应设备配置文件字段 ID) | |
.. value | string | 字段值。必填字段由设备配置文件定义。最大 1024 个符号 |
名称 | 类型 | 描述 |
---|---|---|
id | string | 设备唯一 ID |
account_id | string | 帐号 |
division | object | 分区容器 |
.. id | string | 分区 ID |
.. name | string | 分区名称 |
device_identifier | string | 设备标识符 |
device_profile | object | 设备配置文件容器 |
.. id | string | 设备配置文件 ID |
.. name | string | 设备配置文件名称 |
created | string | 创建日期和时间 (UTC) |
updated | string | 上次更新日期和时间 (UTC) |
status | string | 状态(对于新创建的设备,始终为 ACTIVE) |
fields | array | 字段数组 |
.. id | string | 字段 ID |
.. name | string | 字段名称(来自设备配置文件) |
.. value | string | 字段值 |
.. mandatory | boolean | 是否为必填字段?(根据设备配置文件为“是”或“否”) |