共用方式為


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 參數

名稱 位於 必要 類型 Description
applyUpdateName
path True

string

ApplyUpdate 名稱

providerName
path True

string

資源提供者名稱

resourceGroupName
path True

string

資源組名

resourceName
path True

string

資源標識碼

resourceType
path True

string

資源類型

subscriptionId
path True

string

可唯一識別Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶標識碼會形成每個服務呼叫 URI 的一部分。

api-version
query True

string

要與用戶端要求搭配使用的 API 版本。

要求本文

名稱 類型 Description
properties.lastUpdateTime

string (date-time)

上次更新時間

properties.resourceId

string

resourceId

properties.status

UpdateStatus

狀態

回應

名稱 類型 Description
200 OK

ApplyUpdate

已接受ApplyUpdate更新要求

201 Created

ApplyUpdate

ApplyUpdate 建立要求已接受

Other Status Codes

MaintenanceError

錯誤的請求

範例

ApplyUpdates_CreateOrUpdateOnly_NoCancellation
ApplyUpdates_CreateOrUpdateOrCancel

ApplyUpdates_CreateOrUpdateOnly_NoCancellation

範例要求

PUT https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/20230901121200?api-version=2023-09-01-preview

{}

範例回覆

{
  "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"
  }
}

定義

名稱 Description
ApplyUpdate

套用更新要求

createdByType

建立資源的身分識別類型。

ErrorDetails

從 Azure 維護服務收到的錯誤回應詳細數據。

MaintenanceError

從 Azure 維護服務收到的錯誤回應。

systemData

與建立和上次修改資源相關的元數據。

UpdateStatus

狀態

ApplyUpdate

套用更新要求

名稱 類型 Description
id

string

資源的完整標識碼

name

string

資源的名稱

properties.lastUpdateTime

string (date-time)

上次更新時間

properties.resourceId

string

resourceId

properties.status

UpdateStatus

狀態

systemData

systemData

包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 元數據。

type

string

資源的類型

createdByType

建立資源的身分識別類型。

Description
Application
Key
ManagedIdentity
User

ErrorDetails

從 Azure 維護服務收到的錯誤回應詳細數據。

名稱 類型 Description
code

string

服務定義的錯誤碼。 此程式代碼可作為回應中所指定 HTTP 錯誤碼的子狀態。

message

string

人類可讀取的錯誤表示法。

MaintenanceError

從 Azure 維護服務收到的錯誤回應。

名稱 類型 Description
error

ErrorDetails

錯誤的詳細數據

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string (date-time)

資源建立的時間戳(UTC)。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string (date-time)

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。

UpdateStatus

狀態

Description
Cancel

取消排程,並停止為其一部分的資源建立 PMR。 僅適用於維護設定資源類型。

Cancelled

如果要求來取消排程,請將 Canceled 回應傳送給使用者。 僅適用於維護設定資源類型。

Completed

已成功套用所有更新。

InProgress

更新安裝正在進行中。

NoUpdatesPending

沒有任何更新擱置中。

Pending

有擱置的更新要安裝。

RetryLater

更新安裝失敗,稍後應重試。

RetryNow

更新安裝失敗,但已準備好再次重試。