Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ jumpbox
jwts
kafkarest
Kaliningrad
kbid
Kbps
KECA
kernelspec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -7056,6 +7113,149 @@
},
"description": "The List Extension operation response"
},
"VirtualMachineSoftwarePatchProperties": {
"properties": {
"patchId": {
"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
}
},
"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
}
}
},
"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
}
},
"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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"x-ms-client-flatten": true, [](start = 12, length = 28)

does this have any effect? How does an array get flattened in SDKs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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": {
Expand Down
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": {}
}
}