Devices - Replace Module Properties
替换模块属性
替换模块的所有属性值。
PUT https://{subdomain}.{baseDomain}/api/devices/{deviceId}/modules/{moduleName}/properties?api-version=2022-07-31
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
base
|
path | True |
string |
所有 Azure IoT Central 服务请求的基域。 |
|
device
|
path | True |
string |
设备的唯一 ID。 |
|
module
|
path | True |
string |
设备模块的名称。 |
|
subdomain
|
path | True |
string |
应用程序子域。 |
|
api-version
|
query | True |
string |
要调用的 API 的版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| body |
Device |
模块属性。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 202 Accepted |
Device |
成功 |
| Other Status Codes |
从 IoT Central 服务收到的错误响应。 标头 x-ms-error-code: string |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Update properties of a module
示例请求
PUT https://appsubdomain.azureiotcentral.com/api/devices/mx1/modules/module_env/properties?api-version=2022-07-31
{
"componentA": {
"SensitivityDial": 200
}
}
示例响应
{
"componentA": {
"SensitivityDial": 75,
"$metadata": {
"SensitivityDial": {
"desiredValue": 200,
"desiredVersion": 3,
"ackVersion": 1,
"ackDescription": "Ok",
"ackCode": 200,
"lastUpdateTime": "2020-04-27T22:08:55.1149957Z"
}
}
}
}
定义
| 名称 | 说明 |
|---|---|
| Error |
响应错误定义。 |
|
Error |
错误的详细信息。 |
Error
响应错误定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
当前请求的错误详细信息。 |
ErrorDetails
错误的详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
错误消息详细信息。 |
| requestId |
string |
当前请求的相关 ID。 |
| time |
string (date-time-rfc1123) |
错误请求失败的时间。 |