diff --git a/Commands/vm/_list-usage.md b/Commands/vm/_list-usage.md new file mode 100644 index 000000000..c833cf3f7 --- /dev/null +++ b/Commands/vm/_list-usage.md @@ -0,0 +1,16 @@ +# [Command] _vm list-usage_ + +List available usage resources for VMs. + +## Versions + +### [2024-11-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.xml) **Stable** + + + +#### examples + +- Get the compute resource usage for the West US region. + ```bash + vm list-usage -l westus + ``` diff --git a/Commands/vm/_stop.md b/Commands/vm/_stop.md new file mode 100644 index 000000000..b7400cacf --- /dev/null +++ b/Commands/vm/_stop.md @@ -0,0 +1,28 @@ +# [Command] _vm stop_ + +Power off (stop) a running VM. + +The VM will continue to be billed. To avoid this, you can deallocate the VM through "az vm deallocate". + +## Versions + +### [2024-11-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.xml) **Stable** + + + +#### examples + +- Power off (stop) a running VM. + ```bash + vm stop --resource-group MyResourceGroup --name MyVm + ``` + +- Power off a running VM without shutting down. + ```bash + vm stop --resource-group MyResourceGroup --name MyVm --skip-shutdown + ``` + +- Power off VMs in a resource group. + ```bash + vm stop --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv) + ``` diff --git a/Commands/vm/readme.md b/Commands/vm/readme.md index f1e6121ed..3c016bfed 100644 --- a/Commands/vm/readme.md +++ b/Commands/vm/readme.md @@ -66,6 +66,9 @@ Manage Linux or Windows virtual machines. - [list-skus](/Commands/vm/_list-skus.md) : Get details for compute-related resource SKUs. +- [list-usage](/Commands/vm/_list-usage.md) +: List available usage resources for VMs. + - [list-vm-resize-options](/Commands/vm/_list-vm-resize-options.md) : List available resizing options for VMs. @@ -93,6 +96,9 @@ Manage Linux or Windows virtual machines. - [start](/Commands/vm/_start.md) : Start a stopped VM. +- [stop](/Commands/vm/_stop.md) +: Power off (stop) a running VM. + - [update](/Commands/vm/_update.md) : Update operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. diff --git a/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.json b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.json new file mode 100644 index 000000000..b6c13618d --- /dev/null +++ b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.json @@ -0,0 +1 @@ +{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/providers/microsoft.compute/locations/{}/usages", "version": "2024-11-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvbG9jYXRpb25zL3tsb2NhdGlvbn0vdXNhZ2Vz/V/MjAyNC0xMS0wMQ=="}], "commandGroups": [{"name": "vm", "commands": [{"name": "list-usage", "version": "2024-11-01", "resources": [{"id": "/subscriptions/{}/providers/microsoft.compute/locations/{}/usages", "version": "2024-11-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvbG9jYXRpb25zL3tsb2NhdGlvbn0vdXNhZ2Vz/V/MjAyNC0xMS0wMQ=="}], "argGroups": [{"name": "", "args": [{"type": "ResourceLocation", "var": "$Path.location", "options": ["l", "location"], "required": true, "group": "", "idPart": "name", "help": {"short": "Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`."}}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}]}], "operations": [{"operationId": "Usage_List", "http": {"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", "request": {"method": "get", "path": {"params": [{"type": "string", "name": "location", "arg": "$Path.location", "required": true, "format": {"minLength": 1}}, {"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true, "format": {"minLength": 1}}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2024-11-01"}, "type": "string", "name": "api-version", "required": true, "format": {"minLength": 1}}]}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"type": "string", "name": "nextLink"}, {"type": "array", "name": "value", "required": true, "item": {"type": "object", "props": [{"type": "integer32", "name": "currentValue", "required": true}, {"type": "integer64", "name": "limit", "required": true}, {"type": "object", "name": "name", "required": true, "props": [{"type": "string", "name": "localizedValue"}, {"type": "string", "name": "value"}]}, {"type": "string", "name": "unit", "required": true, "enum": {"items": [{"value": "Count"}]}}]}}]}}}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "outputs": [{"type": "array", "ref": "$Instance.value", "clientFlatten": true, "nextLink": "$Instance.nextLink"}], "confirmation": ""}]}]} \ No newline at end of file diff --git a/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.xml b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.xml new file mode 100644 index 000000000..19e11bff5 --- /dev/null +++ b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS91c2FnZXM=/2024-11-01.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.json b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.json new file mode 100644 index 000000000..b1680b974 --- /dev/null +++ b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.json @@ -0,0 +1 @@ +{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/poweroff", "version": "2024-11-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMve3ZtTmFtZX0vcG93ZXJPZmY=/V/MjAyNC0xMS0wMQ=="}], "commandGroups": [{"name": "vm", "commands": [{"name": "stop", "version": "2024-11-01", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/poweroff", "version": "2024-11-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMve3ZtTmFtZX0vcG93ZXJPZmY=/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."}}, {"type": "boolean", "var": "$Query.skipShutdown", "options": ["skip-shutdown"], "help": {"short": "The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified"}}]}], "operations": [{"longRunning": {"finalStateVia": "location"}, "operationId": "VirtualMachines_PowerOff", "http": {"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", "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": {"params": [{"type": "boolean", "name": "skipShutdown", "arg": "$Query.skipShutdown"}], "consts": [{"readOnly": true, "const": true, "default": {"value": "2024-11-01"}, "type": "string", "name": "api-version", "required": true, "format": {"minLength": 1}}]}}, "responses": [{"statusCode": [200]}, {"statusCode": [202], "header": {"items": [{"name": "Location"}, {"name": "Retry-After"}]}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "confirmation": ""}]}]} \ No newline at end of file diff --git a/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.xml b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.xml new file mode 100644 index 000000000..0980ec957 --- /dev/null +++ b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9wb3dlcm9mZg==/2024-11-01.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + + + + + + +
+
+
+
+