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
21 changes: 21 additions & 0 deletions Commands/vm/_install-patches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# [Command] _vm install-patches_

Installs patches on the VM.

## Versions

### [2024-11-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9pbnN0YWxscGF0Y2hlcw==/2024-11-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/installpatches 2024-11-01 -->

#### examples

- Install patches on a windows VM, allowing the maximum amount of time to be 4 hours, and the VM will reboot if required during the software update operation.
```bash
vm install-patches -g MyResourceGroup -n MyVm --maximum-duration PT4H --reboot-setting IfRequired --classifications-to-include-win Critical Security --exclude-kbs-requiring-reboot true
```

- Install patches on a linux VM, allowing the maximum amount of time to be 4 hours, and the VM will reboot if required during the software update operation.
```bash
vm install-patches -g MyResourceGroup -n MyVm --maximum-duration PT4H --reboot-setting IfRequired --classifications-to-include-linux Critical
```
3 changes: 3 additions & 0 deletions Commands/vm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Manage Linux or Windows virtual machines.
- [generalize](/Commands/vm/_generalize.md)
: Mark a VM as generalized, allowing it to be imaged for multiple deployments.

- [install-patches](/Commands/vm/_install-patches.md)
: Installs patches on the VM.

- [list](/Commands/vm/_list.md)
: List all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/installpatches", "version": "2024-11-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMve3ZtTmFtZX0vaW5zdGFsbFBhdGNoZXM=/V/MjAyNC0xMS0wMQ=="}], "commandGroups": [{"name": "vm", "commands": [{"name": "install-patches", "version": "2024-11-01", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/installpatches", "version": "2024-11-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMve3ZtTmFtZX0vaW5zdGFsbFBhdGNoZXM=/V/MjAyNC0xMS0wMQ=="}], "argGroups": [{"name": "", "args": [{"type": "ResourceGroupName", "var": "$Path.resourceGroupName", "options": ["g", "resource-group"], "required": true, "idPart": "resource_group"}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}, {"type": "string", "var": "$Path.vmName", "options": ["n", "name"], "required": true, "group": "", "idPart": "name", "help": {"short": "The name of the virtual machine."}}]}, {"name": "InstallPatchesInput", "args": [{"type": "object", "var": "$installPatchesInput.linuxParameters", "options": ["linux-parameters"], "group": "InstallPatchesInput", "help": {"short": "Input for InstallPatches on a Linux VM, as directly received by the API"}, "args": [{"type": "array<string>", "var": "$installPatchesInput.linuxParameters.classificationsToInclude", "options": ["classifications-to-include"], "help": {"short": "The update classifications to select when installing patches for Linux."}, "item": {"type": "string", "enum": {"items": [{"name": "Critical", "value": "Critical"}, {"name": "Other", "value": "Other"}, {"name": "Security", "value": "Security"}]}}}, {"type": "string", "var": "$installPatchesInput.linuxParameters.maintenanceRunId", "options": ["maintenance-run-id"], "group": "", "help": {"short": "This is used as a maintenance run identifier for Auto VM Guest Patching in Linux."}}, {"type": "array<string>", "var": "$installPatchesInput.linuxParameters.packageNameMasksToExclude", "options": ["package-name-masks-to-exclude"], "help": {"short": "packages to exclude in the patch operation. Format: packageName_packageVersion"}, "item": {"type": "string"}}, {"type": "array<string>", "var": "$installPatchesInput.linuxParameters.packageNameMasksToInclude", "options": ["package-name-masks-to-include"], "help": {"short": "packages to include in the patch operation. Format: packageName_packageVersion"}, "item": {"type": "string"}}]}, {"type": "duration", "var": "$installPatchesInput.maximumDuration", "options": ["maximum-duration"], "group": "InstallPatchesInput", "help": {"short": "Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours)"}}, {"type": "string", "var": "$installPatchesInput.rebootSetting", "options": ["reboot-setting"], "required": true, "group": "InstallPatchesInput", "help": {"short": "Defines when it is acceptable to reboot a VM during a software update operation."}, "enum": {"items": [{"name": "Always", "value": "Always"}, {"name": "IfRequired", "value": "IfRequired"}, {"name": "Never", "value": "Never"}]}}, {"type": "object", "var": "$installPatchesInput.windowsParameters", "options": ["windows-parameters"], "group": "InstallPatchesInput", "help": {"short": "Input for InstallPatches on a Windows VM, as directly received by the API"}, "args": [{"type": "array<string>", "var": "$installPatchesInput.windowsParameters.classificationsToInclude", "options": ["classifications-to-include"], "help": {"short": "The update classifications to select when installing patches for Windows."}, "item": {"type": "string", "enum": {"items": [{"name": "Critical", "value": "Critical"}, {"name": "Definition", "value": "Definition"}, {"name": "FeaturePack", "value": "FeaturePack"}, {"name": "Security", "value": "Security"}, {"name": "ServicePack", "value": "ServicePack"}, {"name": "Tools", "value": "Tools"}, {"name": "UpdateRollUp", "value": "UpdateRollUp"}, {"name": "Updates", "value": "Updates"}]}}}, {"type": "boolean", "var": "$installPatchesInput.windowsParameters.excludeKbsRequiringReboot", "options": ["exclude-kbs-requiring-reboot"], "help": {"short": "Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true."}}, {"type": "array<string>", "var": "$installPatchesInput.windowsParameters.kbNumbersToExclude", "options": ["kb-numbers-to-exclude"], "help": {"short": "Kbs to exclude in the patch operation"}, "item": {"type": "string"}}, {"type": "array<string>", "var": "$installPatchesInput.windowsParameters.kbNumbersToInclude", "options": ["kb-numbers-to-include"], "help": {"short": "Kbs to include in the patch operation"}, "item": {"type": "string"}}, {"type": "dateTime", "var": "$installPatchesInput.windowsParameters.maxPatchPublishDate", "options": ["max-patch-publish-date"], "help": {"short": "This is used to install patches that were published on or before this given max published date."}, "format": {"protocol": "iso"}}]}]}], "operations": [{"longRunning": {"finalStateVia": "location"}, "operationId": "VirtualMachines_InstallPatches", "http": {"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches", "request": {"method": "post", "path": {"params": [{"type": "string", "name": "resourceGroupName", "arg": "$Path.resourceGroupName", "required": true, "format": {"maxLength": 90, "minLength": 1}}, {"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true, "format": {"minLength": 1}}, {"type": "string", "name": "vmName", "arg": "$Path.vmName", "required": true}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2024-11-01"}, "type": "string", "name": "api-version", "required": true, "format": {"minLength": 1}}]}, "body": {"json": {"schema": {"type": "object", "name": "installPatchesInput", "required": true, "props": [{"type": "object", "name": "linuxParameters", "arg": "$installPatchesInput.linuxParameters", "props": [{"type": "array<string>", "name": "classificationsToInclude", "arg": "$installPatchesInput.linuxParameters.classificationsToInclude", "item": {"type": "string", "enum": {"items": [{"value": "Critical"}, {"value": "Other"}, {"value": "Security"}]}}}, {"type": "string", "name": "maintenanceRunId", "arg": "$installPatchesInput.linuxParameters.maintenanceRunId"}, {"type": "array<string>", "name": "packageNameMasksToExclude", "arg": "$installPatchesInput.linuxParameters.packageNameMasksToExclude", "item": {"type": "string"}}, {"type": "array<string>", "name": "packageNameMasksToInclude", "arg": "$installPatchesInput.linuxParameters.packageNameMasksToInclude", "item": {"type": "string"}}]}, {"type": "duration", "name": "maximumDuration", "arg": "$installPatchesInput.maximumDuration"}, {"type": "string", "name": "rebootSetting", "arg": "$installPatchesInput.rebootSetting", "required": true, "enum": {"items": [{"value": "Always"}, {"value": "IfRequired"}, {"value": "Never"}]}}, {"type": "object", "name": "windowsParameters", "arg": "$installPatchesInput.windowsParameters", "props": [{"type": "array<string>", "name": "classificationsToInclude", "arg": "$installPatchesInput.windowsParameters.classificationsToInclude", "item": {"type": "string", "enum": {"items": [{"value": "Critical"}, {"value": "Definition"}, {"value": "FeaturePack"}, {"value": "Security"}, {"value": "ServicePack"}, {"value": "Tools"}, {"value": "UpdateRollUp"}, {"value": "Updates"}]}}}, {"type": "boolean", "name": "excludeKbsRequiringReboot", "arg": "$installPatchesInput.windowsParameters.excludeKbsRequiringReboot"}, {"type": "array<string>", "name": "kbNumbersToExclude", "arg": "$installPatchesInput.windowsParameters.kbNumbersToExclude", "item": {"type": "string"}}, {"type": "array<string>", "name": "kbNumbersToInclude", "arg": "$installPatchesInput.windowsParameters.kbNumbersToInclude", "item": {"type": "string"}}, {"type": "dateTime", "name": "maxPatchPublishDate", "arg": "$installPatchesInput.windowsParameters.maxPatchPublishDate", "format": {"protocol": "iso"}}]}], "clientFlatten": true}}}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"readOnly": true, "type": "object", "name": "error", "props": [{"type": "string", "name": "code"}, {"type": "array<object>", "name": "details", "item": {"type": "object", "props": [{"type": "string", "name": "code"}, {"type": "string", "name": "message"}, {"type": "string", "name": "target"}]}, "identifiers": ["target", "message"]}, {"type": "object", "name": "innererror", "props": [{"type": "string", "name": "errordetail"}, {"type": "string", "name": "exceptiontype"}]}, {"type": "string", "name": "message"}, {"type": "string", "name": "target"}], "cls": "ApiError_read"}, {"readOnly": true, "type": "integer32", "name": "excludedPatchCount"}, {"readOnly": true, "type": "integer32", "name": "failedPatchCount"}, {"readOnly": true, "type": "string", "name": "installationActivityId"}, {"readOnly": true, "type": "integer32", "name": "installedPatchCount"}, {"readOnly": true, "type": "boolean", "name": "maintenanceWindowExceeded"}, {"readOnly": true, "type": "integer32", "name": "notSelectedPatchCount"}, {"readOnly": true, "type": "array<object>", "name": "patches", "item": {"type": "object", "props": [{"readOnly": true, "type": "array<string>", "name": "classifications", "item": {"type": "string"}}, {"readOnly": true, "type": "string", "name": "installationState", "enum": {"items": [{"value": "Excluded"}, {"value": "Failed"}, {"value": "Installed"}, {"value": "NotSelected"}, {"value": "Pending"}, {"value": "Unknown"}]}}, {"readOnly": true, "type": "string", "name": "kbId"}, {"readOnly": true, "type": "string", "name": "name"}, {"readOnly": true, "type": "string", "name": "patchId"}, {"readOnly": true, "type": "string", "name": "version"}]}, "identifiers": ["patchId"]}, {"readOnly": true, "type": "integer32", "name": "pendingPatchCount"}, {"readOnly": true, "type": "string", "name": "rebootStatus", "enum": {"items": [{"value": "Completed"}, {"value": "Failed"}, {"value": "NotNeeded"}, {"value": "Required"}, {"value": "Started"}, {"value": "Unknown"}]}}, {"readOnly": true, "type": "dateTime", "name": "startDateTime", "format": {"protocol": "iso"}}, {"readOnly": true, "type": "string", "name": "status", "enum": {"items": [{"value": "CompletedWithWarnings"}, {"value": "Failed"}, {"value": "InProgress"}, {"value": "Succeeded"}, {"value": "Unknown"}]}}]}}}}, {"statusCode": [202], "header": {"items": [{"name": "Location"}, {"name": "Retry-After"}]}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "outputs": [{"type": "object", "ref": "$Instance", "clientFlatten": true}], "confirmation": ""}]}]}
Loading