Skip to content
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

NetworkCloud 2022-12-12 API - aaz test recordings added for all resources #6245

Merged
merged 11 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
39 changes: 37 additions & 2 deletions src/networkcloud/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Azure CLI Networkcloud Extension #
This is an extension to Azure CLI to manage Networkcloud resources.
This is an extension to Azure CLI to manage Azure Operator Nexus - Network Cloud on-premises clusters and their resources, such as racks, bare metal hosts, virtual machines, workload networks and more.

## How to use ##
Please add commands usage here.

Install the extension:

```
az extension add --name networkcloud
```

Validate that the extension is installed correctly:

```
az networkcloud --help
```

## Included Features ##

Below is a high-level overview of networkcloud commands.

| Commands | Description|
| ------------- | ------------- |
| az networkcloud baremetalmachine | Provides commands to manage bare metal machines. |
| az networkcloud cluster | Provides commands to manage clusters. |
| az networkcloud cluster baremetalmachinekeyset | Provides commands to manage cluster's bare metal machines access via SSH key sets. |
| az networkcloud cluster bmckeyset | Provides commands to manage cluster's baseboard management controller key set. |
| az networkcloud cluster metricsconfiguration | Provides commands to manage cluster's metrics configurations. |
| az networkcloud clustermanager | Provides commands to manage cluster managers. |
| az networkcloud defaultcninetwork | Provides commands to manage default CNI networks. |
| az networkcloud hybridakscluster | Provides commands to manage additional details of Hybrid Aks provisioned clusters. |
| az networkcloud l2network | Provides commands to manage layer 2 (L2) networks. |
| az networkcloud l3network | Provides commands to manage layer 3 (L3) networks. |
| az networkcloud rack | Provides commands to manage racks. |
| az networkcloud racksku | Provides commands to display rack Skus information. |
| az networkcloud storageappliance | Provides commands to manage storage appliances. |
| az networkcloud trunkednetwork | Provides commands to manage trunked networks. |
| az networkcloud virtualmachine | Provides commands to manage virtual machines. |

For more details, please refer to [Azure Operator Nexus - NetworkCloud](https://learn.microsoft.com/en-us/azure/operator-nexus/).
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RunDataExtract(AAZCommand):
"""Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.

:example: Run data extraction on bare metal machine
az networkcloud baremetalmachine run-data-extract --bare-metal-machine-name "bareMetalMachineName" --limit-time-seconds 60 --commands '[{"arguments":["SysInfo", "TTYLog"],"command":"hardware-support-data-collection"}]' --resource-group "resourceGroupName"
az networkcloud baremetalmachine run-data-extract --bare-metal-machine-name "bareMetalMachineName" --limit-time-seconds 360 --commands "[{arguments:['SysInfo','TTYLog'],command:'hardware-support-data-collection'}]" --resource-group "resourceGroupName"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Create(AAZCommand):
"""Create a new cloud services network or update the properties of the existing cloud services network.

:example: Create or update cloud services network
az networkcloud cloudservicesnetwork create --name "cloudServicesNetworkName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" type="CustomLocation" --location "location" --additional-egress-endpoints "[{\\"category\\":\\"azure-resource-management\\",\\"endpoints\\":[{\\"domainName\\":\\"https://storageaccountex.blob.core.windows.net\\",\\"port\\":443}]}]" --enable-default-egress-endpoints "False" --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"
az networkcloud cloudservicesnetwork create --name "cloudServicesNetworkName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" type="CustomLocation" --location "location" --additional-egress-endpoints "[{category:'azure-resource-management',endpoints:[{domainName:'https://storageaccountex.blob.core.windows.net',port:443}]}]" --enable-default-egress-endpoints "False" --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Update(AAZCommand):
"""Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently.

:example: Patch cloud services network
az networkcloud cloudservicesnetwork update --name "cloudServicesNetworkName" --additional-egress-endpoints "[{\\"category\\":\\"azure-resource-management\\",\\"endpoints\\":[{\\"domainName\\":\\"https://storageaccountex.blob.core.windows.net\\",\\"port\\":443}]}]" --enable-default-egress-endpoints "False" --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"
az networkcloud cloudservicesnetwork update --name "cloudServicesNetworkName" --additional-egress-endpoints "[{category:'azure-resource-management',endpoints:[{domainName:'https://storageaccountex.blob.core.windows.net',port:443}]}]" --enable-default-egress-endpoints "False" --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class Create(AAZCommand):
"""Create a new cluster or update the properties of the cluster if it exists.

:example: Create or update single rack cluster
az networkcloud cluster create --name "clusterName" -g "resourceGroupName" --extended-location name=""/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName" type="CustomLocation" --location "eastus" --analytics-workspace-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName" --cluster-location "Foo Street, 3rd Floor, row 9" --cluster-service-principal application-id="12345678-1234-1234-1234-123456789012" password="password" principal-id="00000008-0004-0004-0004-000000000012" tenant-id="80000000-4000-4000-4000-120000000000" --cluster-type "SingleRack" --cluster-version "3.0.0" --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --network-fabric-id "/subscriptions/fca2e8ee-1179-48b8-9532-428ed0873a2e/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default" --aggregator-or-single-rack-definition "{\"networkRackId\":\"/subscriptions/subscriptionId/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/cmName/subnets/ClusterManagerSubnet\",\"rackSkuId\":\"/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/VLab_Single_DellR750_8C2M_x70r3_9\",\"rackSerialNumber\":\"b99m99r1\",\"rackLocation\":\"b99m99r1\",\"availabilityZone\":\"1\",\"storageApplianceConfigurationData\":[{\"rackSlot\":1,\"adminCredentials\":{\"username\":\"admin\",\"password\":\"admin\"},\"storageApplianceName\":\"name\",\"serialNumber\":\"serial\"}],\"bareMetalMachineConfigurationData\":[{\"bmcCredentials\":{\"password\":\"bmcPassword\",\"username\":\"root\"},\"bmcMacAddress\":\"AA:BB:CC:DD:E7:08\",\"bootMacAddress\":\"AA:BB:CC:F8:71:2E\",\"machineName\":\"lab00r750wkr1\",\"rackSlot\":2,\"serialNumber\":\"5HS7PK3\"},{\"bmcCredentials\":{\"password\":\"bmcPassword\",\"username\":\"root\"},\"bmcMacAddress\":\"AA:BB:CC:FD:DC:76\",\"bootMacAddress\":\"AA:BB:CC:F8:50:CA\",\"machineName\":\"lab00r750wkr8\",\"rackSlot\":11,\"serialNumber\":\"9M56PK3\"}]}" --tags key1="myvalue1" key2="myvalue2"
az networkcloud cluster create --name "clusterName" -g "resourceGroupName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName" type="CustomLocation" --location "eastus" --analytics-workspace-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName" --cluster-location "Foo Street, 3rd Floor, row 9" --cluster-service-principal application-id="12345678-1234-1234-1234-123456789012" password="password" principal-id="00000008-0004-0004-0004-000000000012" tenant-id="80000000-4000-4000-4000-120000000000" --cluster-type "SingleRack" --cluster-version "3.0.0" --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --network-fabric-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default" --aggregator-or-single-rack-definition "{networkRackId:'/subscriptions/subscriptionId/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/cmName/subnets/ClusterManagerSubnet',rackSkuId:'/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/VLab_Single_DellR750_8C2M_x70r3_9',rackSerialNumber:b99m99r1,rackLocation:b99m99r1,availabilityZone:1,storageApplianceConfigurationData:[{rackSlot:1,adminCredentials:{username:'adminuser',password:'password'},storageApplianceName:name,serialNumber:serial}],bareMetalMachineConfigurationData:[{bmcCredentials:{password:'bmcPassword',username:'root'},bmcMacAddress:'AA:BB:CC:DD:E7:08',bootMacAddress:'AA:BB:CC:F8:71:2E',machineName:lab00r750wkr1,rackSlot:2,serialNumber:5HS7PK3},{bmcCredentials:{password:'bmcPassword',username:'root'},bmcMacAddress:'AA:BB:CC:FD:DC:76',bootMacAddress:'AA:BB:CC:F8:50:CA',machineName:lab00r750wkr8,rackSlot:11,serialNumber:9M56PK3}]}" --tags key1="myvalue1" key2="myvalue2"

:example: Create or update single rack cluster using json file input
az networkcloud cluster create --name "clusterName" -g "resourceGroupName" --extended-location name=""/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName" type="CustomLocation" --location "eastus" --analytics-workspace-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName" --cluster-location "Foo Street, 3rd Floor, row 9" --cluster-service-principal application-id="12345678-1234-1234-1234-123456789012" password="password" principal-id="00000008-0004-0004-0004-000000000012" tenant-id="80000000-4000-4000-4000-120000000000" --cluster-type "SingleRack" --cluster-version "3.0.0" --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --network-fabric-id "/subscriptions/fca2e8ee-1179-48b8-9532-428ed0873a2e/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default" --aggregator-or-single-rack-definition ./aggregator-or-single-rack-definition.json --tags key1="myvalue1" key2="myvalue2"
az networkcloud cluster create --name "clusterName" -g "resourceGroupName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName" type="CustomLocation" --location "eastus" --analytics-workspace-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName" --cluster-location "Foo Street, 3rd Floor, row 9" --cluster-service-principal application-id="12345678-1234-1234-1234-123456789012" password="password" principal-id="00000008-0004-0004-0004-000000000012" tenant-id="80000000-4000-4000-4000-120000000000" --cluster-type "SingleRack" --cluster-version "3.0.0" --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --network-fabric-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default" --aggregator-or-single-rack-definition ./aggregator-or-single-rack-definition.json --tags key1="myvalue1" key2="myvalue2"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Update(AAZCommand):
az networkcloud cluster update --name "clusterName" --cluster-location "Foo Street, 3rd Floor, row 9" --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"

:example: Patch cluster aggregatorOrSingleRackDefinition
az networkcloud cluster update --name "clusterName" --aggregator-or-single-rack-definition "{\"networkRackId\":\"/subscriptions/subscriptionId/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/cmName/subnets/ClusterManagerSubnet\",\"rackSkuId\":\"/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/VLab_Single_DellR750_8C2M_x70r3_9\",\"rackSerialNumber\":\"b99m99r1\",\"rackLocation\":\"b99m99r1\",\"availabilityZone\":\"1\",\"storageApplianceConfigurationData\":[{\"rackSlot\":1,\"adminCredentials\":{\"username\":\"admin\",\"password\":\"admin\"},\"storageApplianceName\":\"name\",\"serialNumber\":\"serial\"}],\"bareMetalMachineConfigurationData\":[{\"bmcCredentials\":{\"password\":\"bmcPassword\",\"username\":\"root\"},\"bmcMacAddress\":\"AA:BB:CC:DD:E7:08\",\"bootMacAddress\":\"AA:BB:CC:F8:71:2E\",\"machineName\":\"lab00r750wkr1\",\"rackSlot\":2,\"serialNumber\":\"5HS7PK3\"},{\"bmcCredentials\":{\"password\":\"bmcPassword\",\"username\":\"root\"},\"bmcMacAddress\":\"AA:BB:CC:FD:DC:76\",\"bootMacAddress\":\"AA:BB:CC:F8:50:CA\",\"machineName\":\"lab00r750wkr8\",\"rackSlot\":11,\"serialNumber\":\"9M56PK3\"}]}" --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"
az networkcloud cluster update --name "clusterName" --aggregator-or-single-rack-definition "{networkRackId:'/subscriptions/subscriptionId/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/cmName/subnets/ClusterManagerSubnet',rackSkuId:'/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/VLab_Single_DellR750_8C2M_x70r3_9',rackSerialNumber:b99m99r1,rackLocation:b99m99r1,availabilityZone:1,storageApplianceConfigurationData:[{rackSlot:1,adminCredentials:{username:'adminuser',password:'password'},storageApplianceName:name,serialNumber:serial}],bareMetalMachineConfigurationData:[{bmcCredentials:{password:'bmcPassword',username:'root'},bmcMacAddress:'AA:BB:CC:DD:E7:08',bootMacAddress:'AA:BB:CC:F8:71:2E',machineName:lab00r750wkr1,rackSlot:2,serialNumber:5HS7PK3},{bmcCredentials:{password:'bmcPassword',username:'root'},bmcMacAddress:'AA:BB:CC:FD:DC:76',bootMacAddress:'AA:BB:CC:F8:50:CA',machineName:lab00r750wkr8,rackSlot:11,serialNumber:9M56PK3}]}" --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"

:example: Patch cluster aggregatorOrSingleRackDefinition using json file input
az networkcloud cluster update --name "clusterName" --aggregator-or-single-rack-definition ./aggregator-or-single-rack-definition.json --compute-deployment-threshold type="PercentSuccess" grouping="PerCluster" value=90 --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Create(AAZCommand):
"""Create a new bare metal machine key set or update the existing one for the provided cluster.

:example: Create or update bare metal machine key set of cluster
az networkcloud cluster baremetalmachinekeyset create --name "bareMetalMachineKeySetName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" type="CustomLocation" --location "location" --azure-group-id "f110271b-XXXX-4163-9b99-214d91660f0e" --expiration "2022-12-31T23:59:59.008Z" --jump-hosts-allowed "192.0.2.1" "192.0.2.5" --os-group-name "standardAccessGroup" --privilege-level "Standard" --user-list '[{"description":"UserDesc","azureUserName":"userABC","sshPublicKey":{"keyData":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDWtG2RiEGfXs+RK19UmovAJiIVUbT6YaYc/t5SjWU=admin@vm"}}]' --tags key1="myvalue1" key2="myvalue2" --cluster-name "clusterName" --resource-group "resourceGroupName"
az networkcloud cluster baremetalmachinekeyset create --name "bareMetalMachineKeySetName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" type="CustomLocation" --location "location" --azure-group-id "f110271b-XXXX-4163-9b99-214d91660f0e" --expiration "2022-12-31T23:59:59.008Z" --jump-hosts-allowed "192.0.2.1" "192.0.2.5" --os-group-name "standardAccessGroup" --privilege-level "Standard" --user-list "[{description:'User description',azureUserName:userABC,sshPublicKey:{keyData:'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDWtG2RiEGfXs+RK19UmovAJiIVUbT6YaYc/t5SjWU=admin@vm'}}]" --tags key1="myvalue1" key2="myvalue2" --cluster-name "clusterName" --resource-group "resourceGroupName"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Update(AAZCommand):
"""Update properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.

:example: Patch bare metal machine key set of cluster
az networkcloud cluster baremetalmachinekeyset update --name "bareMetalMachineKeySetName" --expiration "2022-12-31T23:59:59.008Z" --jump-hosts-allowed "192.0.2.1" "192.0.2.5"--user-list '[{"description":"UserDesc","azureUserName":"userABC","sshPublicKey":{"keyData":"ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+/ojNZfpB3af/YDzwQCZzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"}}]' --tags key1="myvalue1" key2="myvalue2" --cluster-name "clusterName" --resource-group "resourceGroupName"
az networkcloud cluster baremetalmachinekeyset update --name "bareMetalMachineKeySetName" --expiration "2022-12-31T23:59:59.008Z" --jump-hosts-allowed "192.0.2.1" "192.0.2.5" --user-list "[{description:'User description',azureUserName:userABC,sshPublicKey:{keyData:'ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+/ojNZfpB3af/YDzwQCZzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm'}}]" --tags key1="myvalue1" key2="myvalue2" --cluster-name "clusterName" --resource-group "resourceGroupName"
"""

_aaz_info = {
Expand Down
Loading