History
Introduction
API Category
Making API Requests
Region APIs
Instance APIs
Cloud Hosting Cluster APIs
Image APIs
Instance Launch Template APIs
Placement Group APIs
Key APIs
Security Group APIs
Network APIs
Data Types
Error Codes
服务地址/v3/device/set_custom_attribute
参数名称 | 是否必填 | 类型 | 描述 |
cmd | 是 | Integer | 操作类型: 1:新增属性 2:更新属性 3:删除属性 4:删除所有属性 5:查询属性 |
token | 是 | String | TPNS 为设备分配的唯一 ID |
attributeInfo | 当 cmd=1,2,3时必填 | Map | 属性详情,参考下方 attributeMap 描述 |
attributeMap | 当 cmd=1,2,3时必填 | Map | 属性详情: key 为 属性名,长度限制为50字节
注意:需要已经在【控制台】>【配置管理】>【用户属性管理】中创建属性,否则会被过滤掉,并返回 invalidAttribute。 value 为属性值,长度限制为50字节 |
参数名称 | 是否必定返回 | 类型 | 描述 |
retCode | 是 | Integer | |
errMsg | 是 | String | 请求出错时的错误信息。 |
attributeInfo | cmd = 5 | Map | 属性详情。 |
invalidAttribute | 属性无效时 | Array | 无效属性详情。 |
{"cmd": 1,"token": "04cac74a714f61bf089987a986363d88****","attributeInfo": {"attributeMap": {"age": "100","name": "Ming","high": "2.66"}}}
{"retCode": 0,"errMsg": "success","invalidAttribute": ["high" // 控制台上没有对应的 key 值]}
{"cmd": 2,"token": "04cac74a714f61bf089987a986363d88****","attributeInfo": {"attributeMap": {"name": "workman"}}}
{"retCode": 0,"errMsg": "success"}
{"cmd": 3,"token": "04cac74a714f61bf089987a986363d88****","attributeInfo": {"attributeMap": {"name": "workman"}}}
{"retCode": 0,"errMsg": "success"}
{"cmd": 4,"token": "04cac74a714f61bf089987a986363d88****"}
{"retCode": 0,"errMsg": "success"}
{"cmd": 5,"token": "04cac74a714f61bf089987a986363d88****"}
{"retCode": 0,"errMsg": "success","attributeInfo": {"attributeMap": {"nickname": "workman"}}}
文档反馈