Virtual Machines - Install Patches

VM にパッチをインストールします。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches?api-version=2024-03-01

URI パラメーター

名前 / 必須 説明
resourceGroupName
path True

string

リソース グループの名前。

subscriptionId
path True

string

Microsoft Azure サブスクリプションを一意に識別するサブスクリプション資格情報。 サブスクリプション ID は、全ての修理依頼についてURI の一部を生じさせます。

vmName
path True

string

仮想マシンの名前。

api-version
query True

string

クライアント API のバージョン。

要求本文

名前 説明
installPatchesInput

VirtualMachineInstallPatchesParameters

API によって直接受信された InstallPatches の入力

応答

名前 説明
200 OK

VirtualMachineInstallPatchesResult

OK

202 Accepted

同意

Other Status Codes

CloudError

操作に失敗した理由を説明するエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名前 説明
user_impersonation ユーザー アカウントの借用

Install patch state of a virtual machine.

Sample Request

POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/installPatches?api-version=2024-03-01

{
  "maximumDuration": "PT4H",
  "rebootSetting": "IfRequired",
  "windowsParameters": {
    "classificationsToInclude": [
      "Critical",
      "Security"
    ],
    "maxPatchPublishDate": "2020-11-19T02:36:43.0539904+00:00"
  }
}

Sample Response

{
  "status": "Succeeded",
  "installationActivityId": "68f8b292-dfc2-4646-9781-33cc88631968",
  "rebootStatus": "Completed",
  "maintenanceWindowExceeded": false,
  "excludedPatchCount": 0,
  "notSelectedPatchCount": 0,
  "pendingPatchCount": 2,
  "installedPatchCount": 3,
  "failedPatchCount": 0,
  "startDateTime": "2020-04-24T21:02:04.2556154Z",
  "patches": [
    {
      "patchId": "35428702-5784-4ba4-a6e0-5222258b5411",
      "name": "Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)",
      "version": "",
      "kbId": "2267602",
      "classifications": [
        "Definition Updates"
      ],
      "installationState": "Installed"
    },
    {
      "patchId": "39f9cdd1-795c-4d0e-8c0a-73ab3f31746d",
      "name": "Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)",
      "version": "",
      "kbId": "890830",
      "classifications": [
        "Update Rollups"
      ],
      "installationState": "Pending"
    }
  ],
  "error": null
}
Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/westus/operations/{operationId}&monitor=true&api-version=2024-03-01

定義

名前 説明
ApiError

API エラー。

ApiErrorBase

API エラーベース。

CloudError

コンピューティング サービスからのエラー応答。

InnerError

内部エラーの詳細。

LinuxParameters

API によって直接受信される Linux VM 上の InstallPatches の入力

PatchInstallationDetail

操作中にインストールされたパッチ。

PatchInstallationState

インストール操作が完了した後のパッチの状態。

PatchOperationStatus

操作の全体的な成功または失敗の状態。 操作が完了するまで、"InProgress" のままです。 その時点で、"Failed"、"Succeeded"、"Unknown"、または "CompletedWithWarnings" になります。

VirtualMachineInstallPatchesParameters

API によって直接受信された InstallPatches の入力

VirtualMachineInstallPatchesResult

インストール操作の結果の概要。

VMGuestPatchClassification_Linux

Linux 用のパッチをインストールするときに選択する更新プログラムの分類。

VMGuestPatchClassification_Windows

Windows 用のパッチをインストールするときに選択する更新プログラムの分類。

VMGuestPatchRebootSetting

ソフトウェア更新操作中に VM を再起動できるタイミングを定義します。

VMGuestPatchRebootStatus

操作が完了した後の VM の再起動状態。

WindowsParameters

API によって直接受信された Windows VM 上の InstallPatches の入力

ApiError

API エラー。

名前 説明
code

string

エラー コード。

details

ApiErrorBase[]

Api エラーの詳細

innererror

InnerError

Api の内部エラー

message

string

エラー メッセージ。

target

string

特定のエラーのターゲット。

ApiErrorBase

API エラーベース。

名前 説明
code

string

エラー コード。

message

string

エラー メッセージ。

target

string

特定のエラーのターゲット。

CloudError

コンピューティング サービスからのエラー応答。

名前 説明
error

ApiError

API エラー。

InnerError

内部エラーの詳細。

名前 説明
errordetail

string

内部エラー メッセージまたは例外ダンプ。

exceptiontype

string

例外の種類。

LinuxParameters

API によって直接受信される Linux VM 上の InstallPatches の入力

名前 説明
classificationsToInclude

VMGuestPatchClassification_Linux[]

Linux 用のパッチをインストールするときに選択する更新プログラムの分類。

maintenanceRunId

string

これは、Linux での VM ゲストの自動修正プログラムのメンテナンス実行識別子として使用されます。

packageNameMasksToExclude

string[]

パッチ操作で除外するパッケージ。 形式: packageName_packageVersion

packageNameMasksToInclude

string[]

パッチ操作に含めるパッケージ。 形式: packageName_packageVersion

PatchInstallationDetail

操作中にインストールされたパッチ。

名前 説明
classifications

string[]

パッチ発行者によって提供されるパッチの分類。

installationState

PatchInstallationState

インストール操作が完了した後のパッチの状態。

kbId

string

パッチの KBID。 Windows パッチにのみ適用されます。

name

string

パッチのフレンドリ名。

patchId

string

パッチの一意識別子。

version

string

パッケージのバージョン文字列。 セマンティック バージョン管理に準拠している場合があります。 Linux にのみ適用されます。

PatchInstallationState

インストール操作が完了した後のパッチの状態。

名前 説明
Excluded

string

Failed

string

Installed

string

NotSelected

string

Pending

string

Unknown

string

PatchOperationStatus

操作の全体的な成功または失敗の状態。 操作が完了するまで、"InProgress" のままです。 その時点で、"Failed"、"Succeeded"、"Unknown"、または "CompletedWithWarnings" になります。

名前 説明
CompletedWithWarnings

string

Failed

string

InProgress

string

Succeeded

string

Unknown

string

VirtualMachineInstallPatchesParameters

API によって直接受信された InstallPatches の入力

名前 説明
linuxParameters

LinuxParameters

API によって直接受信される Linux VM 上の InstallPatches の入力

maximumDuration

string

操作を実行する最大時間を指定します。 PT4H (4 時間) などの ISO 8601 準拠の期間文字列である必要があります

rebootSetting

VMGuestPatchRebootSetting

ソフトウェア更新操作中に VM を再起動できるタイミングを定義します。

windowsParameters

WindowsParameters

API によって直接受信された Windows VM 上の InstallPatches の入力

VirtualMachineInstallPatchesResult

インストール操作の結果の概要。

名前 説明
error

ApiError

操作の実行中に発生したエラー。 details 配列には、それらのリストが含まれています。

excludedPatchCount

integer

ユーザーがインストールをブロックしたためにインストールされなかったパッチの数。

failedPatchCount

integer

何らかの問題が原因でインストールできなかった修正プログラムの数。 詳細については、「エラー」を参照してください。

installationActivityId

string

この結果を生成した操作のアクティビティ ID。 これは、CRP ログと拡張機能ログ間で相互に関連付けるために使用されます。

installedPatchCount

integer

正常にインストールされたパッチの数。

maintenanceWindowExceeded

boolean

操作が目的のすべてのアクションを完了するまでに時間が切れるかどうか。

notSelectedPatchCount

integer

インストール可能として検出されたが、操作の条件を満たしていないパッチの数。

patches

PatchInstallationDetail[]

操作中にインストールされたパッチ。

pendingPatchCount

integer

インストール条件を満たしていると識別されたが、インストールできなかったパッチの数。 通常、これは maintenanceWindowExceeded == true の場合に発生します。

rebootStatus

VMGuestPatchRebootStatus

操作が完了した後の VM の再起動状態。

startDateTime

string

操作が開始されたときの UTC タイムスタンプ。

status

PatchOperationStatus

操作の全体的な成功または失敗の状態。 操作が完了するまで、"InProgress" のままです。 その時点で、"Failed"、"Succeeded"、"Unknown"、または "CompletedWithWarnings" になります。

VMGuestPatchClassification_Linux

Linux 用のパッチをインストールするときに選択する更新プログラムの分類。

名前 説明
Critical

string

Other

string

Security

string

VMGuestPatchClassification_Windows

Windows 用のパッチをインストールするときに選択する更新プログラムの分類。

名前 説明
Critical

string

Definition

string

FeaturePack

string

Security

string

ServicePack

string

Tools

string

UpdateRollUp

string

Updates

string

VMGuestPatchRebootSetting

ソフトウェア更新操作中に VM を再起動できるタイミングを定義します。

名前 説明
Always

string

IfRequired

string

Never

string

VMGuestPatchRebootStatus

操作が完了した後の VM の再起動状態。

名前 説明
Completed

string

Failed

string

NotNeeded

string

Required

string

Started

string

Unknown

string

WindowsParameters

API によって直接受信された Windows VM 上の InstallPatches の入力

名前 説明
classificationsToInclude

VMGuestPatchClassification_Windows[]

Windows 用のパッチをインストールするときに選択する更新プログラムの分類。

excludeKbsRequiringReboot

boolean

これが true に設定されている場合、InstallationRebootBehavior が 'NeverReboots' ではない Kb を除外します。

kbNumbersToExclude

string[]

パッチ操作で除外する KB

kbNumbersToInclude

string[]

パッチ操作に含める KB

maxPatchPublishDate

string

これは、この最大公開日より前に公開されたパッチをインストールするために使用されます。