가상 디바이스 생성
- 인쇄
- PDF
가상 디바이스 생성
- 인쇄
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
개요
가상 디바이스를 생성합니다.
요청
요청 URL
POST {CLOUD_IOT_CORE_API_URL}/devices
Content-Type: application/json; charset=utf-8
x-ncp-apigw-timestamp: {Timestamp}
x-ncp-iam-access-key: {Sub Account Access Key}
x-ncp-apigw-signature-v2: {API Gateway Signature}
요청 바디
{
"device" : {
"name": "string",
"description": "string"
},
"deviceProperties":{
"createUpdateList" : [
{
"key": "string",
"value": "string"
}
]
}
}
항목 | 필수 여부 | 타입 | 제약 사항 | 설명 |
---|---|---|---|---|
device.name | Yes | string | 128자 이내의 영대소문자, 숫자, -, _만 허용 | 가상 디바이스 이름 |
device.description | Yes | string | 128자 이내만 허용 &, <, >, ", ' 문자 비허용 | 가상 디바이스 설명 |
deviceProperties.createUpdateList[].key | Yes | string | 128자 이내의 영대소문자, 숫자, -, _만 허용 | 가상 디바이스 속성 Key 동일한 Key를 찾아 정보를 수정함 기존 저장되어 있는 Key가 요청 바디에 없을 경우 삭제됨 |
deviceProperties.createUpdateList[].value | No | string | 512자 이내의 영대소문자, 숫자, -, _만 허용 | 가상 디바이스 속성 Value |
응답
응답 바디
{
"status": "string",
"body": {
"device": {
"name": "string",
"description": "string",
"modifyTime": "localDateTime",
"registerTime": "localDateTime"
},
"deviceProperties": {
"createUpdateList": [
{
"key": "string",
"value": "string",
"modifyTime": "localDateTime",
"registerTime": "localDateTime"
}
]
}
}
}
항목 | 타입 | 설명 |
---|---|---|
status | string | 응답 성공 여부 |
body.device.name | string | 가상 디바이스 이름 |
body.device.description | string | 가상 디바이스 설명 |
body.device.modifyTime | localDateTime | 가상 디바이스 수정날짜 |
body.device.registerTime | localDateTime | 가상 디바이스 생성날짜 |
body.deviceProperties.createUpdateList[].key | string | 가상 디바이스 속성 Key |
body.deviceProperties.createUpdateList[].value | string | 가상 디바이스 속성 Value |
body.deviceProperties.createUpdateList[].modifyTime | localDateTime | 가상 디바이스 속성 수정날짜 |
body.deviceProperties.createUpdateList[].registerTime | localDateTime | 가상 디바이스 속성 생성날짜 |
예시
{
"status": "SUCCESS",
"body": {
"device": {
"name": "bulb",
"description": "bulb in living room",
"modifyTime": "2020-09-25 14:15:25",
"registerTime": "2020-09-25 14:15:25"
},
"deviceProperties": {
"createUpdateList": [
{
"key": "lux",
"value": "2000",
"modifyTime": "2020-09-25 14:15:25",
"registerTime": "2020-09-25 14:15:25"
},
{
"key": "ampere",
"value": "5",
"modifyTime": "2020-09-25 14:15:25",
"registerTime": "2020-09-25 14:15:25"
}
]
}
}
}
이 문서가 도움이 되었습니까?