-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add AssessPatches API #9275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AssessPatches API #9275
Changes from all commits
3e26f32
202ea39
7709079
776233c
2c67d51
61099a3
d922d8b
76dffd9
16c5cb2
95e4332
250d6a0
ccbe1d5
96042e4
dba1bc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -748,6 +748,7 @@ jumpbox | |
| jwts | ||
| kafkarest | ||
| Kaliningrad | ||
| kbid | ||
| Kbps | ||
| KECA | ||
| kernelspec | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3490,6 +3490,63 @@ | |
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches": { | ||
| "post": { | ||
| "tags": [ | ||
| "VirtualMachines" | ||
| ], | ||
| "operationId": "VirtualMachines_AssessPatches", | ||
| "x-ms-examples": { | ||
| "Assess patch state of a virtual machine.": { | ||
| "$ref": "./examples/VirtualMachineAssessPatches.json" | ||
| } | ||
| }, | ||
| "description": "Assess patches on the VM.", | ||
| "parameters": [ | ||
| { | ||
| "name": "resourceGroupName", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The name of the resource group." | ||
| }, | ||
| { | ||
| "name": "vmName", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The name of the virtual machine." | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ApiVersionParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/SubscriptionIdParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/VirtualMachineAssessPatchesResult" | ||
| } | ||
| }, | ||
| "202": { | ||
| "description": "Accepted" | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/CloudError" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-long-running-operation": true, | ||
| "x-ms-long-running-operation-options": { | ||
| "final-state-via": "location" | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}": { | ||
| "put": { | ||
| "tags": [ | ||
|
|
@@ -7056,6 +7113,149 @@ | |
| }, | ||
| "description": "The List Extension operation response" | ||
| }, | ||
| "VirtualMachineSoftwarePatchProperties": { | ||
| "properties": { | ||
| "patchId": { | ||
mirichmo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "A unique identifier for the patch." | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "The friendly name of the patch." | ||
| }, | ||
| "version": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "The version number of the patch. This property applies only to Linux patches." | ||
| }, | ||
| "kbid": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "The KBID of the patch. Only applies to Windows patches." | ||
| }, | ||
| "classifications": { | ||
| "type": "array", | ||
| "readOnly": true, | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "The classification(s) of the patch as provided by the patch publisher." | ||
| }, | ||
| "rebootBehavior": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "Describes the reboot requirements of the patch.", | ||
| "enum": [ | ||
| "NeverReboots", | ||
| "AlwaysRequiresReboot", | ||
| "CanRequestReboot" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "SoftwareUpdateRebootBehavior", | ||
| "modelAsString": true | ||
mirichmo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| }, | ||
| "activityId": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs." | ||
| }, | ||
| "publishedDate": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "format": "date-time", | ||
| "description": "The UTC timestamp when the repository published this patch." | ||
| }, | ||
| "lastModifiedDateTime": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "format": "date-time", | ||
| "description": "The UTC timestamp of the last update to this patch record." | ||
| }, | ||
| "assessmentState": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "Describes the outcome of an install operation for a given patch.", | ||
| "enum": [ | ||
| "Installed", | ||
| "Failed", | ||
| "Excluded", | ||
| "NotSelected", | ||
| "Pending", | ||
| "Available" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "PatchAssessmentState", | ||
| "modelAsString": true | ||
mirichmo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| }, | ||
| "description": "Describes the properties of a Virtual Machine software patch." | ||
| }, | ||
| "VirtualMachineAssessPatchesResult": { | ||
| "properties": { | ||
| "status": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "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.\"", | ||
| "enum": [ | ||
| "InProgress", | ||
| "Failed", | ||
| "Succeeded", | ||
| "CompletedWithWarnings" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "PatchOperationStatus", | ||
| "modelAsString": true | ||
mirichmo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| }, | ||
| "assessmentActivityId": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs." | ||
| }, | ||
| "rebootPending": { | ||
| "type": "boolean", | ||
| "readOnly": true, | ||
| "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." | ||
| }, | ||
| "criticalAndSecurityPatchCount": { | ||
| "type": "integer", | ||
| "readOnly": true, | ||
| "format": "int32", | ||
| "description": "The number of critical or security patches that have been detected as available and not yet installed." | ||
| }, | ||
| "otherPatchCount": { | ||
| "type": "integer", | ||
| "readOnly": true, | ||
| "format": "int32", | ||
| "description": "The number of all available patches excluding critical and security." | ||
| }, | ||
| "startDateTime": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "format": "date-time", | ||
| "description": "The UTC timestamp when the operation began." | ||
| }, | ||
| "patches": { | ||
| "type": "array", | ||
| "readOnly": true, | ||
| "items": { | ||
| "x-ms-client-flatten": true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
does this have any effect? How does an array get flattened in SDKs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found the documentation here. I think the answer to your question is, "yes." The results are included as I expected them to be in the SDK (A list of patch objects without additional "properties" objects or nesting inside them). I don't know if it would have been generated that way without the extension tag. |
||
| "$ref": "#/definitions/VirtualMachineSoftwarePatchProperties" | ||
| }, | ||
| "description": "The list of patches that have been detected as available for installation." | ||
| }, | ||
| "error": { | ||
| "$ref": "#/definitions/ApiError", | ||
| "readOnly": true, | ||
| "description": "The errors that were encountered during execution of the operation. The details array contains the list of them." | ||
| } | ||
| }, | ||
| "description": "Describes the properties of an AssessPatches result." | ||
| }, | ||
| "PurchasePlan": { | ||
| "properties": { | ||
| "publisher": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| { | ||
| "parameters": { | ||
| "subscriptionId": "{subscription-id}", | ||
| "resourceGroupName": "myResourceGroupName", | ||
| "vmName": "myVMName", | ||
| "api-version": "2020-06-01" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "status": "Succeeded", | ||
| "assessmentActivityId": "68f8b292-dfc2-4646-9781-33cc88631968", | ||
| "rebootPending": true, | ||
| "criticalAndSecurityPatchCount": 1, | ||
| "otherPatchCount": 2, | ||
| "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" | ||
| ], | ||
| "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 | ||
| } | ||
| }, | ||
| "202": {} | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.