Device Update - Get Update
获取特定的更新版本。
GET https://{endpoint}/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}?api-version=2022-10-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (url) |
IoT 中心帐户终结点的设备更新(仅主机名,无协议)。 |
|
instance
|
path | True |
string |
IoT 中心帐户实例标识符的设备更新。 |
|
name
|
path | True |
string |
更新名称。 |
|
provider
|
path | True |
string |
更新提供程序。 |
|
version
|
path | True |
string |
更新版本。 |
|
api-version
|
query | True |
string |
要用于客户端请求的 API 的版本。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| If-None-Match |
string |
定义 If-None-Match 条件。 仅当服务器上的 ETag 与此值不匹配时,才会执行该作。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
请求的更新版本。 |
|
| Other Status Codes |
默认响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| https://api.adu.microsoft.com/.default | 默认授权范围。 |
示例
DeviceUpdate_GetUpdate
示例请求
GET https://contoso.api.adu.microsoft.com/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2022-10-01
示例响应
{
"updateId": {
"provider": "microsoft",
"name": "adu",
"version": "1.0.0.0"
},
"friendlyName": "Lab Sensor Update v1",
"description": "Fix for critical vulnerability",
"compatibility": [
{
"deviceManufacturer": "Microsoft",
"deviceModel": "Toaster"
}
],
"instructions": {
"steps": [
{
"description": "pre-install script",
"handler": "microsoft/script:1",
"handlerProperties": {
"arguments": "--pre-install"
},
"files": [
"configure.sh"
]
},
{
"type": "reference",
"updateId": {
"provider": "microsoft",
"name": "sensor",
"version": "1.0"
}
}
]
},
"manifestVersion": "5.0",
"importedDateTime": "2020-04-22T21:01:43.8408797+00:00",
"createdDateTime": "2019-09-12T00:00:00.0000000+00:00",
"etag": "\"3fed3378-0c67-47d2-b796-296962c66cbb\""
}
定义
| 名称 | 说明 |
|---|---|
| Error |
错误详细信息。 |
|
Error |
常见的错误响应。 |
|
Inner |
包含与当前对象有关错误的更具体信息的对象。 |
| Instructions | |
| Step |
更新安装说明步骤。 |
|
Step |
步骤类型。 |
| Update |
更新元数据。 |
|
Update |
更新标识符。 |
Error
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
服务器定义的错误代码。 |
| details |
Error[] |
导致报告错误的错误的数组。 |
| innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
| message |
string |
错误的人工可读表示形式。 |
| occurredDateTime |
string (date-time) |
发生错误的日期和时间(UTC)。 |
| target |
string |
错误的目标。 |
ErrorResponse
常见的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误详细信息。 |
InnerError
包含与当前对象有关错误的更具体信息的对象。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
比包含的错误提供的错误代码更具体。 |
| errorDetail |
string |
内部错误或异常消息。 |
| innerError |
包含与当前对象有关错误的更具体信息的对象。 |
|
| message |
string |
错误的人工可读表示形式。 |
Instructions
| 名称 | 类型 | 说明 |
|---|---|---|
| steps |
Step[] |
安装步骤的集合。 |
Step
更新安装说明步骤。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| description |
string minLength: 1maxLength: 64 |
步骤说明。 |
|
| files |
string[] |
在执行过程中要传递给处理程序的文件名的集合。 如果步骤类型为内联,则为必需。 |
|
| handler |
string minLength: 1maxLength: 32 |
将执行此步骤的处理程序的标识。 如果步骤类型为内联,则为必需。 |
|
| handlerProperties |
object |
在执行过程中要传递给处理程序的参数。 |
|
| type | inline |
步骤类型。 |
|
| updateId |
引用的子更新标识。 如果引用步骤类型,则为必需。 |
StepType
步骤类型。
| 值 | 说明 |
|---|---|
| inline | |
| reference |
Update
更新元数据。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| compatibility |
object[] |
更新兼容性信息列表。 |
|
| createdDateTime |
string (date-time) |
创建更新时的 UTC 日期和时间。 |
|
| description |
string minLength: 1maxLength: 512 |
更新创建者指定的说明。 |
|
| etag |
string |
更新 ETag。 |
|
| friendlyName |
string minLength: 1maxLength: 512 |
导入程序指定的友好更新名称。 |
|
| importedDateTime |
string (date-time) |
导入更新的 UTC 日期和时间。 |
|
| installedCriteria |
string |
设备更新客户端解释的字符串,用于确定是否在设备上安装更新。 在最新的导入清单架构中弃用。 |
|
| instructions |
更新安装说明。 |
||
| isDeployable |
boolean |
True |
更新是否可以自行部署到设备。 |
| manifestVersion |
string |
用于导入更新的清单的架构版本。 |
|
| referencedBy |
Update |
引用此更新的更新标识列表。 |
|
| scanResult |
string |
更新聚合扫描结果(根据有效负载文件扫描结果计算)。 |
|
| updateId |
更新标识。 |
||
| updateType |
string |
更新类型。 在最新的导入清单架构中弃用。 |
UpdateId
更新标识符。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
更新名称。 |
| provider |
string |
更新提供程序。 |
| version |
string |
更新版本。 |