设备影子

EnableUIoTCoreDeviceShadow

打开设备影子

请求参数

Parameter nameTypeDescriptionRequired
Region string 地域。 参见 地域和可用区列表 Yes
ProductSN string 产品ID Yes

响应参数

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
Timestampstring操作时间戳Yes

请求示例

https://api.ucloud.cn/?Action=EnableUIoTCoreDeviceShadow
&Region=cn-sh2
&ProductSN=ulFbNbcr
&公共请求参数

响应示例

{
    "Timestamp": "1564543200",
    "RetCode": 0,
    "Action": "EnableUIoTCoreDeviceShadowResponse"
}

DisableUIoTCoreDeviceShadow

关闭设备影子

请求参数

Parameter nameTypeDescriptionRequired
Regionstring地域。 参见 地域和可用区列表Yes
ProductSNstring产品IDYes

响应参数

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
Timestampstring操作时间戳Yes

请求示例

https://api.ucloud.cn/?Action=DisableUIoTCoreDeviceShadow
&Region=cn-sh2
&ProductSN=QCCSxGIJ
&公共请求参数

响应示例

{
    "Timestamp": "1564543200",
    "RetCode": 0,
    "Action": "DisableUIoTCoreDeviceShadowResponse"
}

GetUIoTCoreDeviceShadow

获取设备影子文档

请求参数

Parameter nameTypeDescriptionRequired
Regionstring地域。 参见 地域和可用区列表Yes
ProductSNstring产品IDYes
DeviceSNstring设备IDYes

响应参数

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
Payloadobject数据载荷Yes
Versionint设备影子版本好Yes
Timestampstring操作时间戳Yes

Payload 数据载荷

Parameter nameTypeDescriptionRequired
Stateobject设备影子State字段Yes
Metadataobject设备影子Metadata字段Yes

State 设备影子文档

Parameter nameTypeDescriptionRequired
Reportedobject设备上报的状态No
Desiredobject应用下发的状态No

Metadata 设备影子文档操作时间戳

Parameter nameTypeDescriptionRequired
Reportedobject设备上报的状态时间戳No
Desiredobject应用下发的状态时间戳No

请求示例

https://api.ucloud.cn/?Action=GetUIoTCoreDeviceShadow
&Region=cn-sh2
&ProductSN=myYJTQTR
&DeviceSN=XlNkDkHw
&公共请求参数

响应示例

{
	"Action": "GetUIoTCoreDeviceShadowResponse",
	"RetCode": 0,
	"Payload": {
		"State": {
			"Reported": {
				"light": "on"
			},
			"Desired": {
				"key": "value",
				"key_1": "value_1"
			}
		},
		"Metadata": {
			"Reported": {
				"light": {
					"Timestamp": 1564395928
				}
			},
			"Desired": {
				"key": {
					"Timestamp": 1564399417
				},
				"key_1": {
					"Timestamp": 1564557762
				}
			}
		}
	},
	"Version": 8,
	"Timestamp": 1564557762
}

UpdateUIoTCoreDeviceShadow

更新设备影子文档

请求参数

Parameter nameTypeDescriptionRequired
Regionstring地域。 参见 地域和可用区列表Yes
Desiredstringbase64编码的Json字符串Yes
ProductSNstring产品IDYes
DeviceSNstring设备IDYes
ShadowVersionstring设备影子版本Yes

响应参数

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
Payloadobject数据载荷No
Versionint设备影子文档No
Timestampstring操作时间戳No

Payload 数据载荷

Parameter nameTypeDescriptionRequired
Stateobject设备影子State字段Yes
Metadataobject设备影子Metadata字段Yes

State 设备影子文档

Parameter nameTypeDescriptionRequired
Reportedobject设备上报的状态No
Desiredobject应用下发的状态No

Metadata 设备影子文档操作时间戳

Parameter nameTypeDescriptionRequired
Reportedobject设备上报的状态时间戳No
Desiredobject应用下发的状态时间戳No

请求示例

https://api.ucloud.cn/?Action=UpdateUIoTCoreDeviceShadow
&Region=cn-sh2
&Desired=eyJrZXlfMSI6InZhbHVlXzEifQ==
&ProductSN=PFmsLErG
&DeviceSN=FDRHHEQN
&Version=5
&公共请求参数

响应示例

{
	"RetCode": 0,
	"Action": "UpdateUIoTCoreDeviceShadowResponse",
	"Payload": {
		"State": {
			"Reported": {
				"light": "on"
			},
			"Desired": {
				"key": "value",
				"key_1": "value_1"
			}
		},
		"Metadata": {
			"Reported": {
				"light": {
					"Timestamp": 1564395928
				}
			},
			"Desired": {
				"key": {
					"Timestamp": 1564399417
				},
				"key_1": {
					"Timestamp": 1564399352
				}
			}
		}
	},
	"Version": 9,
	"Timestamp": "1564543200"
}