Skip to content

Commit 817dfb0

Browse files
authored
Add AssessPatches API (#9275)
* Initial commit with updates to compute.json for assessPatches and softwarePatches * Add VirtualMachinesAssessPatches.json * Fix minor issues with softwarePatches * Updates to correct the example per oav * Remove GET and LIST softwarePatches * Remove unneeded list result * update description strings * Add kbid to spell check list. Include Prettier formating changes. * Update SoftwarePatch.InstallationState to AssessmentState * Remove extra properties from patch object array * Fix name of PublishedDate * Add generic error response * Add readonly, make rebootPending a boolean again * Remove LastModifiedDateTime from result object
1 parent b3234ae commit 817dfb0

File tree

3 files changed

+253
-0
lines changed

3 files changed

+253
-0
lines changed

custom-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ jumpbox
748748
jwts
749749
kafkarest
750750
Kaliningrad
751+
kbid
751752
Kbps
752753
KECA
753754
kernelspec

specification/compute/resource-manager/Microsoft.Compute/stable/2020-06-01/compute.json

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,6 +3555,63 @@
35553555
}
35563556
}
35573557
},
3558+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches": {
3559+
"post": {
3560+
"tags": [
3561+
"VirtualMachines"
3562+
],
3563+
"operationId": "VirtualMachines_AssessPatches",
3564+
"x-ms-examples": {
3565+
"Assess patch state of a virtual machine.": {
3566+
"$ref": "./examples/VirtualMachineAssessPatches.json"
3567+
}
3568+
},
3569+
"description": "Assess patches on the VM.",
3570+
"parameters": [
3571+
{
3572+
"name": "resourceGroupName",
3573+
"in": "path",
3574+
"required": true,
3575+
"type": "string",
3576+
"description": "The name of the resource group."
3577+
},
3578+
{
3579+
"name": "vmName",
3580+
"in": "path",
3581+
"required": true,
3582+
"type": "string",
3583+
"description": "The name of the virtual machine."
3584+
},
3585+
{
3586+
"$ref": "#/parameters/ApiVersionParameter"
3587+
},
3588+
{
3589+
"$ref": "#/parameters/SubscriptionIdParameter"
3590+
}
3591+
],
3592+
"responses": {
3593+
"200": {
3594+
"description": "OK",
3595+
"schema": {
3596+
"$ref": "#/definitions/VirtualMachineAssessPatchesResult"
3597+
}
3598+
},
3599+
"202": {
3600+
"description": "Accepted"
3601+
},
3602+
"default": {
3603+
"description": "Error response describing why the operation failed.",
3604+
"schema": {
3605+
"$ref": "#/definitions/CloudError"
3606+
}
3607+
}
3608+
},
3609+
"x-ms-long-running-operation": true,
3610+
"x-ms-long-running-operation-options": {
3611+
"final-state-via": "location"
3612+
}
3613+
}
3614+
},
35583615
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}": {
35593616
"put": {
35603617
"tags": [
@@ -7225,6 +7282,149 @@
72257282
},
72267283
"description": "The List Extension operation response"
72277284
},
7285+
"VirtualMachineSoftwarePatchProperties": {
7286+
"properties": {
7287+
"patchId": {
7288+
"type": "string",
7289+
"readOnly": true,
7290+
"description": "A unique identifier for the patch."
7291+
},
7292+
"name": {
7293+
"type": "string",
7294+
"readOnly": true,
7295+
"description": "The friendly name of the patch."
7296+
},
7297+
"version": {
7298+
"type": "string",
7299+
"readOnly": true,
7300+
"description": "The version number of the patch. This property applies only to Linux patches."
7301+
},
7302+
"kbid": {
7303+
"type": "string",
7304+
"readOnly": true,
7305+
"description": "The KBID of the patch. Only applies to Windows patches."
7306+
},
7307+
"classifications": {
7308+
"type": "array",
7309+
"readOnly": true,
7310+
"items": {
7311+
"type": "string"
7312+
},
7313+
"description": "The classification(s) of the patch as provided by the patch publisher."
7314+
},
7315+
"rebootBehavior": {
7316+
"type": "string",
7317+
"readOnly": true,
7318+
"description": "Describes the reboot requirements of the patch.",
7319+
"enum": [
7320+
"NeverReboots",
7321+
"AlwaysRequiresReboot",
7322+
"CanRequestReboot"
7323+
],
7324+
"x-ms-enum": {
7325+
"name": "SoftwareUpdateRebootBehavior",
7326+
"modelAsString": true
7327+
}
7328+
},
7329+
"activityId": {
7330+
"type": "string",
7331+
"readOnly": true,
7332+
"description": "The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs."
7333+
},
7334+
"publishedDate": {
7335+
"type": "string",
7336+
"readOnly": true,
7337+
"format": "date-time",
7338+
"description": "The UTC timestamp when the repository published this patch."
7339+
},
7340+
"lastModifiedDateTime": {
7341+
"type": "string",
7342+
"readOnly": true,
7343+
"format": "date-time",
7344+
"description": "The UTC timestamp of the last update to this patch record."
7345+
},
7346+
"assessmentState": {
7347+
"type": "string",
7348+
"readOnly": true,
7349+
"description": "Describes the outcome of an install operation for a given patch.",
7350+
"enum": [
7351+
"Installed",
7352+
"Failed",
7353+
"Excluded",
7354+
"NotSelected",
7355+
"Pending",
7356+
"Available"
7357+
],
7358+
"x-ms-enum": {
7359+
"name": "PatchAssessmentState",
7360+
"modelAsString": true
7361+
}
7362+
}
7363+
},
7364+
"description": "Describes the properties of a Virtual Machine software patch."
7365+
},
7366+
"VirtualMachineAssessPatchesResult": {
7367+
"properties": {
7368+
"status": {
7369+
"type": "string",
7370+
"readOnly": true,
7371+
"description": "The overall success or failure status of the operation. It remains \"InProgress\" until the operation completes. At that point it will become \"Failed\", \"Succeeded\", or \"CompletedWithWarnings.\"",
7372+
"enum": [
7373+
"InProgress",
7374+
"Failed",
7375+
"Succeeded",
7376+
"CompletedWithWarnings"
7377+
],
7378+
"x-ms-enum": {
7379+
"name": "PatchOperationStatus",
7380+
"modelAsString": true
7381+
}
7382+
},
7383+
"assessmentActivityId": {
7384+
"type": "string",
7385+
"readOnly": true,
7386+
"description": "The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs."
7387+
},
7388+
"rebootPending": {
7389+
"type": "boolean",
7390+
"readOnly": true,
7391+
"description": "The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred."
7392+
},
7393+
"criticalAndSecurityPatchCount": {
7394+
"type": "integer",
7395+
"readOnly": true,
7396+
"format": "int32",
7397+
"description": "The number of critical or security patches that have been detected as available and not yet installed."
7398+
},
7399+
"otherPatchCount": {
7400+
"type": "integer",
7401+
"readOnly": true,
7402+
"format": "int32",
7403+
"description": "The number of all available patches excluding critical and security."
7404+
},
7405+
"startDateTime": {
7406+
"type": "string",
7407+
"readOnly": true,
7408+
"format": "date-time",
7409+
"description": "The UTC timestamp when the operation began."
7410+
},
7411+
"patches": {
7412+
"type": "array",
7413+
"readOnly": true,
7414+
"items": {
7415+
"x-ms-client-flatten": true,
7416+
"$ref": "#/definitions/VirtualMachineSoftwarePatchProperties"
7417+
},
7418+
"description": "The list of patches that have been detected as available for installation."
7419+
},
7420+
"error": {
7421+
"$ref": "#/definitions/ApiError",
7422+
"readOnly": true,
7423+
"description": "The errors that were encountered during execution of the operation. The details array contains the list of them."
7424+
}
7425+
},
7426+
"description": "Describes the properties of an AssessPatches result."
7427+
},
72287428
"PurchasePlan": {
72297429
"properties": {
72307430
"publisher": {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroupName",
5+
"vmName": "myVMName",
6+
"api-version": "2020-06-01"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"status": "Succeeded",
12+
"assessmentActivityId": "68f8b292-dfc2-4646-9781-33cc88631968",
13+
"rebootPending": true,
14+
"criticalAndSecurityPatchCount": 1,
15+
"otherPatchCount": 2,
16+
"startDateTime": "2020-04-24T21:02:04.2556154Z",
17+
"patches": [
18+
{
19+
"patchId": "35428702-5784-4ba4-a6e0-5222258b5411",
20+
"name": "Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)",
21+
"version": "",
22+
"kbid": "2267602",
23+
"classifications": [
24+
"Definition Updates"
25+
],
26+
"rebootBehavior": "NeverReboots",
27+
"activityId": "68f8b292-dfc2-4646-9781-33cc88631968",
28+
"publishedDate": "2018-11-07T00:00:00Z",
29+
"lastModifiedDateTime": "2020-04-24T21:18:45.2830263Z",
30+
"assessmentState": "Available"
31+
},
32+
{
33+
"patchId": "39f9cdd1-795c-4d0e-8c0a-73ab3f31746d",
34+
"name": "Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)",
35+
"version": "",
36+
"kbid": "890830",
37+
"classifications": [
38+
"Update Rollups"
39+
],
40+
"rebootBehavior": "CanRequestReboot",
41+
"activityId": "68f8b292-dfc2-4646-9781-33cc88631968",
42+
"publishedDate": "2018-11-07T00:00:00Z",
43+
"lastModifiedDateTime": "2020-04-24T21:18:45.2830263Z",
44+
"assessmentState": "Available"
45+
}
46+
],
47+
"error": null
48+
}
49+
},
50+
"202": {}
51+
}
52+
}

0 commit comments

Comments
 (0)