Apply Updates - Create Or Update Or Cancel
将更新应用到资源
将维护更新应用于资源
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}?api-version=2023-09-01-preview
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
apply
|
path | True |
string |
ApplyUpdate 名称 |
provider
|
path | True |
string |
资源提供程序名称 |
resource
|
path | True |
string |
资源组名称 |
resource
|
path | True |
string |
资源标识符 |
resource
|
path | True |
string |
资源类型 |
subscription
|
path | True |
string |
唯一标识Microsoft Azure 订阅的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。 |
api-version
|
query | True |
string |
要用于客户端请求的 API 的版本。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
properties.lastUpdateTime |
string (date-time) |
上次更新时间 |
properties.resourceId |
string |
resourceId |
properties.status |
状态 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
ApplyUpdate 更新请求已接受 |
|
201 Created |
ApplyUpdate 创建请求已接受 |
|
Other Status Codes |
错误请求 |
示例
Apply |
Apply |
ApplyUpdates_CreateOrUpdateOnly_NoCancellation
示例请求
示例响应
{
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
"name": "e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
"type": "Microsoft.Maintenance/applyUpdates",
"properties": {
"resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1",
"status": "Pending"
}
}
{
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
"name": "e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
"type": "Microsoft.Maintenance/applyUpdates",
"properties": {
"resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1",
"status": "Pending"
}
}
ApplyUpdates_CreateOrUpdateOrCancel
示例请求
PUT https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfig1/providers/Microsoft.Maintenance/applyUpdates/20230901121200?api-version=2023-09-01-preview
{
"properties": {
"status": "Cancel"
}
}
示例响应
{
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1/providers/microsoft.maintenance/applyupdates/20230901121200",
"name": "maintenanceConfig1",
"type": "Microsoft.Maintenance/applyUpdates",
"properties": {
"status": "Cancelled",
"resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1"
}
}
{
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1/providers/microsoft.maintenance/applyupdates/20230901121200",
"name": "maintenanceConfig1",
"type": "Microsoft.Maintenance/applyUpdates",
"properties": {
"status": "Cancelled",
"resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1"
}
}
定义
名称 | 说明 |
---|---|
Apply |
应用更新请求 |
created |
创建资源的标识的类型。 |
Error |
从 Azure 维护服务收到的错误响应详细信息。 |
Maintenance |
从 Azure 维护服务收到的错误响应。 |
system |
与创建和上次修改资源相关的元数据。 |
Update |
状态 |
ApplyUpdate
应用更新请求
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源的完全限定标识符 |
name |
string |
资源的名称 |
properties.lastUpdateTime |
string (date-time) |
上次更新时间 |
properties.resourceId |
string |
resourceId |
properties.status |
状态 |
|
systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
type |
string |
资源的类型 |
createdByType
创建资源的标识的类型。
值 | 说明 |
---|---|
Application | |
Key | |
ManagedIdentity | |
User |
ErrorDetails
从 Azure 维护服务收到的错误响应详细信息。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务定义的错误代码。 此代码充当响应中指定的 HTTP 错误代码的子状态。 |
message |
string |
错误的人工可读表示形式。 |
MaintenanceError
从 Azure 维护服务收到的错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误的详细信息 |
systemData
与创建和上次修改资源相关的元数据。
名称 | 类型 | 说明 |
---|---|---|
createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
createdBy |
string |
创建资源的标识。 |
createdByType |
创建资源的标识的类型。 |
|
lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
lastModifiedBy |
string |
上次修改资源的标识。 |
lastModifiedByType |
上次修改资源的标识的类型。 |
UpdateStatus
状态
值 | 说明 |
---|---|
Cancel |
取消计划并停止为其中一部分的资源创建 PMR。 仅适用于维护配置资源类型。 |
Cancelled |
如果请求来取消计划,则向用户发送“已取消”响应。 仅适用于维护配置资源类型。 |
Completed |
已成功应用所有更新。 |
InProgress |
更新安装正在进行中。 |
NoUpdatesPending |
没有挂起的更新。 |
Pending |
要安装挂起的更新。 |
RetryLater |
更新安装失败,稍后应重试。 |
RetryNow |
更新安装失败,但已准备好重试。 |