Virtual Machines - Assess Patches
評估 VM 上的修補程式。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches?api-version=2024-03-01
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
resource
|
path | True |
string |
資源群組的名稱。 |
subscription
|
path | True |
string |
可唯一識別 Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。 |
vm
|
path | True |
string |
虛擬機器的名稱。 |
api-version
|
query | True |
string |
用戶端 API 版本。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
確定 |
|
202 Accepted |
已接受 |
|
Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
Assess patch state of a virtual machine.
Sample Request
POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/assessPatches?api-version=2024-03-01
Sample Response
{
"status": "Succeeded",
"assessmentActivityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"rebootPending": true,
"criticalAndSecurityPatchCount": 1,
"otherPatchCount": 2,
"startDateTime": "2020-04-24T21:02:04.2556154Z",
"availablePatches": [
{
"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"
],
"rebootBehavior": "NeverReboots",
"activityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"publishedDate": "2018-11-07T00:00:00Z",
"lastModifiedDateTime": "2020-04-24T21:18:45.2830263Z",
"assessmentState": "Available"
},
{
"patchId": "39f9cdd1-795c-4d0e-8c0a-73ab3f31746d",
"name": "Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)",
"version": "",
"kbId": "890830",
"classifications": [
"Update Rollups"
],
"rebootBehavior": "CanRequestReboot",
"activityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"publishedDate": "2018-11-07T00:00:00Z",
"lastModifiedDateTime": "2020-04-24T21:18:45.2830263Z",
"assessmentState": "Available"
}
],
"error": null
}
Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/westus/operations/{operationId}&monitor=true&api-version=2024-03-01
定義
名稱 | Description |
---|---|
Api |
API 錯誤。 |
Api |
API 錯誤基底。 |
Cloud |
來自計算服務的錯誤回應。 |
Inner |
內部錯誤詳細數據。 |
Patch |
描述指定修補程式的可用性。 |
Patch |
作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。 |
Virtual |
描述 AssessPatches 結果的屬性。 |
Virtual |
偵測到可供安裝的修補程序清單。 |
VMGuest |
描述修補程式的重新啟動需求。 |
ApiError
API 錯誤。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼。 |
details |
API 錯誤詳細數據 |
|
innererror |
Api 內部錯誤 |
|
message |
string |
錯誤訊息。 |
target |
string |
特定錯誤的目標。 |
ApiErrorBase
API 錯誤基底。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼。 |
message |
string |
錯誤訊息。 |
target |
string |
特定錯誤的目標。 |
CloudError
來自計算服務的錯誤回應。
名稱 | 類型 | Description |
---|---|---|
error |
API 錯誤。 |
InnerError
內部錯誤詳細數據。
名稱 | 類型 | Description |
---|---|---|
errordetail |
string |
內部錯誤訊息或例外狀況傾印。 |
exceptiontype |
string |
例外狀況型別。 |
PatchAssessmentState
描述指定修補程式的可用性。
名稱 | 類型 | Description |
---|---|---|
Available |
string |
|
Unknown |
string |
PatchOperationStatus
作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。
名稱 | 類型 | Description |
---|---|---|
CompletedWithWarnings |
string |
|
Failed |
string |
|
InProgress |
string |
|
Succeeded |
string |
|
Unknown |
string |
VirtualMachineAssessPatchesResult
描述 AssessPatches 結果的屬性。
名稱 | 類型 | Description |
---|---|---|
assessmentActivityId |
string |
產生此結果之作業的活動標識碼。 它用來讓CRP和擴充功能記錄相互關聯。 |
availablePatches |
偵測到可供安裝的修補程序清單。 |
|
criticalAndSecurityPatchCount |
integer |
偵測到為可用且尚未安裝的重要或安全性修補程式數目。 |
error |
執行作業期間遇到的錯誤。 詳細數據陣列包含其清單。 |
|
otherPatchCount |
integer |
排除重大和安全性的所有可用修補程式數目。 |
rebootPending |
boolean |
VM 的整體重新啟動狀態。 當部分安裝的修補程式需要重新啟動才能完成安裝,但尚未發生重新啟動時,就會是 true。 |
startDateTime |
string |
作業開始時的 UTC 時間戳。 |
status |
作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。 |
VirtualMachineSoftwarePatchProperties
偵測到可供安裝的修補程序清單。
名稱 | 類型 | Description |
---|---|---|
activityId |
string |
產生此結果之作業的活動標識碼。 它用來讓CRP和擴充功能記錄相互關聯。 |
assessmentState |
描述指定修補程式的可用性。 |
|
classifications |
string[] |
修補程式發行者所提供的修補程序分類 () 。 |
kbId |
string |
修補程式的 KBID。 僅適用於 Windows 修補程式。 |
lastModifiedDateTime |
string |
上次更新此修補程序記錄的 UTC 時間戳。 |
name |
string |
修補程式的易記名稱。 |
patchId |
string |
修補程式的唯一標識碼。 |
publishedDate |
string |
存放庫發佈此修補程式時的 UTC 時間戳。 |
rebootBehavior |
描述修補程式的重新啟動需求。 |
|
version |
string |
修補程式的版本號碼。 此屬性僅適用於Linux修補程式。 |
VMGuestPatchRebootBehavior
描述修補程式的重新啟動需求。
名稱 | 類型 | Description |
---|---|---|
AlwaysRequiresReboot |
string |
|
CanRequestReboot |
string |
|
NeverReboots |
string |
|
Unknown |
string |