-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Connectedmachine] Updated the module connectedmachine using API stab…
…le 2021-05-20 (#3709) * update 1. Added table format for connectedmachine list. 2. Renamed subgroups * updated the README.md * fixed code styling * fixed --n ambiguity * addressed code reviews * addressed code reviews * generated and tested the extension module * updated the README.md * upgraded the version number * added the removed function * solved linter issue * address code review * removed extra s' in _help.py * removed more s' * Apply suggestions from code review * used InvalidArgumentValueError instead * re-ran tests Co-authored-by: Xing Zhou <[email protected]>
- Loading branch information
1 parent
0d080ea
commit 090128c
Showing
49 changed files
with
7,733 additions
and
7,789 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,128 @@ | ||
# Microsoft Azure CLI 'connectedmachine' Extension | ||
|
||
This package is for the 'connectedmachine' extension, i.e. 'az connectedmachine'. | ||
|
||
## Prerequisite | ||
|
||
In order to use this extension, | ||
first follow the quick start for | ||
[Hybrid Compute](https://docs.microsoft.com/en-us/azure/azure-arc/servers/learn/quick-enable-hybrid-vm) | ||
and onboard your machine(s). | ||
|
||
## How to use | ||
# Azure CLI connectedmachine Extension # | ||
This is the extension for connectedmachine | ||
|
||
### How to use ### | ||
Install this extension using the below CLI command | ||
|
||
```sh | ||
``` | ||
az extension add --name connectedmachine | ||
``` | ||
|
||
### Included Features | ||
|
||
#### Connected Machine Management | ||
|
||
*Examples:* | ||
|
||
##### Show connected machine | ||
|
||
```sh | ||
az connectedmachine show \ | ||
--subscription subscription_id \ | ||
--resource-group my-rg \ | ||
--name my-cluster | ||
### Included Features ### | ||
#### connectedmachine #### | ||
##### List ##### | ||
``` | ||
|
||
##### List connected machines in resource group | ||
|
||
```sh | ||
az connectedmachine list --resource-group my-rg | ||
az connectedmachine list --resource-group "myResourceGroup" | ||
``` | ||
|
||
##### Delete a connected machine | ||
|
||
```sh | ||
az connectedmachine delete \ | ||
--subscription subscription_id \ | ||
--resource-group my-rg \ | ||
--name my-machine | ||
##### Show ##### | ||
``` | ||
|
||
#### Connected Machine Extension Management | ||
|
||
*Examples:* | ||
|
||
##### Create or Update a Machine Extension | ||
|
||
```sh | ||
az connectedmachine extension create \ | ||
--machine-name "myMachine" \ | ||
--name "customScriptExtension" \ | ||
--location "eastus2euap" \ | ||
--type "CustomScriptExtension" \ | ||
--publisher "Microsoft.Compute" \ | ||
--settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\"\"}" \ | ||
--type-handler-version "1.10" \ | ||
--resource-group "myResourceGroup" | ||
az connectedmachine show --name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
|
||
##### Get all Machine Extensions | ||
|
||
```sh | ||
az connectedmachine extension list \ | ||
--machine-name "myMachine" \ | ||
--resource-group "myResourceGroup" | ||
##### Delete ##### | ||
``` | ||
|
||
##### Get a Machine Extension | ||
|
||
```sh | ||
az connectedmachine extension show \ | ||
--machine-name "myMachine" \ | ||
--name "CustomScriptExtension" \ | ||
--resource-group "myResourceGroup" | ||
az connectedmachine delete --name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
|
||
##### Update a Machine Extension | ||
|
||
```sh | ||
az connectedmachine extension update \ | ||
--machine-name "myMachine" \ | ||
--name "CustomScriptExtension" \ | ||
--type "CustomScriptExtension" \ | ||
#### connectedmachine extension #### | ||
##### Create ##### | ||
``` | ||
az connectedmachine extension create --n "CustomScriptExtension" --location "eastus2euap" \ | ||
--type "CustomScriptExtension" --publisher "Microsoft.Compute" \ | ||
--settings "{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\\\\"\\"}" \ | ||
--type-handler-version "1.10" --machine-name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
##### Show ##### | ||
``` | ||
az connectedmachine extension show --n "CustomScriptExtension" --machine-name "myMachine" \ | ||
--resource-group "myResourceGroup" | ||
``` | ||
##### List ##### | ||
``` | ||
az connectedmachine extension list --machine-name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
##### Update ##### | ||
``` | ||
az connectedmachine extension update --n "CustomScriptExtension" --type "CustomScriptExtension" \ | ||
--publisher "Microsoft.Compute" \ | ||
--settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\"\"}" \ --type-handler-version "1.10" \ | ||
--resource-group "myResourceGroup" | ||
--settings "{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\\\\"\\"}" \ | ||
--type-handler-version "1.10" --machine-name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
|
||
##### Delete a Machine Extension | ||
|
||
```sh | ||
az connectedmachine extension delete \ | ||
--machine-name "myMachine" \ | ||
--name "MMA" \ | ||
--resource-group "myResourceGroup" | ||
##### Delete ##### | ||
``` | ||
az connectedmachine extension delete --n "MMA" --machine-name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
#### connectedmachine #### | ||
##### Upgrade-extension ##### | ||
``` | ||
az connectedmachine upgrade-extension \ | ||
--extension-targets "{\\"Microsoft.Azure.Monitoring\\":{\\"targetVersion\\":\\"2.0\\"},\\"Microsoft.Compute.CustomScriptExtension\\":{\\"targetVersion\\":\\"1.10\\"}}" \ | ||
--machine-name "myMachine" --resource-group "myResourceGroup" | ||
``` | ||
#### connectedmachine private-link-scope #### | ||
##### Create ##### | ||
``` | ||
az connectedmachine private-link-scope create --location "westus" --resource-group "my-resource-group" \ | ||
--scope-name "my-privatelinkscope" | ||
``` | ||
##### Update ##### | ||
``` | ||
az connectedmachine private-link-scope update --location "westus" --tags Tag1="Value1" \ | ||
--resource-group "my-resource-group" --scope-name "my-privatelinkscope" | ||
``` | ||
##### List ##### | ||
``` | ||
az connectedmachine private-link-scope list --resource-group "my-resource-group" | ||
``` | ||
##### Show ##### | ||
``` | ||
az connectedmachine private-link-scope show --resource-group "my-resource-group" --scope-name "my-privatelinkscope" | ||
``` | ||
##### Show-validation-detail ##### | ||
``` | ||
az connectedmachine private-link-scope show-validation-detail --location "wus2" \ | ||
--private-link-scope-id "f5dc51d3-92ed-4d7e-947a-775ea79b4919" | ||
``` | ||
##### Show-validation-detail-for-machine ##### | ||
``` | ||
az connectedmachine private-link-scope show-validation-detail-for-machine --machine-name "machineName" \ | ||
--resource-group "my-resource-group" | ||
``` | ||
##### Update-tag ##### | ||
``` | ||
az connectedmachine private-link-scope update-tag --tags Tag1="Value1" Tag2="Value2" \ | ||
--resource-group "my-resource-group" --scope-name "my-privatelinkscope" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az connectedmachine private-link-scope delete --resource-group "my-resource-group" --scope-name "my-privatelinkscope" | ||
``` | ||
#### connectedmachine private-link-resource #### | ||
##### List ##### | ||
``` | ||
az connectedmachine private-link-resource list --resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" | ||
``` | ||
##### Show ##### | ||
``` | ||
az connectedmachine private-link-resource show --group-name "hybridcompute" --resource-group "myResourceGroup" \ | ||
--scope-name "myPrivateLinkScope" | ||
``` | ||
#### connectedmachine private-endpoint-connection #### | ||
##### Update ##### | ||
``` | ||
az connectedmachine private-endpoint-connection update \ | ||
--private-link-service-connection-state description="Approved by [email protected]" status="Approved" \ | ||
--name "private-endpoint-connection-name" --resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" | ||
``` | ||
##### Show ##### | ||
``` | ||
az connectedmachine private-endpoint-connection show --name "private-endpoint-connection-name" \ | ||
--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" | ||
``` | ||
##### List ##### | ||
``` | ||
az connectedmachine private-endpoint-connection list --resource-group "myResourceGroup" \ | ||
--scope-name "myPrivateLinkScope" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az connectedmachine private-endpoint-connection delete --name "private-endpoint-connection-name" \ | ||
--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
# pylint: disable=unused-import | ||
from .generated._help import helps # pylint: disable=reimported | ||
try: | ||
from .manual._help import helps # pylint: disable=reimported | ||
except ImportError as e: | ||
if e.name.endswith('manual._help'): | ||
pass | ||
else: | ||
raise e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/connectedmachine/azext_connectedmachine/azext_metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.11.0" | ||
"azext.minCliCoreVersion": "2.15.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.