diff --git a/src/networkcloud/HISTORY.rst b/src/networkcloud/HISTORY.rst index a06f74cb98b..beea575ece7 100644 --- a/src/networkcloud/HISTORY.rst +++ b/src/networkcloud/HISTORY.rst @@ -3,14 +3,20 @@ Release History =============== +1.0.0 +++++++++ +* This is the first stable version of the CLI extension that supports NetworkCloud 2023-07-01 stable APIs. +* Virtualmachine console create and update commands have been enhanced to accept a file path for ssh_public_key parameter. + 1.0.0b1 ++++++++ -* This the first beta version of the CLI extension that supports NetworkCloud 2023-07-01 stable APIs. +* This is first beta version of the CLI extension that supports NetworkCloud 2023-07-01 stable APIs. +* The defaultcninetwork and hybridakscluster resources are no longer available. 0.4.1 ++++++ * This version updates the kubernetescluster resource to not send an empty array `sshPubKeys` for control plane configuration and agent pool configuration if the input contains no ssh keys provided for these parameters. -* This version update the agentpool child resource of kubernetescluster to not send an empty array `sshPubKeys` is not provided in the input. +* This version updates the agentpool child resource of kubernetescluster to not send an empty array `sshPubKeys` is not provided in the input. 0.4.0 ++++++ diff --git a/src/networkcloud/README.md b/src/networkcloud/README.md index b8157748f4f..6bc23a6e026 100644 --- a/src/networkcloud/README.md +++ b/src/networkcloud/README.md @@ -3,7 +3,7 @@ This is an extension to Azure CLI to manage Azure Operator Nexus - Network Cloud ## How to use ## -Install the extension: +Install the latest version of the extension: ``` az extension add --name networkcloud @@ -15,6 +15,14 @@ Validate that the extension is installed correctly: az networkcloud --help ``` +For list of available versions, see [the extension release history][az-cli-networkcloud-cli-versions]. + +To install a specific version of the networkcloud CLI extension, add `--version` parameter to the command. For example, below installs 0.4.1 + +``` +az extension add --name networkcloud --version 0.4.1 +``` + ## Included Features ## Below is a high-level overview of networkcloud commands. @@ -41,4 +49,10 @@ Below is a high-level overview of networkcloud commands. | az networkcloud virtualmachine console | Provides commands to manage virtual machine's consoles. | | az networkcloud volume | Provides commands to manage volumes. | -For more details, please refer to [Azure Operator Nexus - NetworkCloud](https://learn.microsoft.com/en-us/azure/operator-nexus/). +For more details, please refer to [Azure Operator Nexus - NetworkCloud][networkcloud-microsoft-learn]. + + + +[networkcloud-microsoft-learn]: https://learn.microsoft.com/en-us/azure/operator-nexus/ + +[az-cli-networkcloud-cli-versions]: https://github.com/Azure/azure-cli-extensions/blob/main/src/networkcloud/HISTORY.rst diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/__cmd_group.py index c69b33346b3..bb02392a95f 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage Network Cloud resources diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/__cmd_group.py index ffff627c4e0..345bf41458d 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud baremetalmachine", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage bare metal machine diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_cordon.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_cordon.py index 61869d55e6a..7e1abd15302 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_cordon.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_cordon.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine cordon", - is_preview=True, ) class Cordon(AAZCommand): """Cordon the provided bare metal machine's Kubernetes node. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_list.py index f25ce40e41b..cdd4a6f26d9 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine list", - is_preview=True, ) class List(AAZCommand): """List bare metal machines in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_power_off.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_power_off.py index 6750e349471..c0dfdc0cc20 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_power_off.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_power_off.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine power-off", - is_preview=True, ) class PowerOff(AAZCommand): """Power off the provided bare metal machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_reimage.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_reimage.py index 093eed473a0..e398d6593af 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_reimage.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_reimage.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine reimage", - is_preview=True, ) class Reimage(AAZCommand): """Reimage the provided bare metal machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_replace.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_replace.py index 0bea539a05f..f7876fe299f 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_replace.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_replace.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine replace", - is_preview=True, ) class Replace(AAZCommand): """Replace the provided bare metal machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_restart.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_restart.py index f86155a44e0..2588b0cad1c 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_restart.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_restart.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine restart", - is_preview=True, ) class Restart(AAZCommand): """Restart the provided bare metal machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_command.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_command.py index 860f173297c..c9914209f37 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_command.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_command.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine run-command", - is_preview=True, ) class RunCommand(AAZCommand): """Run the command or the script 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. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_data_extract.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_data_extract.py index 009c82bc6e7..b59e984cc1b 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_data_extract.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_data_extract.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine run-data-extract", - is_preview=True, ) 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. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_read_command.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_read_command.py index 1c33532a4b4..ace9c98a113 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_read_command.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_run_read_command.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine run-read-command", - is_preview=True, ) class RunReadCommand(AAZCommand): """Run one or more read-only commands 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. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_show.py index 47bfba53928..530995fd34a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided bare metal machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_start.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_start.py index e2be59a748a..00172cddd7e 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_start.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_start.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine start", - is_preview=True, ) class Start(AAZCommand): """Start the provided bare metal machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_uncordon.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_uncordon.py index 8d77f91aac4..807060ebcdf 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_uncordon.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_uncordon.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine uncordon", - is_preview=True, ) class Uncordon(AAZCommand): """Uncordon the provided bare metal machine's Kubernetes node. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_update.py index 9292813d303..ed1fcdf5e67 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud baremetalmachine update", - is_preview=True, ) class Update(AAZCommand): """Update properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/__cmd_group.py index 41068d6b84b..f6b65a83501 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud cloudservicesnetwork", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage cloud services network diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_create.py index 94641593aed..cdaabf92905 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cloudservicesnetwork create", - is_preview=True, ) class Create(AAZCommand): """Create a new cloud services network or update the properties of the existing cloud services network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_delete.py index 4e0ddbceaf1..e5b99be42e2 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cloudservicesnetwork delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_list.py index b360a070b47..b67b53af259 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cloudservicesnetwork list", - is_preview=True, ) class List(AAZCommand): """List cloud services networks in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_show.py index 0f29ea430ed..e512db7c36b 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cloudservicesnetwork show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided cloud services network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_update.py index eabfad674c5..33d9a2a2ae8 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cloudservicesnetwork update", - is_preview=True, ) 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. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/__cmd_group.py index 4d29db64666..dbe95429540 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud cluster", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage cluster diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_create.py index d9b9156be8a..92c12c4790b 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster create", - is_preview=True, ) class Create(AAZCommand): """Create a new cluster or update the properties of the cluster if it exists. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_delete.py index 49b950436f7..44b2e0920dc 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_deploy.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_deploy.py index b18a36b7032..538b5f7ce5b 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_deploy.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_deploy.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster deploy", - is_preview=True, ) class Deploy(AAZCommand): """Deploy the cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_list.py index e9f9fa5f15c..d26aae6defe 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster list", - is_preview=True, ) class List(AAZCommand): """List clusters in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_show.py index 6d97635a6fc..99f220bab95 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update.py index 375f4b7f7e7..ff91d10bbd3 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster update", - is_preview=True, ) class Update(AAZCommand): """Update the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update_version.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update_version.py index d9779bf4cbc..b2ceb55326b 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update_version.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/_update_version.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster update-version", - is_preview=True, ) class UpdateVersion(AAZCommand): """Update the version of the provided cluster to one of the available supported versions. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/__cmd_group.py index acd7b58cb6f..27d60b5c513 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud cluster baremetalmachinekeyset", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage cluster's bare metal machine key set diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_create.py index ee7dd6fe096..c64473da4ba 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster baremetalmachinekeyset create", - is_preview=True, ) class Create(AAZCommand): """Create a new bare metal machine key set or update the existing one for the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_delete.py index 9f31770b4e9..807455d57b7 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster baremetalmachinekeyset delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_list.py index bb282badeea..16b57103e91 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster baremetalmachinekeyset list", - is_preview=True, ) class List(AAZCommand): """List bare metal machine key sets of the cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_show.py index f01dac68eb4..2b110b0e506 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster baremetalmachinekeyset show", - is_preview=True, ) class Show(AAZCommand): """Get bare metal machine key set of the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_update.py index 1d8451d3afe..b6f78353e3f 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/baremetalmachinekeyset/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster baremetalmachinekeyset update", - is_preview=True, ) 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. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/__cmd_group.py index e095a838555..91c60a69112 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud cluster bmckeyset", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage cluster's baseboard management controller key set diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_create.py index 1fc8e212f0c..f6761d36883 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster bmckeyset create", - is_preview=True, ) class Create(AAZCommand): """Create a new baseboard management controller key set or update the existing one for the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_delete.py index 52f3b51039d..87b8d75888c 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster bmckeyset delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_list.py index 9a82af5e8cc..98f81f2d162 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster bmckeyset list", - is_preview=True, ) class List(AAZCommand): """List baseboard management controller key sets of the cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_show.py index 215e836a242..1753a96e6ff 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster bmckeyset show", - is_preview=True, ) class Show(AAZCommand): """Get baseboard management controller key set of the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_update.py index c219d5ae647..15f391feb0e 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/bmckeyset/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster bmckeyset update", - is_preview=True, ) class Update(AAZCommand): """Update properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/__cmd_group.py index b66597d2948..6d2d2f73d2a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud cluster metricsconfiguration", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage cluster's metrics configuration diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_create.py index 0802b2fa481..552cb6c12e0 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster metricsconfiguration create", - is_preview=True, ) class Create(AAZCommand): """Create the metrics configuration of the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_delete.py index dc618c5d236..571d8251f68 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster metricsconfiguration delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_list.py index df61123e376..32a15521675 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster metricsconfiguration list", - is_preview=True, ) class List(AAZCommand): """List metrics configurations of the cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_show.py index 709dd65d1f0..3bab6ab4134 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster metricsconfiguration show", - is_preview=True, ) class Show(AAZCommand): """Get metrics configuration of the provided cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_update.py index cd436a893ea..5ec2634a6c5 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cluster/metricsconfiguration/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud cluster metricsconfiguration update", - is_preview=True, ) class Update(AAZCommand): """Update properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/__cmd_group.py index cd5920cc480..0d5a5b61a59 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud clustermanager", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage cluster manager diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_create.py index 163743f5f2f..b7df113ebfe 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud clustermanager create", - is_preview=True, ) class Create(AAZCommand): """Create a new cluster manager or update properties of the cluster manager if it exists. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_delete.py index 4e2eb5458a2..b2d2727b60d 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud clustermanager delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_list.py index 3de3014e6ba..8742589c7c0 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud clustermanager list", - is_preview=True, ) class List(AAZCommand): """List cluster managers in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_show.py index 0a2cbe01827..47975d4d032 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud clustermanager show", - is_preview=True, ) class Show(AAZCommand): """Get the properties of the provided cluster manager. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_update.py index ffb334a3e71..c2e90889a15 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/clustermanager/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud clustermanager update", - is_preview=True, ) class Update(AAZCommand): """Update properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/__cmd_group.py index 139978e3646..db8908c2152 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud kubernetescluster", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage Kubernetes cluster diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_create.py index 053258c96c7..7c7c716fae3 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster create", - is_preview=True, ) class Create(AAZCommand): """Create a new Kubernetes cluster or update the properties of the existing one. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_delete.py index 5f3905be3e3..320967e3486 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_list.py index f32d778e374..86fcf44688d 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster list", - is_preview=True, ) class List(AAZCommand): """List Kubernetes clusters in the provided subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_restart_node.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_restart_node.py index f58e5333197..d0fbc556d63 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_restart_node.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_restart_node.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster restart-node", - is_preview=True, ) class RestartNode(AAZCommand): """Restart a targeted node of a Kubernetes cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_show.py index d4a24c02352..2fb22176c64 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided the Kubernetes cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_update.py index fe971d015c6..cbf4b28c5ff 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster update", - is_preview=True, ) class Update(AAZCommand): """Update the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/__cmd_group.py index bf8264ec268..f15e946d411 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud kubernetescluster agentpool", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage Kubernetes cluster's agent pool diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_create.py index 2498de10ccc..898ddf9a1c7 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster agentpool create", - is_preview=True, ) class Create(AAZCommand): """Create a new Kubernetes cluster agent pool or update the properties of the existing one. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_delete.py index 10e7ae6aa3b..8fbd0a168bb 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster agentpool delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_list.py index cbd4cef4cc0..8e1ccb03748 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster agentpool list", - is_preview=True, ) class List(AAZCommand): """List agent pools for the provided Kubernetes cluster. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_show.py index 540de309090..9e04709716f 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster agentpool show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided Kubernetes cluster agent pool. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_update.py index 46f743626b0..dd5d6f017c1 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/kubernetescluster/agentpool/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud kubernetescluster agentpool update", - is_preview=True, ) class Update(AAZCommand): """Update the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/__cmd_group.py index 4b0cdd2fa24..90af1fd61fe 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud l2network", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage layer 2 (l2) network diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_create.py index 89bec09c156..102d94d46f3 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l2network create", - is_preview=True, ) class Create(AAZCommand): """Create a new layer 2 (L2) network or update the properties of the existing network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_delete.py index 7cd021c28ec..bd8e410621d 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l2network delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_list.py index a8ce59b9e4d..c27e730f36a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l2network list", - is_preview=True, ) class List(AAZCommand): """List layer 2 (L2) networks in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_show.py index 80ebb74f07d..4a96dbd9b00 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l2network show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided layer 2 (L2) network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_update.py index dbbe20547f2..6502af0b794 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l2network/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l2network update", - is_preview=True, ) class Update(AAZCommand): """Update tags associated with the provided layer 2 (L2) network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/__cmd_group.py index 1fa0b7f1139..b930bd205a1 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud l3network", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage layer 3 (l3) network diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_create.py index 20fc00ac144..73c9220e977 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l3network create", - is_preview=True, ) class Create(AAZCommand): """Create a new layer 3 (L3) network or update the properties of the existing network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_delete.py index a4e962f13ac..632cb7f8219 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l3network delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_list.py index b90978eadca..c3ad2a288ea 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l3network list", - is_preview=True, ) class List(AAZCommand): """List layer 3 (L3) networks in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_show.py index 7b49c98c65c..0e9418f7241 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l3network show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided layer 3 (L3) network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_update.py index 6a3ef44a3eb..a28475717fe 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/l3network/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud l3network update", - is_preview=True, ) class Update(AAZCommand): """Update tags associated with the provided layer 3 (L3) network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/__cmd_group.py index 86fd5f95cad..8ed94e3bfa1 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud rack", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage rack diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_list.py index 401b5ecb087..8d867ce7890 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud rack list", - is_preview=True, ) class List(AAZCommand): """List racks in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_show.py index c18a8224551..7327a029760 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud rack show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided rack. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_update.py index 7d178414df5..bc4a50a8086 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/rack/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud rack update", - is_preview=True, ) class Update(AAZCommand): """Update properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/__cmd_group.py index 7d838cb300a..92c74c20e84 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud racksku", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage rack SKU diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_list.py index 6043f5dea85..0c5120974d2 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud racksku list", - is_preview=True, ) class List(AAZCommand): """List rack SKUs in the provided subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_show.py index 7a2f5262c7b..c6c50bb9f65 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/racksku/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud racksku show", - is_preview=True, ) class Show(AAZCommand): """Get the properties of the provided rack SKU. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/__cmd_group.py index 7c44db5105e..5516df7fe15 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud storageappliance", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage storage appliance diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_disable_remote_vendor_management.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_disable_remote_vendor_management.py index d92fa6738fe..98399d5aa13 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_disable_remote_vendor_management.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_disable_remote_vendor_management.py @@ -13,7 +13,6 @@ @register_command( "networkcloud storageappliance disable-remote-vendor-management", - is_preview=True, ) class DisableRemoteVendorManagement(AAZCommand): """Disable remote vendor management of the provided storage appliance. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_enable_remote_vendor_management.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_enable_remote_vendor_management.py index a3916727476..5582f6e4086 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_enable_remote_vendor_management.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_enable_remote_vendor_management.py @@ -13,7 +13,6 @@ @register_command( "networkcloud storageappliance enable-remote-vendor-management", - is_preview=True, ) class EnableRemoteVendorManagement(AAZCommand): """Enable remote vendor management of the provided storage appliance. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_list.py index 92bafc3f88d..b3a6cb5138b 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud storageappliance list", - is_preview=True, ) class List(AAZCommand): """List storage appliances in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_show.py index 5ebbf969dc4..b0c1dc49bbd 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud storageappliance show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided storage appliance. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_update.py index 7e515f0a8f1..1c82f8ba77c 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/storageappliance/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud storageappliance update", - is_preview=True, ) class Update(AAZCommand): """Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/__cmd_group.py index d4a4a8f218d..0e01f695b53 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud trunkednetwork", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage trunked network diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_create.py index 4337662cc4d..7bc26061612 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud trunkednetwork create", - is_preview=True, ) class Create(AAZCommand): """Create a new trunked network or update the properties of the existing trunked network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_delete.py index 38710746db0..a75675c350a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud trunkednetwork delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_list.py index b3a07eb7ac8..fc2a554535e 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud trunkednetwork list", - is_preview=True, ) class List(AAZCommand): """List trunked networks in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_show.py index 692ed539026..0432ee89bc9 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud trunkednetwork show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided trunked network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_update.py index 6bc405a0170..04291de0609 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/trunkednetwork/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud trunkednetwork update", - is_preview=True, ) class Update(AAZCommand): """Update tags associated with the provided trunked network. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/__cmd_group.py index 0b8810459f9..25f3c88ddf5 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud virtualmachine", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage virtual machine diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_create.py index e0c9c4f787f..5279f23500a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine create", - is_preview=True, ) class Create(AAZCommand): """Create a new virtual machine or update the properties of the existing virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_delete.py index c8707cd39c9..4693982546c 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_list.py index ac508ba16f7..8364da42cb1 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine list", - is_preview=True, ) class List(AAZCommand): """List virtual machines in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_power_off.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_power_off.py index 27271876295..72bf0079148 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_power_off.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_power_off.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine power-off", - is_preview=True, ) class PowerOff(AAZCommand): """Power off the provided virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_reimage.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_reimage.py index 5df4c730263..3cdb3524680 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_reimage.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_reimage.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine reimage", - is_preview=True, ) class Reimage(AAZCommand): """Reimage the provided virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_restart.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_restart.py index 0ca560f923b..7d6997d2eb6 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_restart.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_restart.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine restart", - is_preview=True, ) class Restart(AAZCommand): """Restart the provided virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_show.py index 0e0ce5f0ae9..878ee39ba4a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_start.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_start.py index b2dca88494d..e3c0e3fa384 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_start.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_start.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine start", - is_preview=True, ) class Start(AAZCommand): """Start the provided virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_update.py index 3fad820505d..59d3f170591 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine update", - is_preview=True, ) class Update(AAZCommand): """Update the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/__cmd_group.py index c5daf93db0e..6ba3f47acf9 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud virtualmachine console", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage virtual machine's console diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_create.py index 6e9fe11d5c1..bd87aa4cacd 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine console create", - is_preview=True, ) class Create(AAZCommand): """Create a new virtual machine console or update the properties of the existing virtual machine console. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_delete.py index 31ffc997609..b7ee4157906 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine console delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_list.py index 6c8d1028d26..3b1014ac31c 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine console list", - is_preview=True, ) class List(AAZCommand): """List consoles of the virtual machine. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_show.py index 48fcbf517ed..347b29d3119 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine console show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided virtual machine console. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_update.py index 7045de34d57..119e99b332e 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/virtualmachine/console/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud virtualmachine console update", - is_preview=True, ) class Update(AAZCommand): """Update the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag updates can be done independently. @@ -89,7 +88,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema.enabled = AAZStrArg( options=["--enabled"], arg_group="Properties", - help="The credentials used to login to the image repository that has access to the specified image.", + help="The indicator of whether the console access is enabled.", enum={"False": "False", "True": "True"}, ) _args_schema.expiration = AAZDateTimeArg( diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/__cmd_group.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/__cmd_group.py index 7278f0050a2..99e146cb4dd 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/__cmd_group.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/__cmd_group.py @@ -13,7 +13,6 @@ @register_command_group( "networkcloud volume", - is_preview=True, ) class __CMDGroup(AAZCommandGroup): """Manage volume diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_create.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_create.py index ae12313aeeb..e1789716cc4 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_create.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_create.py @@ -13,7 +13,6 @@ @register_command( "networkcloud volume create", - is_preview=True, ) class Create(AAZCommand): """Create a new volume or update the properties of the existing one. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_delete.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_delete.py index cd549d89379..4e949c7224a 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_delete.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_delete.py @@ -13,7 +13,6 @@ @register_command( "networkcloud volume delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_list.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_list.py index ab4f1d550cd..d81e97a2866 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_list.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_list.py @@ -13,7 +13,6 @@ @register_command( "networkcloud volume list", - is_preview=True, ) class List(AAZCommand): """List volumes in the provided resource group or subscription. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_show.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_show.py index 153e859d7c0..f46997f1aef 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_show.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_show.py @@ -13,7 +13,6 @@ @register_command( "networkcloud volume show", - is_preview=True, ) class Show(AAZCommand): """Get properties of the provided volume. diff --git a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_update.py b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_update.py index d56184e6e18..a04ce5c010c 100644 --- a/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_update.py +++ b/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/volume/_update.py @@ -13,7 +13,6 @@ @register_command( "networkcloud volume update", - is_preview=True, ) class Update(AAZCommand): """Update tags associated with the provided volume. diff --git a/src/networkcloud/azext_networkcloud/azext_metadata.json b/src/networkcloud/azext_networkcloud/azext_metadata.json index 7923ce3c67b..f6f49495c1b 100644 --- a/src/networkcloud/azext_networkcloud/azext_metadata.json +++ b/src/networkcloud/azext_networkcloud/azext_metadata.json @@ -1,4 +1,3 @@ { - "azext.isPreview": true, "azext.minCliCoreVersion": "2.49.0" } \ No newline at end of file diff --git a/src/networkcloud/azext_networkcloud/operations/custom_arguments.py b/src/networkcloud/azext_networkcloud/operations/custom_arguments.py new file mode 100644 index 00000000000..61c6a57392b --- /dev/null +++ b/src/networkcloud/azext_networkcloud/operations/custom_arguments.py @@ -0,0 +1,72 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Custom code that is added in addition to auto-generated by aaz-dev code. +# -------------------------------------------------------------------------------------------- +# pylint: disable=too-many-lines,no-member,inconsistent-return-statements +# pylint: disable=too-many-statements,too-few-public-methods + +""" +Custom argument format +""" +import abc +import os + +from azure.cli.core import keys +from azure.cli.core.aaz._arg_fmt import AAZBaseArgFormat +from azure.cli.core.aaz.exceptions import AAZInvalidArgValueError +from azure.cli.core.azclierror import InvalidArgumentValueError +from knack.log import get_logger + +logger = get_logger(__name__) + + +# Custom Argument to support both SSH file path and SSH key +class AAZFileStringArgFormat(AAZBaseArgFormat): + def __call__(self, ctx, value): + data = value._data + + if data is None or not data: + return value + assert isinstance(data, dict) + ssh_data = data["key_data"] + if ssh_data is None: + return value + + # Check if the data contains ssh key + try: + if keys.is_valid_ssh_rsa_public_key(ssh_data): + value._data["key_data"] = ssh_data + return value + except Exception as excep: + raise InvalidArgumentValueError( + "Unsupported SSH Key is provided." + ) from excep + + # Check if the data has the path to the ssh key with "~" + if os.fspath(ssh_data).startswith("~"): + value._data["key_data"] = self.read_file( + os.path.expanduser("~") + ssh_data.split("~")[1] + ) + return value + # Check if the data has the path to the ssh key + if os.path.isfile(ssh_data): + value._data["key_data"] = self.read_file(ssh_data) + return value + + raise AAZInvalidArgValueError( + f"Invalid Format '{data}' should be either the ssh key or file path to ssh key." + ) + + @abc.abstractmethod + def read_file(self, file_path): + with open(file_path, "r", encoding="utf-8") as k: + content = k.read() + try: + if keys.is_valid_ssh_rsa_public_key(content): + return content + except Exception as excep: + raise InvalidArgumentValueError( + f"Unsupported Key {file_path} is provided." + ) from excep diff --git a/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_create.py b/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_create.py index c5de588ce08..d9ca9808043 100644 --- a/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_create.py +++ b/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_create.py @@ -9,9 +9,12 @@ """ Provides VirtualMachine Console create customization """ + + from azext_networkcloud.aaz.latest.networkcloud.virtualmachine.console._create import ( Create as _Create, ) +from azext_networkcloud.operations.custom_arguments import AAZFileStringArgFormat from azure.cli.core.aaz import register_callback from .common import VirtualMachineConsole @@ -20,12 +23,15 @@ class Create(_Create): """This custom code inherits from generate virtual machine functions. It is integrated into the generated code via: - - cli-ext/v20221212preview/ext/src/networkcloud/azext_networkcloud/commands.py + - cli-ext/v*/ext/src/networkcloud/azext_networkcloud/commands.py """ @classmethod def _build_arguments_schema(cls, *args, **kwargs): args_schema = super()._build_arguments_schema(*args, **kwargs) + # ssh_public_key fmt is set to AAZFileStringArgFormat which can + # accept ssh key in string format or as a file input + args_schema.ssh_public_key._fmt = AAZFileStringArgFormat() return VirtualMachineConsole._build_arguments_schema(args_schema) @register_callback diff --git a/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_update.py b/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_update.py index 88e261b79de..4d4af73d794 100644 --- a/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_update.py +++ b/src/networkcloud/azext_networkcloud/operations/virtualmachine/console/_update.py @@ -13,6 +13,7 @@ from azext_networkcloud.aaz.latest.networkcloud.virtualmachine.console._update import ( Update as _Update, ) +from azext_networkcloud.operations.custom_arguments import AAZFileStringArgFormat from azure.cli.core.aaz import register_callback from .common import VirtualMachineConsole @@ -21,12 +22,14 @@ class Update(_Update): """ # This custom code inherits from generate virtual machine functions. It is integrated into the generated code via: - # cli-ext/v20221212preview/ext/src/networkcloud/azext_networkcloud/commands.py + # cli-ext/v*/ext/src/networkcloud/azext_networkcloud/commands.py """ @classmethod def _build_arguments_schema(cls, *args, **kwargs): args_schema = super()._build_arguments_schema(*args, **kwargs) + # ssh_public_key fmt is set to AAZFileStringArgFormat which can accept ssh key in string format or as a file input + args_schema.ssh_public_key._fmt = AAZFileStringArgFormat() return VirtualMachineConsole._build_arguments_schema(args_schema) @register_callback diff --git a/src/networkcloud/azext_networkcloud/tests/latest/config.py b/src/networkcloud/azext_networkcloud/tests/latest/config.py index 4f4c4bf65a0..2759656a281 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/config.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/config.py @@ -12,10 +12,11 @@ class LoadConfig: - ''' Loads the resource specific configuration for network cloud resources from config.ini. + """Loads the resource specific configuration for network cloud resources from config.ini. This configuration is loaded at the first instance and stored in the _config_instance Global parameter CONFIG can be used by calling classes to use the configuration values - ''' + """ + config = None def __init__(self): @@ -24,7 +25,7 @@ def __init__(self): self.config = self.readconfig(filename) def readconfig(self, filename): - ''' Load resource config from configuration file''' + """Load resource config from configuration file""" if self._config_instance: return self._config_instance self._config_instance = configparser.ConfigParser() @@ -33,7 +34,7 @@ def readconfig(self, filename): def get_config(): - ''' Load the config and return the class instance''' + """Load the config and return the class instance""" load_cnfig = LoadConfig() return load_cnfig.config diff --git a/src/networkcloud/azext_networkcloud/tests/latest/recordings/test_bmm_commands_scenario1.yaml b/src/networkcloud/azext_networkcloud/tests/latest/recordings/test_bmm_commands_scenario1.yaml index 05daf44700e..ebbd4d4c69e 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/recordings/test_bmm_commands_scenario1.yaml +++ b/src/networkcloud/azext_networkcloud/tests/latest/recordings/test_bmm_commands_scenario1.yaml @@ -115,7 +115,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/c13b2a94-678c-493c-a838-a59f7d9885a1*FAA5801187CC5D6E11B88645EED3385FC7E176F1C8CA989E3A6F27754C89CA0A","name":"c13b2a94-678c-493c-a838-a59f7d9885a1*FAA5801187CC5D6E11B88645EED3385FC7E176F1C8CA989E3A6F27754C89CA0A","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/simulator-HostedResources-02DDCFD2/providers/Microsoft.NetworkCloud/bareMetalMachines/rack1compute02","status":"Succeeded","startTime":"2023-05-24T00:31:39.3898591Z","endTime":"2023-05-24T00:31:56.8439981Z","error":{},"properties":{"exitCode":"0","outputHead":"====Action - Command Output====\nbin\nboot\ndev\netc\nhome\nlib\nlib64\nlost+found\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nsrv\nsys\ntmp\nusr\nvar\n","resultUrl":"https://cmhdx4xtxhqdst.blob.core.windows.net/bmm-run-command-output/b2b821e8-8f22-4942-bd88-208017176cf3-action-bmmruncmd.tar.gz?se=2023-05-24T04%3A31%3A55Z&sig=PGKusQmFjFnLGYJipHbk0zm%2BQRHixPjhLSRVyw1aVSc%3D&sp=r&spr=https&sr=b&st=2023-05-24T00%3A31%3A55Z&sv=2019-12-12"}}' + Command Output====\nbin\nboot\ndev\netc\nhome\nlib\nlib64\nlost+found\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nsrv\nsys\ntmp\nusr\nvar\n","resultUrl":"REDACTED"}}' headers: cache-control: - no-cache @@ -162,7 +162,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/c13b2a94-678c-493c-a838-a59f7d9885a1*FAA5801187CC5D6E11B88645EED3385FC7E176F1C8CA989E3A6F27754C89CA0A","name":"c13b2a94-678c-493c-a838-a59f7d9885a1*FAA5801187CC5D6E11B88645EED3385FC7E176F1C8CA989E3A6F27754C89CA0A","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/simulator-HostedResources-02DDCFD2/providers/Microsoft.NetworkCloud/bareMetalMachines/rack1compute02","status":"Succeeded","startTime":"2023-05-24T00:31:39.3898591Z","endTime":"2023-05-24T00:31:56.8439981Z","error":{},"properties":{"exitCode":"0","outputHead":"====Action - Command Output====\nbin\nboot\ndev\netc\nhome\nlib\nlib64\nlost+found\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nsrv\nsys\ntmp\nusr\nvar\n","resultUrl":"https://cmhdx4xtxhqdst.blob.core.windows.net/bmm-run-command-output/b2b821e8-8f22-4942-bd88-208017176cf3-action-bmmruncmd.tar.gz?se=2023-05-24T04%3A31%3A55Z&sig=PGKusQmFjFnLGYJipHbk0zm%2BQRHixPjhLSRVyw1aVSc%3D&sp=r&spr=https&sr=b&st=2023-05-24T00%3A31%3A55Z&sv=2019-12-12"}}' + Command Output====\nbin\nboot\ndev\netc\nhome\nlib\nlib64\nlost+found\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nsrv\nsys\ntmp\nusr\nvar\n","resultUrl":"REDACTED"}}' headers: cache-control: - no-cache @@ -308,7 +308,7 @@ interactions: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/4530a0c2-bef1-4431-bcf3-e8ebd5eab7fe*A23FFACE109100CDE9F10454DC2CDAD6C14694A46A9A61FE140BD459A7500277","name":"4530a0c2-bef1-4431-bcf3-e8ebd5eab7fe*A23FFACE109100CDE9F10454DC2CDAD6C14694A46A9A61FE140BD459A7500277","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/simulator-HostedResources-02DDCFD2/providers/Microsoft.NetworkCloud/bareMetalMachines/rack1compute03","status":"Succeeded","startTime":"2023-05-24T00:32:10.3256755Z","endTime":"2023-05-24T00:32:26.5192559Z","error":{},"properties":{"exitCode":"1","outputHead":"====Action Command Output====\nExecuting hardware-support-data-collection command\nGetting following hardware support logs: SysInfo,TTYLog\nERROR: Unable to connect - to RAC at specified IP address.\n","resultUrl":"https://cmhdx4xtxhqdst.blob.core.windows.net/bmm-run-command-output/47ac7c57-7f36-4de7-a31a-a8e45e8e7583-action-bmmdataextcmd.tar.gz?se=2023-05-24T04%3A32%3A25Z&sig=NYV5cc4FfdWdgLIPUKaZj28f0OOVRiMSsMpdDQF7buo%3D&sp=r&spr=https&sr=b&st=2023-05-24T00%3A32%3A25Z&sv=2019-12-12"}}' + to RAC at specified IP address.\n","resultUrl":"REDACTED"}}' headers: cache-control: - no-cache @@ -357,7 +357,7 @@ interactions: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/4530a0c2-bef1-4431-bcf3-e8ebd5eab7fe*A23FFACE109100CDE9F10454DC2CDAD6C14694A46A9A61FE140BD459A7500277","name":"4530a0c2-bef1-4431-bcf3-e8ebd5eab7fe*A23FFACE109100CDE9F10454DC2CDAD6C14694A46A9A61FE140BD459A7500277","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/simulator-HostedResources-02DDCFD2/providers/Microsoft.NetworkCloud/bareMetalMachines/rack1compute03","status":"Succeeded","startTime":"2023-05-24T00:32:10.3256755Z","endTime":"2023-05-24T00:32:26.5192559Z","error":{},"properties":{"exitCode":"1","outputHead":"====Action Command Output====\nExecuting hardware-support-data-collection command\nGetting following hardware support logs: SysInfo,TTYLog\nERROR: Unable to connect - to RAC at specified IP address.\n","resultUrl":"https://cmhdx4xtxhqdst.blob.core.windows.net/bmm-run-command-output/47ac7c57-7f36-4de7-a31a-a8e45e8e7583-action-bmmdataextcmd.tar.gz?se=2023-05-24T04%3A32%3A25Z&sig=NYV5cc4FfdWdgLIPUKaZj28f0OOVRiMSsMpdDQF7buo%3D&sp=r&spr=https&sr=b&st=2023-05-24T00%3A32%3A25Z&sv=2019-12-12"}}' + to RAC at specified IP address.\n","resultUrl":"REDACTED"}}' headers: cache-control: - no-cache @@ -508,7 +508,7 @@ interactions: (22h ago) 22h\ncalico-system calico-node-zlscp 1/1 Running 0 22h\ncalico-system calico-typha-745f74b4c6-phxm8 1/1 Running 0 23h\ncalico-system calico-typha-745f74b4c6-px4tn 1/1 Running 1 (22h ago) 22h\ncalico-system csi-node-driver-628k6 2/2 Running 1 (22h ago) 22h\ncalico-system csi-node-driver-8pf7n 2/2 Running 0 22h\ncalico-system csi-node-driver-rx5hw 2/2 Running 1 - (22h ago) 22h\ncalico-system csi-node-driver-v8qhv 2/2 Running 0 23h\ndefault virt-launcher-d82a9e1edcd5586b9c4c8e667dd73eb3d1e12c0a32db65v9g 1/1 Running 0 23h\ngatekeeper-system gatekeeper-audit-5c55fc4ddf-p99r8 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-2qnjz 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-4cwgh 1/1 Running 0 23h\nkube-system ama-logs-2x5bp ","resultUrl":"https://cmhdx4xtxhqdst.blob.core.windows.net/bmm-run-command-output/5bdd5aa5-fb38-4c7f-8c60-98a7201632e2-action-bmmrunreadcmd.tar.gz?se=2023-05-24T04%3A32%3A55Z&sig=JzSVRld0letHD8OSuDaDD3V1qKHbJOELC3MSMeMHa1w%3D&sp=r&spr=https&sr=b&st=2023-05-24T00%3A32%3A55Z&sv=2019-12-12"}}' + (22h ago) 22h\ncalico-system csi-node-driver-v8qhv 2/2 Running 0 23h\ndefault virt-launcher-d82a9e1edcd5586b9c4c8e667dd73eb3d1e12c0a32db65v9g 1/1 Running 0 23h\ngatekeeper-system gatekeeper-audit-5c55fc4ddf-p99r8 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-2qnjz 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-4cwgh 1/1 Running 0 23h\nkube-system ama-logs-2x5bp ","resultUrl":"REDACTED"}}' headers: cache-control: - no-cache @@ -562,7 +562,7 @@ interactions: (22h ago) 22h\ncalico-system calico-node-zlscp 1/1 Running 0 22h\ncalico-system calico-typha-745f74b4c6-phxm8 1/1 Running 0 23h\ncalico-system calico-typha-745f74b4c6-px4tn 1/1 Running 1 (22h ago) 22h\ncalico-system csi-node-driver-628k6 2/2 Running 1 (22h ago) 22h\ncalico-system csi-node-driver-8pf7n 2/2 Running 0 22h\ncalico-system csi-node-driver-rx5hw 2/2 Running 1 - (22h ago) 22h\ncalico-system csi-node-driver-v8qhv 2/2 Running 0 23h\ndefault virt-launcher-d82a9e1edcd5586b9c4c8e667dd73eb3d1e12c0a32db65v9g 1/1 Running 0 23h\ngatekeeper-system gatekeeper-audit-5c55fc4ddf-p99r8 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-2qnjz 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-4cwgh 1/1 Running 0 23h\nkube-system ama-logs-2x5bp ","resultUrl":"https://cmhdx4xtxhqdst.blob.core.windows.net/bmm-run-command-output/5bdd5aa5-fb38-4c7f-8c60-98a7201632e2-action-bmmrunreadcmd.tar.gz?se=2023-05-24T04%3A32%3A55Z&sig=JzSVRld0letHD8OSuDaDD3V1qKHbJOELC3MSMeMHa1w%3D&sp=r&spr=https&sr=b&st=2023-05-24T00%3A32%3A55Z&sv=2019-12-12"}}' + (22h ago) 22h\ncalico-system csi-node-driver-v8qhv 2/2 Running 0 23h\ndefault virt-launcher-d82a9e1edcd5586b9c4c8e667dd73eb3d1e12c0a32db65v9g 1/1 Running 0 23h\ngatekeeper-system gatekeeper-audit-5c55fc4ddf-p99r8 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-2qnjz 1/1 Running 0 23h\ngatekeeper-system gatekeeper-controller-manager-59c95b76c4-4cwgh 1/1 Running 0 23h\nkube-system ama-logs-2x5bp ","resultUrl":"REDACTED"}}' headers: cache-control: - no-cache diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachine.py b/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachine.py index e63cf4500eb..d52633c7357 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachine.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachine.py @@ -11,21 +11,22 @@ from azure.cli.testsdk import ScenarioTest from azure.cli.testsdk.scenario_tests import AllowLargeResponse + from .config import CONFIG def setup_scenario1(test): - '''Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - '''Testcase: scenario1''' + """Testcase: scenario1""" setup_scenario1(test) step_show(test, checks=[]) step_update(test, checks=[]) @@ -124,189 +125,216 @@ def call_scenario7(test): def step_show(test, checks=None): - '''BareMetalMachine show operation''' + """BareMetalMachine show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine show --name {nameCrud} --resource-group {rgCrud}') + "az networkcloud baremetalmachine show --name {nameCrud} --resource-group {rgCrud}" + ) def step_update(test, checks=None): - '''BareMetalMachine update operation''' + """BareMetalMachine update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine update --name {nameCrud} --tags {tagsUpdate} --machine-details {machineDetails} --resource-group {rgCrud}') + "az networkcloud baremetalmachine update --name {nameCrud} --tags {tagsUpdate} --machine-details {machineDetails} --resource-group {rgCrud}" + ) def step_list_subscription(test, checks=None): - '''BareMetalMachine list by subscription operation''' + """BareMetalMachine list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud baremetalmachine list') + test.cmd("az networkcloud baremetalmachine list") def step_list_resource_group(test, checks=None): - '''BareMetalMachine list by resource group operation''' + """BareMetalMachine list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud baremetalmachine list --resource-group {rgCrud}') + test.cmd("az networkcloud baremetalmachine list --resource-group {rgCrud}") def step_run_command(test, checks=None): - '''BareMetalMachine run command operation''' + """BareMetalMachine run command operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine run-command --name {nameRunCommand} --resource-group {rgCommands} --arguments {runCommandArguments} --limit-time-seconds {limitTimeSeconds} --script {script}') + "az networkcloud baremetalmachine run-command --name {nameRunCommand} --resource-group {rgCommands} --arguments {runCommandArguments} --limit-time-seconds {limitTimeSeconds} --script {script}" + ) def step_run_data_extract(test, checks=None): - '''BareMetalMachine run data extract operation''' + """BareMetalMachine run data extract operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine run-data-extract --name {nameRunDataExtract} --resource-group {rgCommands} --limit-time-seconds {limitTimeSeconds} --commands {dataExtractCommands}') + "az networkcloud baremetalmachine run-data-extract --name {nameRunDataExtract} --resource-group {rgCommands} --limit-time-seconds {limitTimeSeconds} --commands {dataExtractCommands}" + ) def step_run_read_command(test, checks=None): - '''BareMetalMachine run read command operation''' + """BareMetalMachine run read command operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine run-read-command --name {nameRunReadCommand} --resource-group {rgCommands} --limit-time-seconds {limitTimeSeconds} --commands {runReadCommands}') + "az networkcloud baremetalmachine run-read-command --name {nameRunReadCommand} --resource-group {rgCommands} --limit-time-seconds {limitTimeSeconds} --commands {runReadCommands}" + ) def step_cordon(test, checks=None): - '''BareMetalMachine cordon operation''' + """BareMetalMachine cordon operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine cordon --evacuate {cordonEvacuate} --name {nameCordon} --resource-group {rgCordon}') + "az networkcloud baremetalmachine cordon --evacuate {cordonEvacuate} --name {nameCordon} --resource-group {rgCordon}" + ) def step_uncordon(test, checks=None): - '''BareMetalMachine uncordon operation''' + """BareMetalMachine uncordon operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine uncordon --name {nameCordon} --resource-group {rgCordon}') + "az networkcloud baremetalmachine uncordon --name {nameCordon} --resource-group {rgCordon}" + ) def step_restart(test, checks=None): - '''BareMetalMachine restart operation''' + """BareMetalMachine restart operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine restart --name {nameRestart} --resource-group {rgPower}') + "az networkcloud baremetalmachine restart --name {nameRestart} --resource-group {rgPower}" + ) def step_power_off(test, checks=None): - '''BareMetalMachine power off operation''' + """BareMetalMachine power off operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine power-off --name {namePower} --skip-shutdown {skipShutdown} --resource-group {rgPower}') + "az networkcloud baremetalmachine power-off --name {namePower} --skip-shutdown {skipShutdown} --resource-group {rgPower}" + ) def step_start(test, checks=None): - '''BareMetalMachine start operation''' + """BareMetalMachine start operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine start --name {namePower} --resource-group {rgPower}') + "az networkcloud baremetalmachine start --name {namePower} --resource-group {rgPower}" + ) def step_reimage(test, checks=None): - '''BareMetalMachine reimage operation''' + """BareMetalMachine reimage operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine reimage --name {nameReimage} --resource-group {rgValidate}') + "az networkcloud baremetalmachine reimage --name {nameReimage} --resource-group {rgValidate}" + ) def step_replace(test, checks=None): - '''BareMetalMachine replace operation''' + """BareMetalMachine replace operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine replace --name {nameReplace} --resource-group {rgReplace} --bmc-credentials {bmcCreds} --bmc-mac-address {bmcMacAddress} --boot-mac-address {bootMacAddress} --machine-name {newBmmName} --serial-number {serialNumber}') + "az networkcloud baremetalmachine replace --name {nameReplace} --resource-group {rgReplace} --bmc-credentials {bmcCreds} --bmc-mac-address {bmcMacAddress} --boot-mac-address {bootMacAddress} --machine-name {newBmmName} --serial-number {serialNumber}" + ) def step_validate_hardware(test, checks=None): - '''BareMetalMachine validate hardware operation''' + """BareMetalMachine validate hardware operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud baremetalmachine validate-hardware --name {nameValidate} --resource-group {rgValidate} --validation-category {validationCategory}') + "az networkcloud baremetalmachine validate-hardware --name {nameValidate} --resource-group {rgValidate} --validation-category {validationCategory}" + ) class BareMetalMachineScenarioTest1(ScenarioTest): - '''BMMScenario test''' + """BMMScenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - # We are unable to create hydrated resources from the CLI, - # so we are using existing baremetalmachine names and - # resource groups. - 'nameCrud': CONFIG.get('BAREMETALMACHINE', 'name_crud'), - 'rgCrud': CONFIG.get('BAREMETALMACHINE', 'resource_group_crud'), - 'tags': CONFIG.get('BAREMETALMACHINE', 'tags'), - 'tagsUpdate': CONFIG.get('BAREMETALMACHINE', 'tags_update'), - 'machineDetails': CONFIG.get('BAREMETALMACHINE', 'machine_details'), - 'nameRunCommand': CONFIG.get('BAREMETALMACHINE', 'name_run_command'), - 'nameRunDataExtract': CONFIG.get('BAREMETALMACHINE', 'name_run_data_extract'), - 'nameRunReadCommand': CONFIG.get('BAREMETALMACHINE', 'name_run_read_command'), - 'runCommandArguments': CONFIG.get('BAREMETALMACHINE', 'run_command_arguments'), - 'dataExtractCommands': CONFIG.get('BAREMETALMACHINE', 'data_extract_commands'), - 'runReadCommands': CONFIG.get('BAREMETALMACHINE', 'run_read_commands'), - 'rgCommands': CONFIG.get('BAREMETALMACHINE', 'resource_group_commands'), - 'limitTimeSeconds': CONFIG.get('BAREMETALMACHINE', 'limit_time_seconds'), - 'script': CONFIG.get('BAREMETALMACHINE', 'script'), - 'nameCordon': CONFIG.get('BAREMETALMACHINE', 'name_cordon'), - 'rgCordon': CONFIG.get('BAREMETALMACHINE', 'resource_group_cordon'), - 'cordonEvacuate': CONFIG.get('BAREMETALMACHINE', 'cordon_evacuate'), - 'nameRestart': CONFIG.get('BAREMETALMACHINE', 'name_restart'), - 'namePower': CONFIG.get('BAREMETALMACHINE', 'name_power'), - 'rgPower': CONFIG.get('BAREMETALMACHINE', 'resource_group_power'), - 'skipShutdown': CONFIG.get('BAREMETALMACHINE', 'skip_shutdown'), - 'nameReimage': CONFIG.get('BAREMETALMACHINE', 'name_reimage'), - 'nameReplace': CONFIG.get('BAREMETALMACHINE', 'name_replace'), - 'nameValidate': CONFIG.get('BAREMETALMACHINE', 'name_validate'), - 'rgValidate': CONFIG.get('BAREMETALMACHINE', 'resource_group_validate'), - 'rgReplace': CONFIG.get('BAREMETALMACHINE', 'resource_group_replace'), - 'bmcCreds': CONFIG.get('BAREMETALMACHINE', 'bmc_creds'), - 'bmcMacAddress': CONFIG.get('BAREMETALMACHINE', 'bmc_mac_address'), - 'bootMacAddress': CONFIG.get('BAREMETALMACHINE', 'boot_mac_address'), - 'serialNumber': CONFIG.get('BAREMETALMACHINE', 'serial_number'), - 'newBmmName': CONFIG.get('BAREMETALMACHINE', 'new_bmm_name'), - 'validationCategory': CONFIG.get('BAREMETALMACHINE', 'validation_category'), - }) + self.kwargs.update( + { + # We are unable to create hydrated resources from the CLI, + # so we are using existing baremetalmachine names and + # resource groups. + "nameCrud": CONFIG.get("BAREMETALMACHINE", "name_crud"), + "rgCrud": CONFIG.get("BAREMETALMACHINE", "resource_group_crud"), + "tags": CONFIG.get("BAREMETALMACHINE", "tags"), + "tagsUpdate": CONFIG.get("BAREMETALMACHINE", "tags_update"), + "machineDetails": CONFIG.get("BAREMETALMACHINE", "machine_details"), + "nameRunCommand": CONFIG.get("BAREMETALMACHINE", "name_run_command"), + "nameRunDataExtract": CONFIG.get( + "BAREMETALMACHINE", "name_run_data_extract" + ), + "nameRunReadCommand": CONFIG.get( + "BAREMETALMACHINE", "name_run_read_command" + ), + "runCommandArguments": CONFIG.get( + "BAREMETALMACHINE", "run_command_arguments" + ), + "dataExtractCommands": CONFIG.get( + "BAREMETALMACHINE", "data_extract_commands" + ), + "runReadCommands": CONFIG.get("BAREMETALMACHINE", "run_read_commands"), + "rgCommands": CONFIG.get("BAREMETALMACHINE", "resource_group_commands"), + "limitTimeSeconds": CONFIG.get( + "BAREMETALMACHINE", "limit_time_seconds" + ), + "script": CONFIG.get("BAREMETALMACHINE", "script"), + "nameCordon": CONFIG.get("BAREMETALMACHINE", "name_cordon"), + "rgCordon": CONFIG.get("BAREMETALMACHINE", "resource_group_cordon"), + "cordonEvacuate": CONFIG.get("BAREMETALMACHINE", "cordon_evacuate"), + "nameRestart": CONFIG.get("BAREMETALMACHINE", "name_restart"), + "namePower": CONFIG.get("BAREMETALMACHINE", "name_power"), + "rgPower": CONFIG.get("BAREMETALMACHINE", "resource_group_power"), + "skipShutdown": CONFIG.get("BAREMETALMACHINE", "skip_shutdown"), + "nameReimage": CONFIG.get("BAREMETALMACHINE", "name_reimage"), + "nameReplace": CONFIG.get("BAREMETALMACHINE", "name_replace"), + "nameValidate": CONFIG.get("BAREMETALMACHINE", "name_validate"), + "rgValidate": CONFIG.get("BAREMETALMACHINE", "resource_group_validate"), + "rgReplace": CONFIG.get("BAREMETALMACHINE", "resource_group_replace"), + "bmcCreds": CONFIG.get("BAREMETALMACHINE", "bmc_creds"), + "bmcMacAddress": CONFIG.get("BAREMETALMACHINE", "bmc_mac_address"), + "bootMacAddress": CONFIG.get("BAREMETALMACHINE", "boot_mac_address"), + "serialNumber": CONFIG.get("BAREMETALMACHINE", "serial_number"), + "newBmmName": CONFIG.get("BAREMETALMACHINE", "new_bmm_name"), + "validationCategory": CONFIG.get( + "BAREMETALMACHINE", "validation_category" + ), + } + ) @AllowLargeResponse() def test_bmm_crud_scenario1(self): - ''' test scenario for BareMetalMachine CRUD operations''' + """test scenario for BareMetalMachine CRUD operations""" call_scenario1(self) @AllowLargeResponse() def test_bmm_commands_scenario1(self): - ''' test scenario for BareMetalMachine run command operations''' + """test scenario for BareMetalMachine run command operations""" call_scenario2(self) @AllowLargeResponse() def test_bmm_cordon_scenario1(self): - ''' test scenario for BareMetalMachine cordon operations''' + """test scenario for BareMetalMachine cordon operations""" call_scenario3(self) def test_bmm_power_scenario1(self): - ''' test scenario for BareMetalMachine power operations''' + """test scenario for BareMetalMachine power operations""" call_scenario4(self) def test_bmm_reimage_scenario1(self): - ''' test scenario for BareMetalMachine reimage operation''' + """test scenario for BareMetalMachine reimage operation""" call_scenario5(self) def test_bmm_replace_scenario1(self): - ''' test scenario for BareMetalMachine replace operation''' + """test scenario for BareMetalMachine replace operation""" call_scenario6(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachinekeyset.py b/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachinekeyset.py index 3c7a026c55b..5bab0b910b9 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachinekeyset.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_baremetalmachinekeyset.py @@ -9,31 +9,38 @@ BaremetalMachineKeyset tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_resource_group(test, checks=[]) step_delete(test, checks=[]) @@ -41,81 +48,100 @@ def call_scenario1(test): def step_create(test, checks=None): - '''BaremetalMachineKeyset create operation''' + """BaremetalMachineKeyset create operation""" if checks is None: checks = [] - test.cmd('az networkcloud cluster baremetalmachinekeyset create --name {name} ' - '--extended-location name={extendedLocation} type="CustomLocation" ' - '--location {location} --azure-group-id {azureGroupId} --expiration {expiration} ' - '--jump-hosts-allowed {jumpHostsAllowed} --os-group-name {osGroupName} ' - '--privilege-level {privilegeLevel} --user-list {userList} ' - '--tags key1="myvalue1" key2="myvalue2" --cluster-name {clusterName} ' - '--resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud cluster baremetalmachinekeyset create --name {name} " + '--extended-location name={extendedLocation} type="CustomLocation" ' + "--location {location} --azure-group-id {azureGroupId} --expiration {expiration} " + "--jump-hosts-allowed {jumpHostsAllowed} --os-group-name {osGroupName} " + "--privilege-level {privilegeLevel} --user-list {userList} " + '--tags key1="myvalue1" key2="myvalue2" --cluster-name {clusterName} ' + "--resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''BaremetalMachineKeyset show operation''' + """BaremetalMachineKeyset show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster baremetalmachinekeyset show --name {name} ' - '--cluster-name {clusterName} --resource-group {rg}') + "az networkcloud cluster baremetalmachinekeyset show --name {name} " + "--cluster-name {clusterName} --resource-group {rg}" + ) def step_delete(test, checks=None): - '''BaremetalMachineKeyset delete operation''' + """BaremetalMachineKeyset delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster baremetalmachinekeyset delete --name {name} ' - '--cluster-name {clusterName} --resource-group {rg} -y') + "az networkcloud cluster baremetalmachinekeyset delete --name {name} " + "--cluster-name {clusterName} --resource-group {rg} -y" + ) def step_list_resource_group(test, checks=None): - '''BaremetalMachineKeyset list by resource group operation''' + """BaremetalMachineKeyset list by resource group operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster baremetalmachinekeyset list ' - '--cluster-name {clusterName} --resource-group {rg}') + "az networkcloud cluster baremetalmachinekeyset list " + "--cluster-name {clusterName} --resource-group {rg}" + ) def step_update(test, checks=None): - '''BaremetalMachineKeyset update operation''' + """BaremetalMachineKeyset update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster baremetalmachinekeyset update ' - '--name {name} --tags {tagsUpdate} --cluster-name {clusterName} ' - '--jump-hosts-allowed {jumpHostsAllowedUpdate} ' - '--user-list {userListUpdate} --resource-group {rg}') + "az networkcloud cluster baremetalmachinekeyset update " + "--name {name} --tags {tagsUpdate} --cluster-name {clusterName} " + "--jump-hosts-allowed {jumpHostsAllowedUpdate} " + "--user-list {userListUpdate} --resource-group {rg}" + ) class BaremetalMachineKeysetScenarioTest(ScenarioTest): - ''' BaremetalMachineKeyset scenario test''' + """BaremetalMachineKeyset scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - # Autogenerated resource group is not used in this scenario as it depeneds on the - # parent resource cluster to be present in the RG - 'rg': CONFIG.get('BAREMETALMACHINE_KEYSET', 'resource_group'), - 'name': self.create_random_name(prefix="cli-test-bmmks-", length=24), - 'location': CONFIG.get('BAREMETALMACHINE_KEYSET', 'location'), - 'extendedLocation': CONFIG.get('BAREMETALMACHINE_KEYSET', 'extended_location'), - 'tags': CONFIG.get('BAREMETALMACHINE_KEYSET', 'tags'), - 'tagsUpdate': CONFIG.get('BAREMETALMACHINE_KEYSET', 'tags_update'), - "azureGroupId": CONFIG.get('BAREMETALMACHINE_KEYSET', 'azure_group_id'), - 'expiration': CONFIG.get('BAREMETALMACHINE_KEYSET', 'expiration'), - "jumpHostsAllowed": CONFIG.get('BAREMETALMACHINE_KEYSET', 'jump_hosts_allowed'), - "jumpHostsAllowedUpdate": CONFIG.get('BAREMETALMACHINE_KEYSET', 'jump_hosts_allowed_update'), - "osGroupName": CONFIG.get('BAREMETALMACHINE_KEYSET', 'os_group_name'), - "privilegeLevel": CONFIG.get('BAREMETALMACHINE_KEYSET', 'privilege_level'), - "userList": CONFIG.get('BAREMETALMACHINE_KEYSET', 'user_list'), - "userListUpdate": CONFIG.get('BAREMETALMACHINE_KEYSET', 'user_list_update'), - "clusterName": CONFIG.get('BAREMETALMACHINE_KEYSET', 'cluster_name'), - }) + self.kwargs.update( + { + # Autogenerated resource group is not used in this scenario as it depeneds on the + # parent resource cluster to be present in the RG + "rg": CONFIG.get("BAREMETALMACHINE_KEYSET", "resource_group"), + "name": self.create_random_name(prefix="cli-test-bmmks-", length=24), + "location": CONFIG.get("BAREMETALMACHINE_KEYSET", "location"), + "extendedLocation": CONFIG.get( + "BAREMETALMACHINE_KEYSET", "extended_location" + ), + "tags": CONFIG.get("BAREMETALMACHINE_KEYSET", "tags"), + "tagsUpdate": CONFIG.get("BAREMETALMACHINE_KEYSET", "tags_update"), + "azureGroupId": CONFIG.get("BAREMETALMACHINE_KEYSET", "azure_group_id"), + "expiration": CONFIG.get("BAREMETALMACHINE_KEYSET", "expiration"), + "jumpHostsAllowed": CONFIG.get( + "BAREMETALMACHINE_KEYSET", "jump_hosts_allowed" + ), + "jumpHostsAllowedUpdate": CONFIG.get( + "BAREMETALMACHINE_KEYSET", "jump_hosts_allowed_update" + ), + "osGroupName": CONFIG.get("BAREMETALMACHINE_KEYSET", "os_group_name"), + "privilegeLevel": CONFIG.get( + "BAREMETALMACHINE_KEYSET", "privilege_level" + ), + "userList": CONFIG.get("BAREMETALMACHINE_KEYSET", "user_list"), + "userListUpdate": CONFIG.get( + "BAREMETALMACHINE_KEYSET", "user_list_update" + ), + "clusterName": CONFIG.get("BAREMETALMACHINE_KEYSET", "cluster_name"), + } + ) def test_baremetalmachinekeyset_scenario1(self): - ''' test scenario for BaremetalMachineKeyset CRUD operations''' + """test scenario for BaremetalMachineKeyset CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_bmckeyset.py b/src/networkcloud/azext_networkcloud/tests/latest/test_bmckeyset.py index 00824719266..dd239eda4b7 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_bmckeyset.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_bmckeyset.py @@ -15,26 +15,32 @@ def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_resource_group(test, checks=[]) step_delete(test, checks=[]) @@ -42,73 +48,82 @@ def call_scenario1(test): def step_create(test, checks=None): - '''BMCKeySet create operation''' + """BMCKeySet create operation""" if checks is None: checks = [] - test.cmd('az networkcloud cluster bmckeyset create --name {name} --cluster-name {clusterName} ' - '--extended-location name={extendedLocation} type="CustomLocation" ' - '--location {location} --azure-group-id {azureGroupId} --expiration {expiration} ' - '--privilege-level {privilegeLevel} --user-list {userList} ' - '--tags {tags} --resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud cluster bmckeyset create --name {name} --cluster-name {clusterName} " + '--extended-location name={extendedLocation} type="CustomLocation" ' + "--location {location} --azure-group-id {azureGroupId} --expiration {expiration} " + "--privilege-level {privilegeLevel} --user-list {userList} " + "--tags {tags} --resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''BMCKeySet show operation''' + """BMCKeySet show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster bmckeyset show --name {name} --cluster-name {clusterName} --resource-group {rg}') + "az networkcloud cluster bmckeyset show --name {name} --cluster-name {clusterName} --resource-group {rg}" + ) def step_delete(test, checks=None): - '''BMCKeySet delete operation''' + """BMCKeySet delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster bmckeyset delete --name {name} --cluster-name {clusterName} --resource-group {rg} -y') + "az networkcloud cluster bmckeyset delete --name {name} --cluster-name {clusterName} --resource-group {rg} -y" + ) def step_list_resource_group(test, checks=None): - '''BMCKeySet list by resource group operation''' + """BMCKeySet list by resource group operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster bmckeyset list --cluster-name {clusterName} --resource-group {rg}') + "az networkcloud cluster bmckeyset list --cluster-name {clusterName} --resource-group {rg}" + ) def step_update(test, checks=None): - '''BMCKeySet update operation''' + """BMCKeySet update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster bmckeyset update --name {name} --cluster-name {clusterName} ' - '--tags {tagsUpdate} --user-list {userListUpdate} --expiration {expirationUpdate} ' - '--resource-group {rg}') + "az networkcloud cluster bmckeyset update --name {name} --cluster-name {clusterName} " + "--tags {tagsUpdate} --user-list {userListUpdate} --expiration {expirationUpdate} " + "--resource-group {rg}" + ) class BMCKeySetScenarioTest(ScenarioTest): - ''' BMCKeySet scenario test''' + """BMCKeySet scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - # Autogenerated resource group is not used in this scenario as it depeneds on the - # parent resource cluster to be present in the RG - 'rg': CONFIG.get('BMC_KEYSET', 'resource_group'), - 'name': self.create_random_name(prefix="cli-test-bmcks-", length=24), - 'location': CONFIG.get('BMC_KEYSET', 'location'), - 'extendedLocation': CONFIG.get('BMC_KEYSET', 'extended_location'), - 'tags': CONFIG.get('BMC_KEYSET', 'tags'), - 'tagsUpdate': CONFIG.get('BMC_KEYSET', 'tags_update'), - "azureGroupId": CONFIG.get('BMC_KEYSET', 'azure_group_id'), - 'expiration': CONFIG.get('BMC_KEYSET', 'expiration'), - 'expirationUpdate': CONFIG.get('BMC_KEYSET', 'expirationUpdate'), - "privilegeLevel": CONFIG.get('BMC_KEYSET', 'privilege_level'), - "userList": CONFIG.get('BMC_KEYSET', 'user_list'), - "userListUpdate": CONFIG.get('BMC_KEYSET', 'user_list_update'), - "clusterName": CONFIG.get('BMC_KEYSET', 'cluster_name'), - }) + self.kwargs.update( + { + # Autogenerated resource group is not used in this scenario as it depeneds on the + # parent resource cluster to be present in the RG + "rg": CONFIG.get("BMC_KEYSET", "resource_group"), + "name": self.create_random_name(prefix="cli-test-bmcks-", length=24), + "location": CONFIG.get("BMC_KEYSET", "location"), + "extendedLocation": CONFIG.get("BMC_KEYSET", "extended_location"), + "tags": CONFIG.get("BMC_KEYSET", "tags"), + "tagsUpdate": CONFIG.get("BMC_KEYSET", "tags_update"), + "azureGroupId": CONFIG.get("BMC_KEYSET", "azure_group_id"), + "expiration": CONFIG.get("BMC_KEYSET", "expiration"), + "expirationUpdate": CONFIG.get("BMC_KEYSET", "expirationUpdate"), + "privilegeLevel": CONFIG.get("BMC_KEYSET", "privilege_level"), + "userList": CONFIG.get("BMC_KEYSET", "user_list"), + "userListUpdate": CONFIG.get("BMC_KEYSET", "user_list_update"), + "clusterName": CONFIG.get("BMC_KEYSET", "cluster_name"), + } + ) def test_bmckeyset_scenario1(self): - ''' test scenario for BMCKeySet CRUD operations''' + """test scenario for BMCKeySet CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_cloudservicesnetwork.py b/src/networkcloud/azext_networkcloud/tests/latest/test_cloudservicesnetwork.py index 92dab65d7ea..b469ff4f23c 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_cloudservicesnetwork.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_cloudservicesnetwork.py @@ -9,31 +9,38 @@ CloudServicesNetwork tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test, checks=[]) step_list_resource_group(test, checks=[]) @@ -42,75 +49,89 @@ def call_scenario1(test): def step_create(test, checks=None): - '''cloudservicesnetwork create operation''' + """cloudservicesnetwork create operation""" if checks is None: checks = [] - test.cmd('az networkcloud cloudservicesnetwork create --name {name} --extended-location ' - 'name={extendedLocation} type="CustomLocation" --location {location} ' - '--additional-egress-endpoints {additionalEgressEndpoint} ' - '--enable-default-egress-endpoints {defaultEgressEndpoint} ' - ' --tags {tags} ' - ' --resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud cloudservicesnetwork create --name {name} --extended-location " + 'name={extendedLocation} type="CustomLocation" --location {location} ' + "--additional-egress-endpoints {additionalEgressEndpoint} " + "--enable-default-egress-endpoints {defaultEgressEndpoint} " + " --tags {tags} " + " --resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''cloudservicesnetwork show operation''' + """cloudservicesnetwork show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cloudservicesnetwork show --name {name} --resource-group {rg}') + "az networkcloud cloudservicesnetwork show --name {name} --resource-group {rg}" + ) def step_delete(test, checks=None): - '''cloudservicesnetwork delete operation''' + """cloudservicesnetwork delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cloudservicesnetwork delete --name {name} --resource-group {rg} -y') + "az networkcloud cloudservicesnetwork delete --name {name} --resource-group {rg} -y" + ) def step_list_resource_group(test, checks=None): - '''cloudservicesnetwork list by resource group operation''' + """cloudservicesnetwork list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud cloudservicesnetwork list --resource-group {rg}') + test.cmd("az networkcloud cloudservicesnetwork list --resource-group {rg}") def step_list_subscription(test, checks=None): - '''cloudservicesnetwork list by subscription operation''' + """cloudservicesnetwork list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud cloudservicesnetwork list') + test.cmd("az networkcloud cloudservicesnetwork list") def step_update(test, checks=None): - '''cloudservicesnetwork update operation''' + """cloudservicesnetwork update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cloudservicesnetwork update --name {name} ' - '--additional-egress-endpoints {additionalEgressEndpoint} ' - '--enable-default-egress-endpoints {defaultEgressEndpoint} ' - '--tags {tagsUpdate} ' - '--resource-group {rg}') + "az networkcloud cloudservicesnetwork update --name {name} " + "--additional-egress-endpoints {additionalEgressEndpoint} " + "--enable-default-egress-endpoints {defaultEgressEndpoint} " + "--tags {tagsUpdate} " + "--resource-group {rg}" + ) class CloudServicesNetworkScenarioTest(ScenarioTest): - ''' CloudServicesNetwork scenario test''' + """CloudServicesNetwork scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-csn-", length=24), - 'location': CONFIG.get('CLOUD_SERVICES_NETWORK', 'location'), - 'extendedLocation': CONFIG.get('CLOUD_SERVICES_NETWORK', 'extended_location'), - 'additionalEgressEndpoint': CONFIG.get('CLOUD_SERVICES_NETWORK', 'additional_egress_endpoint'), - 'defaultEgressEndpoint': CONFIG.get('CLOUD_SERVICES_NETWORK', 'default_egress_endpoint'), - 'tags': CONFIG.get('CLOUD_SERVICES_NETWORK', 'tags'), - 'tagsUpdate': CONFIG.get('CLOUD_SERVICES_NETWORK', 'tags_update'), - }) - - @ResourceGroupPreparer(name_prefix='clitest_rg'[:7], key='rg', parameter_name='rg') + self.kwargs.update( + { + "name": self.create_random_name(prefix="cli-test-csn-", length=24), + "location": CONFIG.get("CLOUD_SERVICES_NETWORK", "location"), + "extendedLocation": CONFIG.get( + "CLOUD_SERVICES_NETWORK", "extended_location" + ), + "additionalEgressEndpoint": CONFIG.get( + "CLOUD_SERVICES_NETWORK", "additional_egress_endpoint" + ), + "defaultEgressEndpoint": CONFIG.get( + "CLOUD_SERVICES_NETWORK", "default_egress_endpoint" + ), + "tags": CONFIG.get("CLOUD_SERVICES_NETWORK", "tags"), + "tagsUpdate": CONFIG.get("CLOUD_SERVICES_NETWORK", "tags_update"), + } + ) + + @ResourceGroupPreparer(name_prefix="clitest_rg"[:7], key="rg", parameter_name="rg") def test_cloudservicesnetwork_scenario1(self): - ''' test scenario for CloudServicesNetwork CRUD operations''' + """test scenario for CloudServicesNetwork CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_cluster.py b/src/networkcloud/azext_networkcloud/tests/latest/test_cluster.py index 0baa927ce29..043c52a3b8e 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_cluster.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_cluster.py @@ -9,8 +9,9 @@ Cluster tests scenarios """ +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest from azure.cli.testsdk.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer + from .config import CONFIG @@ -239,21 +240,11 @@ def __init__(self, *args, **kwargs): "thresholdGrouping": CONFIG.get("CLUSTER", "threshold_grouping"), "thresholdValue": CONFIG.get("CLUSTER", "threshold_value"), "networkFabricId": CONFIG.get("CLUSTER", "network_fabric_id"), - "networkRackId": CONFIG.get( - "CLUSTER", "network_rack_id" - ), - "rackSkuId": CONFIG.get( - "CLUSTER", "rack_sku_id" - ), - "rackSerialNumber": CONFIG.get( - "CLUSTER", "rack_serial_number" - ), - "rackLocation": CONFIG.get( - "CLUSTER", "rack_location" - ), - "availabilityZone": CONFIG.get( - "CLUSTER", "availability_zone" - ), + "networkRackId": CONFIG.get("CLUSTER", "network_rack_id"), + "rackSkuId": CONFIG.get("CLUSTER", "rack_sku_id"), + "rackSerialNumber": CONFIG.get("CLUSTER", "rack_serial_number"), + "rackLocation": CONFIG.get("CLUSTER", "rack_location"), + "availabilityZone": CONFIG.get("CLUSTER", "availability_zone"), "storageApplianceConfigurationData": CONFIG.get( "CLUSTER", "storage_appliance_configuration_data" ), diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_clustermanager.py b/src/networkcloud/azext_networkcloud/tests/latest/test_clustermanager.py index eb558595540..62fcf800474 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_clustermanager.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_clustermanager.py @@ -9,32 +9,39 @@ ClusterManager test scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest from azure.cli.testsdk.scenario_tests import AllowLargeResponse + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test) step_list_resource_group(test, checks=[]) @@ -43,72 +50,88 @@ def call_scenario1(test): def step_create(test, checks=None): - '''ClusterManager create operation''' + """ClusterManager create operation""" if checks is None: checks = [] - test.cmd('az networkcloud clustermanager create --name {name} ' - '--location {location} --resource-group {rg} ' - '--fabric-controller-id {fabricControllerId} ' - '--tags {tags} ' - '--managed-resource-group-configuration name={mrg_name} ' - '--analytics-workspace-id {analyticsWorkspaceId}', - checks=checks) + test.cmd( + "az networkcloud clustermanager create --name {name} " + "--location {location} --resource-group {rg} " + "--fabric-controller-id {fabricControllerId} " + "--tags {tags} " + "--managed-resource-group-configuration name={mrg_name} " + "--analytics-workspace-id {analyticsWorkspaceId}", + checks=checks, + ) def step_delete(test, checks=None): - '''ClusterManager delete operation''' + """ClusterManager delete operation""" if checks is None: checks = [] - test.cmd('az networkcloud clustermanager delete --name {name} ' - '--resource-group {rg} -y', checks=checks) + test.cmd( + "az networkcloud clustermanager delete --name {name} " + "--resource-group {rg} -y", + checks=checks, + ) def step_show(test, checks=None): - '''ClusterManager show operation''' + """ClusterManager show operation""" if checks is None: checks = [] - test.cmd('az networkcloud clustermanager show --name {name} ' - '--resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud clustermanager show --name {name} " "--resource-group {rg}", + checks=checks, + ) def step_list_resource_group(test, checks=None): - '''ClusterManager list by resource group operation''' + """ClusterManager list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud clustermanager list --resource-group {rg}') + test.cmd("az networkcloud clustermanager list --resource-group {rg}") @AllowLargeResponse def step_list_subscription(test): - '''ClusterManager list by subscription operation''' - test.cmd('az networkcloud clustermanager list') + """ClusterManager list by subscription operation""" + test.cmd("az networkcloud clustermanager list") def step_update(test, checks=None): - '''ClusterManager update operation''' + """ClusterManager update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud clustermanager update --name {name} ' - '--tags {tagsUpdate} --resource-group {rg}') + "az networkcloud clustermanager update --name {name} " + "--tags {tagsUpdate} --resource-group {rg}" + ) class ClusterManagerScenarioTest(ScenarioTest): - '''ClusterManager scenario test''' + """ClusterManager scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-cm-", length=24), - 'mrg_name': self.create_random_name(prefix="cli-test-cm-mrg-", length=24), - 'location': CONFIG.get('CLUSTER_MANAGER', 'location'), - 'analyticsWorkspaceId': CONFIG.get('CLUSTER_MANAGER', 'analytics_workspace_id'), - 'fabricControllerId': CONFIG.get('CLUSTER_MANAGER', 'fabric_controller_id'), - 'tags': CONFIG.get('CLUSTER_MANAGER', 'tags'), - 'tagsUpdate': CONFIG.get('CLUSTER_MANAGER', 'tags_update'), - }) - - @ResourceGroupPreparer(name_prefix='clitest_rg'[:7], key='rg', parameter_name='rg') + self.kwargs.update( + { + "name": self.create_random_name(prefix="cli-test-cm-", length=24), + "mrg_name": self.create_random_name( + prefix="cli-test-cm-mrg-", length=24 + ), + "location": CONFIG.get("CLUSTER_MANAGER", "location"), + "analyticsWorkspaceId": CONFIG.get( + "CLUSTER_MANAGER", "analytics_workspace_id" + ), + "fabricControllerId": CONFIG.get( + "CLUSTER_MANAGER", "fabric_controller_id" + ), + "tags": CONFIG.get("CLUSTER_MANAGER", "tags"), + "tagsUpdate": CONFIG.get("CLUSTER_MANAGER", "tags_update"), + } + ) + + @ResourceGroupPreparer(name_prefix="clitest_rg"[:7], key="rg", parameter_name="rg") def test_clustermanager_scenario1(self): - ''' test scenario for ClusterManager CRUD operations''' + """test scenario for ClusterManager CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetescluster.py b/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetescluster.py index a7c5e1ce636..71a258a1c78 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetescluster.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetescluster.py @@ -16,17 +16,17 @@ def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) step_create(test) step_update(test) @@ -38,99 +38,115 @@ def call_scenario1(test): def step_create(test, checks=None): - '''Kubernetescluster create operation''' + """Kubernetescluster create operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster create --name {name} --resource-group {rg} ' - '--location {location} --extended-location name={extendedLocation} type={extendedLocationType} ' - '--kubernetes-version {kubernetesVersion} ' - '--admin-username {adminUsername} --ssh-key-values {sshKey} ' - '--aad-configuration admin-group-object-ids={adminGroupObjectIds} ' - '--initial-agent-pool-configurations {initialNodeConfiguration} ' - '--control-plane-node-configuration count={count} vmSkuName={vmSkuName} adminUsername={cpAdminUsername} sshKeyValues={cpSshKeyList} ' - '--network-configuration cloud-services-network-id={csnId} cni-network-id={cniId} pod-cidrs={podCidrs} service-cidrs={serviceCidrs} dns-service-ip={dnsServiceIp} ' - 'bgp-service-load-balancer-configuration.bgp-advertisements={bgpAdvertisements} ' - 'bgp-service-load-balancer-configuration.fabric-peering-enabled={fabricPeeringEnabled} ' - 'bgp-service-load-balancer-configuration.ip-address-pools={ipAddressPools} ' - '--tags {tags}') + "az networkcloud kubernetescluster create --name {name} --resource-group {rg} " + "--location {location} --extended-location name={extendedLocation} type={extendedLocationType} " + "--kubernetes-version {kubernetesVersion} " + "--admin-username {adminUsername} --ssh-key-values {sshKey} " + "--aad-configuration admin-group-object-ids={adminGroupObjectIds} " + "--initial-agent-pool-configurations {initialNodeConfiguration} " + "--control-plane-node-configuration count={count} vmSkuName={vmSkuName} adminUsername={cpAdminUsername} sshKeyValues={cpSshKeyList} " + "--network-configuration cloud-services-network-id={csnId} cni-network-id={cniId} pod-cidrs={podCidrs} service-cidrs={serviceCidrs} dns-service-ip={dnsServiceIp} " + "bgp-service-load-balancer-configuration.bgp-advertisements={bgpAdvertisements} " + "bgp-service-load-balancer-configuration.fabric-peering-enabled={fabricPeeringEnabled} " + "bgp-service-load-balancer-configuration.ip-address-pools={ipAddressPools} " + "--tags {tags}" + ) def step_update(test, checks=None): - '''Kubernetescluster update operation''' + """Kubernetescluster update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster update --name {name} --kubernetes-version {kubernetesVersion} ' - '--control-plane-node-configuration count={countUpdate} --resource-group {rg} --tags {tagsUpdate}') + "az networkcloud kubernetescluster update --name {name} --kubernetes-version {kubernetesVersion} " + "--control-plane-node-configuration count={countUpdate} --resource-group {rg} --tags {tagsUpdate}" + ) def step_show(test, checks=None): - '''Kubernetescluster show operation''' + """Kubernetescluster show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster show --name {name} --resource-group {rg}') + "az networkcloud kubernetescluster show --name {name} --resource-group {rg}" + ) def step_list(test, checks=None): - '''Kubernetescluster list operation''' + """Kubernetescluster list operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud kubernetescluster list ') + test.cmd("az networkcloud kubernetescluster list ") def step_list_subscription(test, checks=None): - '''Kubernetescluster list in subscription operation''' + """Kubernetescluster list in subscription operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud kubernetescluster list --resource-group {rg}') + test.cmd("az networkcloud kubernetescluster list --resource-group {rg}") def step_delete(test, checks=None): - '''Kubernetescluster delete operation''' + """Kubernetescluster delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster delete --name {name} --resource-group {rg} -y') + "az networkcloud kubernetescluster delete --name {name} --resource-group {rg} -y" + ) class KubernetesClusterScenarioTest(ScenarioTest): - '''Kubernetescluster scenario tests''' + """Kubernetescluster scenario tests""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-naks-", length=24), - 'rg': CONFIG.get('KUBERNETESCLUSTER', 'resource_group'), - 'location': CONFIG.get('KUBERNETESCLUSTER', 'location'), - 'extendedLocation': CONFIG.get('KUBERNETESCLUSTER', 'extended_location'), - "extendedLocationType": CONFIG.get("CLUSTER", "extended_location_type"), - 'tags': CONFIG.get('KUBERNETESCLUSTER', 'tags'), - 'tagsUpdate': CONFIG.get('KUBERNETESCLUSTER', 'tags_update'), - 'adminUsername': CONFIG.get('KUBERNETESCLUSTER', 'admin_username'), - 'sshKey': CONFIG.get('KUBERNETESCLUSTER', 'ssh_key_values'), - 'cpAdminUsername': CONFIG.get('KUBERNETESCLUSTER', 'cp_admin_username'), - 'cpSshKeyList': CONFIG.get('KUBERNETESCLUSTER', 'cp_ssh_key_list'), - 'adminGroupObjectIds': CONFIG.get('KUBERNETESCLUSTER', 'admin_group_object_ids'), - 'initialNodeConfiguration': CONFIG.get('KUBERNETESCLUSTER', 'initial_node_configuration'), - 'csnId': CONFIG.get('KUBERNETESCLUSTER', 'cloud_services_network_id'), - 'cniId': CONFIG.get('KUBERNETESCLUSTER', 'cni_network_id'), - 'podCidrs': CONFIG.get('KUBERNETESCLUSTER', 'pod_cidrs'), - 'serviceCidrs': CONFIG.get('KUBERNETESCLUSTER', 'service_cidrs'), - 'dnsServiceIp': CONFIG.get('KUBERNETESCLUSTER', 'dns_service_ip'), - 'bgpAdvertisements': CONFIG.get('KUBERNETESCLUSTER', 'bgp_advertisements'), - 'fabricPeeringEnabled': CONFIG.get('KUBERNETESCLUSTER', 'fabric_peering_enabled'), - 'ipAddressPools': CONFIG.get('KUBERNETESCLUSTER', 'ip_address_pools'), - 'kubernetesVersion': CONFIG.get('KUBERNETESCLUSTER', 'kubernetes_version'), - 'countUpdate': CONFIG.get('KUBERNETESCLUSTER', 'count_update'), - 'vmSkuName': CONFIG.get('KUBERNETESCLUSTER', 'vm_sku_name'), - 'count': CONFIG.get('KUBERNETESCLUSTER', 'count'), - }) + self.kwargs.update( + { + "name": self.create_random_name(prefix="cli-test-naks-", length=24), + "rg": CONFIG.get("KUBERNETESCLUSTER", "resource_group"), + "location": CONFIG.get("KUBERNETESCLUSTER", "location"), + "extendedLocation": CONFIG.get( + "KUBERNETESCLUSTER", "extended_location" + ), + "extendedLocationType": CONFIG.get("CLUSTER", "extended_location_type"), + "tags": CONFIG.get("KUBERNETESCLUSTER", "tags"), + "tagsUpdate": CONFIG.get("KUBERNETESCLUSTER", "tags_update"), + "adminUsername": CONFIG.get("KUBERNETESCLUSTER", "admin_username"), + "sshKey": CONFIG.get("KUBERNETESCLUSTER", "ssh_key_values"), + "cpAdminUsername": CONFIG.get("KUBERNETESCLUSTER", "cp_admin_username"), + "cpSshKeyList": CONFIG.get("KUBERNETESCLUSTER", "cp_ssh_key_list"), + "adminGroupObjectIds": CONFIG.get( + "KUBERNETESCLUSTER", "admin_group_object_ids" + ), + "initialNodeConfiguration": CONFIG.get( + "KUBERNETESCLUSTER", "initial_node_configuration" + ), + "csnId": CONFIG.get("KUBERNETESCLUSTER", "cloud_services_network_id"), + "cniId": CONFIG.get("KUBERNETESCLUSTER", "cni_network_id"), + "podCidrs": CONFIG.get("KUBERNETESCLUSTER", "pod_cidrs"), + "serviceCidrs": CONFIG.get("KUBERNETESCLUSTER", "service_cidrs"), + "dnsServiceIp": CONFIG.get("KUBERNETESCLUSTER", "dns_service_ip"), + "bgpAdvertisements": CONFIG.get( + "KUBERNETESCLUSTER", "bgp_advertisements" + ), + "fabricPeeringEnabled": CONFIG.get( + "KUBERNETESCLUSTER", "fabric_peering_enabled" + ), + "ipAddressPools": CONFIG.get("KUBERNETESCLUSTER", "ip_address_pools"), + "kubernetesVersion": CONFIG.get( + "KUBERNETESCLUSTER", "kubernetes_version" + ), + "countUpdate": CONFIG.get("KUBERNETESCLUSTER", "count_update"), + "vmSkuName": CONFIG.get("KUBERNETESCLUSTER", "vm_sku_name"), + "count": CONFIG.get("KUBERNETESCLUSTER", "count"), + } + ) @AllowLargeResponse() def test_kubernetescluster_scenario(self): - ''' test scenario for kubernetes cluster CRUD operations''' + """test scenario for kubernetes cluster CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetesclusteragentpool.py b/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetesclusteragentpool.py index 0cf32109a67..8336ba9fa0b 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetesclusteragentpool.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_kubernetesclusteragentpool.py @@ -10,21 +10,22 @@ """ from azure.cli.testsdk import ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) step_create(test) step_update(test) @@ -35,88 +36,105 @@ def call_scenario1(test): def step_create(test, checks=None): - '''Kubernetescluster agentpool create operation''' + """Kubernetescluster agentpool create operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster agentpool create --name {name} ' - '--kubernetes-cluster-name {clusterName} --resource-group {rg} ' - '--location {location} ' - '--extended-location name={extendedLocation} type={extendedLocationType} ' - '--admin-username={adminUsername} ' - '--ssh-key-values {sshKey} ' - '--count {count} --mode {mode} --vm-sku-name {vmSkuName} ' - '--agent-options {agentOptions} --labels {labels} --taints {taints} ' - '--attached-network-configuration l3-networks={l3Networks} ' - '--availability-zones {availabilityZones} ' - '--upgrade-settings max-surge={maxSurge} ' - '--tags {tags}') + "az networkcloud kubernetescluster agentpool create --name {name} " + "--kubernetes-cluster-name {clusterName} --resource-group {rg} " + "--location {location} " + "--extended-location name={extendedLocation} type={extendedLocationType} " + "--admin-username={adminUsername} " + "--ssh-key-values {sshKey} " + "--count {count} --mode {mode} --vm-sku-name {vmSkuName} " + "--agent-options {agentOptions} --labels {labels} --taints {taints} " + "--attached-network-configuration l3-networks={l3Networks} " + "--availability-zones {availabilityZones} " + "--upgrade-settings max-surge={maxSurge} " + "--tags {tags}" + ) def step_update(test, checks=None): - '''Kubernetescluster agentpool update operation''' + """Kubernetescluster agentpool update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster agentpool update --name {name} ' - '--kubernetes-cluster-name {clusterName} --resource-group {rg} ' - '--tags {tagsUpdate}') + "az networkcloud kubernetescluster agentpool update --name {name} " + "--kubernetes-cluster-name {clusterName} --resource-group {rg} " + "--tags {tagsUpdate}" + ) def step_show(test, checks=None): - '''Kubernetescluster agentpool show operation''' + """Kubernetescluster agentpool show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster agentpool show --name {name} ' - '--kubernetes-cluster-name {clusterName} --resource-group {rg}') + "az networkcloud kubernetescluster agentpool show --name {name} " + "--kubernetes-cluster-name {clusterName} --resource-group {rg}" + ) def step_list(test, checks=None): - '''Kubernetescluster agentpool list operation''' + """Kubernetescluster agentpool list operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster agentpool list ' - '--kubernetes-cluster-name {clusterName} --resource-group {rg}') + "az networkcloud kubernetescluster agentpool list " + "--kubernetes-cluster-name {clusterName} --resource-group {rg}" + ) def step_delete(test, checks=None): - '''Kubernetescluster agentpool delete operation''' + """Kubernetescluster agentpool delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud kubernetescluster agentpool delete --name {name} ' - '--kubernetes-cluster-name {clusterName} --resource-group {rg} -y') + "az networkcloud kubernetescluster agentpool delete --name {name} " + "--kubernetes-cluster-name {clusterName} --resource-group {rg} -y" + ) class KubernetesClusterAgentPoolScenarioTest(ScenarioTest): - '''Kubernetescluster agentpool scenario tests''' + """Kubernetescluster agentpool scenario tests""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'name'), - 'clusterName': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'cluster_name'), - 'rg': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'resource_group'), - 'location': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'location'), - 'extendedLocation': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'extended_location'), - "extendedLocationType": CONFIG.get("CLUSTER", "extended_location_type"), - 'tags': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'tags'), - 'tagsUpdate': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'tags_update'), - 'adminUsername': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'admin_username'), - 'sshKey': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'ssh_key_values'), - 'count': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'count'), - 'mode': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'mode'), - 'vmSkuName': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'vm_sku_name'), - 'agentOptions': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'agent_options'), - 'l3Networks': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'l3_networks'), - 'taints': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'taints'), - 'labels': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'labels'), - 'availabilityZones': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'availability_zones'), - 'maxSurge': CONFIG.get('KUBERNETESCLUSTER_AGENTPOOL', 'max_surge'), - }) + self.kwargs.update( + { + "name": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "name"), + "clusterName": CONFIG.get( + "KUBERNETESCLUSTER_AGENTPOOL", "cluster_name" + ), + "rg": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "resource_group"), + "location": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "location"), + "extendedLocation": CONFIG.get( + "KUBERNETESCLUSTER_AGENTPOOL", "extended_location" + ), + "extendedLocationType": CONFIG.get("CLUSTER", "extended_location_type"), + "tags": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "tags"), + "tagsUpdate": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "tags_update"), + "adminUsername": CONFIG.get( + "KUBERNETESCLUSTER_AGENTPOOL", "admin_username" + ), + "sshKey": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "ssh_key_values"), + "count": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "count"), + "mode": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "mode"), + "vmSkuName": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "vm_sku_name"), + "agentOptions": CONFIG.get( + "KUBERNETESCLUSTER_AGENTPOOL", "agent_options" + ), + "l3Networks": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "l3_networks"), + "taints": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "taints"), + "labels": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "labels"), + "availabilityZones": CONFIG.get( + "KUBERNETESCLUSTER_AGENTPOOL", "availability_zones" + ), + "maxSurge": CONFIG.get("KUBERNETESCLUSTER_AGENTPOOL", "max_surge"), + } + ) def test_kubernetesclusteragentpool_scenario(self): - ''' test scenario for kubernetes cluster agentpool CRUD operations''' + """test scenario for kubernetes cluster agentpool CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_l2network.py b/src/networkcloud/azext_networkcloud/tests/latest/test_l2network.py index 0c5f9b4612b..6a0ad3f92ca 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_l2network.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_l2network.py @@ -9,31 +9,38 @@ L2Network tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test, checks=[]) step_list_resource_group(test, checks=[]) @@ -42,71 +49,77 @@ def call_scenario1(test): def step_create(test, checks=None): - '''L2Network create operation''' + """L2Network create operation""" if checks is None: checks = [] - test.cmd('az networkcloud l2network create --name {name} --extended-location ' - 'name={extendedLocation} type={type} --location {location} ' - '--interface-name {interfaceName} ' - '--l2-isolation-domain-id {l2_isolation_domain_id} --tags ' - ' {tags} --resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud l2network create --name {name} --extended-location " + "name={extendedLocation} type={type} --location {location} " + "--interface-name {interfaceName} " + "--l2-isolation-domain-id {l2_isolation_domain_id} --tags " + " {tags} --resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''L2Network show operation''' + """L2Network show operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud l2network show --name {name} --resource-group {rg}') + test.cmd("az networkcloud l2network show --name {name} --resource-group {rg}") def step_delete(test, checks=None): - '''L2Network delete operation''' + """L2Network delete operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud l2network delete --name {name} --resource-group {rg} -y') + test.cmd("az networkcloud l2network delete --name {name} --resource-group {rg} -y") def step_list_resource_group(test, checks=None): - '''L2Network list by resource group operation''' + """L2Network list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud l2network list --resource-group {rg}') + test.cmd("az networkcloud l2network list --resource-group {rg}") def step_list_subscription(test, checks=None): - '''L2Network list by subscription operation''' + """L2Network list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud l2network list') + test.cmd("az networkcloud l2network list") def step_update(test, checks=None): - '''L2Network update operation''' + """L2Network update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud l2network update --name {name} --tags {tagsUpdate} --resource-group {rg}') + "az networkcloud l2network update --name {name} --tags {tagsUpdate} --resource-group {rg}" + ) class L2NetworkScenarioTest(ScenarioTest): - '''L2Network scenario test''' + """L2Network scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-l2-", length=24), - 'location': CONFIG.get('L2_NETWORK', 'location'), - 'extendedLocation': CONFIG.get('L2_NETWORK', 'extended_location'), - 'tags': CONFIG.get('L2_NETWORK', 'tags'), - 'tagsUpdate': CONFIG.get('L2_NETWORK', 'tags_update'), - "type": CONFIG.get('L2_NETWORK', 'type'), - "interfaceName": CONFIG.get('L2_NETWORK', 'interface_name'), - "l2_isolation_domain_id": CONFIG.get('L2_NETWORK', 'l2_isolation_domain_id'), - }) - - @ResourceGroupPreparer(name_prefix='clitest_rg'[:7], key='rg', parameter_name='rg') + self.kwargs.update( + { + "name": self.create_random_name(prefix="cli-test-l2-", length=24), + "location": CONFIG.get("L2_NETWORK", "location"), + "extendedLocation": CONFIG.get("L2_NETWORK", "extended_location"), + "tags": CONFIG.get("L2_NETWORK", "tags"), + "tagsUpdate": CONFIG.get("L2_NETWORK", "tags_update"), + "type": CONFIG.get("L2_NETWORK", "type"), + "interfaceName": CONFIG.get("L2_NETWORK", "interface_name"), + "l2_isolation_domain_id": CONFIG.get( + "L2_NETWORK", "l2_isolation_domain_id" + ), + } + ) + + @ResourceGroupPreparer(name_prefix="clitest_rg"[:7], key="rg", parameter_name="rg") def test_l2network_scenario1(self): - '''test scenario for L2Network CRUD operations''' + """test scenario for L2Network CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_l3network.py b/src/networkcloud/azext_networkcloud/tests/latest/test_l3network.py index f21b873ce0c..26f4885113f 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_l3network.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_l3network.py @@ -9,31 +9,38 @@ L3Network tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test, checks=[]) step_list_resource_group(test, checks=[]) @@ -42,75 +49,81 @@ def call_scenario1(test): def step_create(test, checks=None): - '''L3Network create operation''' + """L3Network create operation""" if checks is None: checks = [] - test.cmd('az networkcloud l3network create --name {name} --extended-location ' - 'name={extendedLocation} type="CustomLocation" --location {location} ' - '--interface-name "eth0" --ip-allocation-type {ipAllocationType} ' - '--ipv4-connected-prefix {ipv4prefix} --ipv6-connected-prefix {ipv6prefix} ' - '--l3-isolation-domain-id {l3_isolation_domain_id} --vlan {vlan} --tags ' - ' {tags} --resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud l3network create --name {name} --extended-location " + 'name={extendedLocation} type="CustomLocation" --location {location} ' + '--interface-name "eth0" --ip-allocation-type {ipAllocationType} ' + "--ipv4-connected-prefix {ipv4prefix} --ipv6-connected-prefix {ipv6prefix} " + "--l3-isolation-domain-id {l3_isolation_domain_id} --vlan {vlan} --tags " + " {tags} --resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''L3Network show operation''' + """L3Network show operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud l3network show --name {name} --resource-group {rg}') + test.cmd("az networkcloud l3network show --name {name} --resource-group {rg}") def step_delete(test, checks=None): - '''L3Network delete operation''' + """L3Network delete operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud l3network delete --name {name} --resource-group {rg} -y') + test.cmd("az networkcloud l3network delete --name {name} --resource-group {rg} -y") def step_list_resource_group(test, checks=None): - '''L3Network list by resource group operation''' + """L3Network list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud l3network list --resource-group {rg}') + test.cmd("az networkcloud l3network list --resource-group {rg}") def step_list_subscription(test, checks=None): - '''L3Network list by subscription operation''' + """L3Network list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud l3network list') + test.cmd("az networkcloud l3network list") def step_update(test, checks=None): - '''L3Network update operation''' + """L3Network update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud l3network update --name {name} --tags {tagsUpdate} --resource-group {rg}') + "az networkcloud l3network update --name {name} --tags {tagsUpdate} --resource-group {rg}" + ) class L3NetworkScenarioTest(ScenarioTest): - ''' L3Network scenario test''' + """L3Network scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-l3-", length=24), - 'location': CONFIG.get('L3_NETWORK', 'location'), - 'extendedLocation': CONFIG.get('L3_NETWORK', 'extended_location'), - 'tags': CONFIG.get('L3_NETWORK', 'tags'), - 'tagsUpdate': CONFIG.get('L3_NETWORK', 'tags_update'), - "type": CONFIG.get('L3_NETWORK', 'type'), - 'vlan': CONFIG.get('L3_NETWORK', 'vlan'), - "ipAllocationType": CONFIG.get('L3_NETWORK', 'ip_allocation_type'), - "ipv4prefix": CONFIG.get('L3_NETWORK', 'ipv4prefix'), - "ipv6prefix": CONFIG.get('L3_NETWORK', 'ipv6prefix'), - "l3_isolation_domain_id": CONFIG.get('L3_NETWORK', 'l3_isolation_domain_id'), - }) - - @ResourceGroupPreparer(name_prefix='clitest_rg'[:7], key='rg', parameter_name='rg') + self.kwargs.update( + { + "name": self.create_random_name(prefix="cli-test-l3-", length=24), + "location": CONFIG.get("L3_NETWORK", "location"), + "extendedLocation": CONFIG.get("L3_NETWORK", "extended_location"), + "tags": CONFIG.get("L3_NETWORK", "tags"), + "tagsUpdate": CONFIG.get("L3_NETWORK", "tags_update"), + "type": CONFIG.get("L3_NETWORK", "type"), + "vlan": CONFIG.get("L3_NETWORK", "vlan"), + "ipAllocationType": CONFIG.get("L3_NETWORK", "ip_allocation_type"), + "ipv4prefix": CONFIG.get("L3_NETWORK", "ipv4prefix"), + "ipv6prefix": CONFIG.get("L3_NETWORK", "ipv6prefix"), + "l3_isolation_domain_id": CONFIG.get( + "L3_NETWORK", "l3_isolation_domain_id" + ), + } + ) + + @ResourceGroupPreparer(name_prefix="clitest_rg"[:7], key="rg", parameter_name="rg") def test_l3network_scenario1(self): - ''' test scenario for L3Network CRUD operations''' + """test scenario for L3Network CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_metricsconfiguration.py b/src/networkcloud/azext_networkcloud/tests/latest/test_metricsconfiguration.py index 1b7d15f21fc..6d028bc73c0 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_metricsconfiguration.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_metricsconfiguration.py @@ -9,28 +9,32 @@ MetricsConfiguration tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[test.check('provisioningState', 'Succeeded')]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create(test, checks=[test.check("provisioningState", "Succeeded")]) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_resource_group(test, checks=[]) step_delete(test, checks=[]) @@ -38,70 +42,83 @@ def call_scenario1(test): def step_create(test, checks=None): - '''MetricsConfiguration create operation''' + """MetricsConfiguration create operation""" if checks is None: checks = [] - test.cmd('az networkcloud cluster metricsconfiguration create --cluster-name {clusterName} ' - '--extended-location name={extendedLocation} type="CustomLocation" ' - '--location {location} --collection-interval {collectionInterval} ' - '--enabled-metrics {enabledMetrics} --tags {tags} ' - '--resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud cluster metricsconfiguration create --cluster-name {clusterName} " + '--extended-location name={extendedLocation} type="CustomLocation" ' + "--location {location} --collection-interval {collectionInterval} " + "--enabled-metrics {enabledMetrics} --tags {tags} " + "--resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''MetricsConfiguration show operation''' + """MetricsConfiguration show operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster metricsconfiguration show --cluster-name {clusterName} --resource-group {rg}') + "az networkcloud cluster metricsconfiguration show --cluster-name {clusterName} --resource-group {rg}" + ) def step_delete(test, checks=None): - '''MetricsConfiguration delete operation''' + """MetricsConfiguration delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster metricsconfiguration delete --cluster-name {clusterName} --resource-group {rg} -y') + "az networkcloud cluster metricsconfiguration delete --cluster-name {clusterName} --resource-group {rg} -y" + ) def step_list_resource_group(test, checks=None): - '''MetricsConfiguration list by resource group operation''' + """MetricsConfiguration list by resource group operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster metricsconfiguration list ' - '--cluster-name {clusterName} --resource-group {rg}') + "az networkcloud cluster metricsconfiguration list " + "--cluster-name {clusterName} --resource-group {rg}" + ) def step_update(test, checks=None): - '''MetricsConfiguration update operation''' + """MetricsConfiguration update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud cluster metricsconfiguration update ' - '--cluster-name {clusterName} --tags {tagsUpdate} ' - '--enabled-metrics {enabledMetrics} ' - '--collection-interval {collectionInterval} --resource-group {rg}') + "az networkcloud cluster metricsconfiguration update " + "--cluster-name {clusterName} --tags {tagsUpdate} " + "--enabled-metrics {enabledMetrics} " + "--collection-interval {collectionInterval} --resource-group {rg}" + ) class MetricsConfigurationScenarioTest(ScenarioTest): - ''' MetricsConfiguration scenario test''' + """MetricsConfiguration scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - # Autogenerated resource group is not used in this scenario as it depends on the - # parent resource cluster to be present in the RG - 'rg': CONFIG.get('METRICSCONFIGURATION', 'resource_group'), - 'location': CONFIG.get('METRICSCONFIGURATION', 'location'), - 'extendedLocation': CONFIG.get('METRICSCONFIGURATION', 'extended_location'), - 'tags': CONFIG.get('METRICSCONFIGURATION', 'tags'), - 'collectionInterval': CONFIG.get('METRICSCONFIGURATION', 'collection_interval'), - 'enabledMetrics': CONFIG.get('METRICSCONFIGURATION', 'enabled_metrics'), - 'tagsUpdate': CONFIG.get('METRICSCONFIGURATION', 'tags_update'), - "clusterName": CONFIG.get('METRICSCONFIGURATION', 'cluster_name'), - }) + self.kwargs.update( + { + # Autogenerated resource group is not used in this scenario as it depends on the + # parent resource cluster to be present in the RG + "rg": CONFIG.get("METRICSCONFIGURATION", "resource_group"), + "location": CONFIG.get("METRICSCONFIGURATION", "location"), + "extendedLocation": CONFIG.get( + "METRICSCONFIGURATION", "extended_location" + ), + "tags": CONFIG.get("METRICSCONFIGURATION", "tags"), + "collectionInterval": CONFIG.get( + "METRICSCONFIGURATION", "collection_interval" + ), + "enabledMetrics": CONFIG.get("METRICSCONFIGURATION", "enabled_metrics"), + "tagsUpdate": CONFIG.get("METRICSCONFIGURATION", "tags_update"), + "clusterName": CONFIG.get("METRICSCONFIGURATION", "cluster_name"), + } + ) def test_metricsconfiguration_scenario1(self): - ''' test scenario for MetricsConfiguration CRUD operations''' + """test scenario for MetricsConfiguration CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_rack.py b/src/networkcloud/azext_networkcloud/tests/latest/test_rack.py index addf6d5eb82..8bd9116e4f5 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_rack.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_rack.py @@ -9,28 +9,32 @@ Rack test scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest from azure.cli.testsdk.scenario_tests import AllowLargeResponse + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test) step_list_resource_group(test, checks=[]) @@ -38,54 +42,59 @@ def call_scenario1(test): def step_show(test, checks=None): - '''Rack show operation''' + """Rack show operation""" if checks is None: checks = [] - test.cmd('az networkcloud rack show --name {name} ' - '--resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud rack show --name {name} " "--resource-group {rg}", + checks=checks, + ) def step_list_resource_group(test=None, checks=None): - '''Rack list by resource group operation''' + """Rack list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud rack list --resource-group {rg}') + test.cmd("az networkcloud rack list --resource-group {rg}") @AllowLargeResponse def step_list_subscription(test): - '''Rack list by subscription operation''' - test.cmd('az networkcloud rack list') + """Rack list by subscription operation""" + test.cmd("az networkcloud rack list") def step_update(test, checks=None): - '''Rack update operation''' + """Rack update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud rack update --name {name} ' - '--rack-location {rackLocation} ' - '--rack-serial-number {serialNumber} ' - '--tags {tagsUpdate} --resource-group {rg}') + "az networkcloud rack update --name {name} " + "--rack-location {rackLocation} " + "--rack-serial-number {serialNumber} " + "--tags {tagsUpdate} --resource-group {rg}" + ) # As Rack is a hydrated resource, it won't be provisioned in a testing rg # instead, we will use a resource created as a part of cluster deployment for testing class RackScenarioTest(ScenarioTest): - '''Rack scenario test''' + """Rack scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': CONFIG.get('RACK', 'name'), - 'location': CONFIG.get('RACK', 'location'), - 'rackLocation': CONFIG.get('RACK', 'rack_location'), - 'rg': CONFIG.get('RACK', 'resource_group'), - 'serialNumber': CONFIG.get('RACK', 'serial_number'), - 'tags': CONFIG.get('RACK', 'tags'), - 'tagsUpdate': CONFIG.get('RACK', 'tags_update'), - }) + self.kwargs.update( + { + "name": CONFIG.get("RACK", "name"), + "location": CONFIG.get("RACK", "location"), + "rackLocation": CONFIG.get("RACK", "rack_location"), + "rg": CONFIG.get("RACK", "resource_group"), + "serialNumber": CONFIG.get("RACK", "serial_number"), + "tags": CONFIG.get("RACK", "tags"), + "tagsUpdate": CONFIG.get("RACK", "tags_update"), + } + ) def test_rack_scenario1(self): - ''' test scenario for Rack read and update operations''' + """test scenario for Rack read and update operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_racksku.py b/src/networkcloud/azext_networkcloud/tests/latest/test_racksku.py index c41c67fb58d..69de97322b7 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_racksku.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_racksku.py @@ -10,21 +10,22 @@ """ from azure.cli.testsdk import ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) step_show(test, checks=None) step_list_subscription(test, checks=[]) @@ -32,28 +33,26 @@ def call_scenario1(test): def step_show(test, checks=None): - '''RackSku show operation''' + """RackSku show operation""" if checks is None: checks = [] - test.cmd('az networkcloud racksku show --name {rackskuname}') + test.cmd("az networkcloud racksku show --name {rackskuname}") def step_list_subscription(test, checks=None): - '''RackSku list by subscription operation''' + """RackSku list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud racksku list') + test.cmd("az networkcloud racksku list") class RackSkuScenarioTest(ScenarioTest): - ''' RackSku scenario test''' + """RackSku scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'rackskuname': CONFIG.get('RACKSKU', 'name') - }) + self.kwargs.update({"rackskuname": CONFIG.get("RACKSKU", "name")}) def test_racksku_scenario1(self): - ''' test scenario for RackSku operations''' + """test scenario for RackSku operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_storageappliance.py b/src/networkcloud/azext_networkcloud/tests/latest/test_storageappliance.py index 958f9435a42..cfa490e494e 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_storageappliance.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_storageappliance.py @@ -9,8 +9,9 @@ StorageAppliance tests scenarios """ +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest from azure.cli.testsdk.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer + from .config import CONFIG diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_trunkednetwork.py b/src/networkcloud/azext_networkcloud/tests/latest/test_trunkednetwork.py index 89143177463..3f9ff7bceb3 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_trunkednetwork.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_trunkednetwork.py @@ -9,31 +9,38 @@ TrunkedNetwork tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test, checks=[]) step_list_resource_group(test, checks=[]) @@ -42,72 +49,82 @@ def call_scenario1(test): def step_create(test, checks=None): - '''TrunkedNetwork create operation''' + """TrunkedNetwork create operation""" if checks is None: checks = [] - test.cmd('az networkcloud trunkednetwork create --name {name} --extended-location ' - ' name={extendedLocation} type="CustomLocation" --location {location} ' - '--interface-name "{interfaceName}" ' - '--isolation-domain-ids {isolationDomainIds} --vlans {vlans} ' - '--tags {tags} --resource-group {rg} --debug', checks=checks) + test.cmd( + "az networkcloud trunkednetwork create --name {name} --extended-location " + ' name={extendedLocation} type="CustomLocation" --location {location} ' + '--interface-name "{interfaceName}" ' + "--isolation-domain-ids {isolationDomainIds} --vlans {vlans} " + "--tags {tags} --resource-group {rg} --debug", + checks=checks, + ) def step_show(test, checks=None): - '''TrunkedNetwork show operation''' + """TrunkedNetwork show operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud trunkednetwork show --name {name} --resource-group {rg}') + test.cmd("az networkcloud trunkednetwork show --name {name} --resource-group {rg}") def step_delete(test, checks=None): - '''TrunkedNetwork delete operation''' + """TrunkedNetwork delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud trunkednetwork delete --name {name} --resource-group {rg} -y') + "az networkcloud trunkednetwork delete --name {name} --resource-group {rg} -y" + ) def step_list_resource_group(test, checks=None): - '''TrunkedNetwork list by resource group operation''' + """TrunkedNetwork list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud trunkednetwork list --resource-group {rg}') + test.cmd("az networkcloud trunkednetwork list --resource-group {rg}") def step_list_subscription(test, checks=None): - '''TrunkedNetwork list by subscription operation''' + """TrunkedNetwork list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud trunkednetwork list') + test.cmd("az networkcloud trunkednetwork list") def step_update(test, checks=None): - '''TrunkedNetwork update operation''' + """TrunkedNetwork update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud trunkednetwork update --name {name} --tags {tagsUpdate} --resource-group {rg}') + "az networkcloud trunkednetwork update --name {name} --tags {tagsUpdate} --resource-group {rg}" + ) class TrunkedNetworkScenarioTest(ScenarioTest): - '''TrunkedNetwork scenario test''' + """TrunkedNetwork scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-trunkednw-", length=24), - 'location': CONFIG.get('TRUNKED_NETWORK', 'location'), - 'extendedLocation': CONFIG.get('TRUNKED_NETWORK', 'extended_location'), - 'tags': CONFIG.get('TRUNKED_NETWORK', 'tags'), - 'tagsUpdate': CONFIG.get('TRUNKED_NETWORK', 'tags_update'), - "type": CONFIG.get('TRUNKED_NETWORK', 'type'), - 'vlans': CONFIG.get('TRUNKED_NETWORK', 'vlans'), - "interfaceName": CONFIG.get('TRUNKED_NETWORK', 'interface_name'), - "isolationDomainIds": CONFIG.get('TRUNKED_NETWORK', 'isolation_domain_ids'), - }) - - @ResourceGroupPreparer(name_prefix='clitest_rg'[:7], key='rg', parameter_name='rg') + self.kwargs.update( + { + "name": self.create_random_name( + prefix="cli-test-trunkednw-", length=24 + ), + "location": CONFIG.get("TRUNKED_NETWORK", "location"), + "extendedLocation": CONFIG.get("TRUNKED_NETWORK", "extended_location"), + "tags": CONFIG.get("TRUNKED_NETWORK", "tags"), + "tagsUpdate": CONFIG.get("TRUNKED_NETWORK", "tags_update"), + "type": CONFIG.get("TRUNKED_NETWORK", "type"), + "vlans": CONFIG.get("TRUNKED_NETWORK", "vlans"), + "interfaceName": CONFIG.get("TRUNKED_NETWORK", "interface_name"), + "isolationDomainIds": CONFIG.get( + "TRUNKED_NETWORK", "isolation_domain_ids" + ), + } + ) + + @ResourceGroupPreparer(name_prefix="clitest_rg"[:7], key="rg", parameter_name="rg") def test_trunkednetwork_scenario1(self): - '''test scenario for TrunkedNetwork CRUD operations''' + """test scenario for TrunkedNetwork CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachine.py b/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachine.py index 3b21c320af6..2aab921f589 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachine.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachine.py @@ -9,32 +9,39 @@ VirtualMachine tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest from azure.cli.testsdk.scenario_tests import AllowLargeResponse + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) - step_create(test, checks=[ - test.check('name', '{name}'), - test.check('provisioningState', 'Succeeded') - ]) - step_update(test, checks=[ - test.check('tags', '{tagsUpdate}'), - test.check('provisioningState', 'Succeeded') - ]) + step_create( + test, + checks=[ + test.check("name", "{name}"), + test.check("provisioningState", "Succeeded"), + ], + ) + step_update( + test, + checks=[ + test.check("tags", "{tagsUpdate}"), + test.check("provisioningState", "Succeeded"), + ], + ) step_show(test, checks=[]) step_list_subscription(test, checks=[]) step_list_resource_group(test, checks=[]) @@ -47,129 +54,143 @@ def call_scenario1(test): def step_create(test, checks=None): - '''VirtualMachine create operation''' + """VirtualMachine create operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine create --name {name} --extended-location ' - 'name={extendedLocation} type="CustomLocation" --location {location} ' - '--admin-username {adminUserName} --boot-method {bootMethod} ' - '--cloud-services-network-attachment attached-network-id={attachedNetworkID} ' - '--cpu-cores {cpuCores} ' - '--memory-size {memorySize} --network-attachments {networkAttachments} ' - '--network-data {networkData} --placement-hints {placementHints} ' - '--ssh-key-values {sshKeyValues} --storage-profile disk-size={diskSize} create-option={createOpt} ' - ' delete-option={deleteOpt} --tags {tags} ' - '--user-data {userData} --vm-device-model {vmDeviceModel} ' - '--vm-image {vmName} --vm-image-repository-credentials password={password} ' - 'registry-url={registryURL} username={userName} --resource-group {rg}', checks=checks) + test.cmd( + "az networkcloud virtualmachine create --name {name} --extended-location " + 'name={extendedLocation} type="CustomLocation" --location {location} ' + "--admin-username {adminUserName} --boot-method {bootMethod} " + "--cloud-services-network-attachment attached-network-id={attachedNetworkID} " + "--cpu-cores {cpuCores} " + "--memory-size {memorySize} --network-attachments {networkAttachments} " + "--network-data {networkData} --placement-hints {placementHints} " + "--ssh-key-values {sshKeyValues} --storage-profile disk-size={diskSize} create-option={createOpt} " + " delete-option={deleteOpt} --tags {tags} " + "--user-data {userData} --vm-device-model {vmDeviceModel} " + "--vm-image {vmName} --vm-image-repository-credentials password={password} " + "registry-url={registryURL} username={userName} --resource-group {rg}", + checks=checks, + ) def step_show(test, checks=None): - '''VirtualMachine show operation''' + """VirtualMachine show operation""" if checks is None: checks = [] - test.cmd( - 'az networkcloud virtualmachine show --name {name} --resource-group {rg}') + test.cmd("az networkcloud virtualmachine show --name {name} --resource-group {rg}") def step_reimage(test, checks=None): - '''VirtualMachine reimage operation''' + """VirtualMachine reimage operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud virtualmachine reimage --name {name} --resource-group {rg} ') + "az networkcloud virtualmachine reimage --name {name} --resource-group {rg} " + ) def step_restart(test, checks=None): - '''VirtualMachine restart operation''' + """VirtualMachine restart operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud virtualmachine restart --name {name} --resource-group {rg} ') + "az networkcloud virtualmachine restart --name {name} --resource-group {rg} " + ) def step_power_off(test, checks=None): - '''VirtualMachine power off operation''' + """VirtualMachine power off operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud virtualmachine power-off --name {name} --resource-group {rg} ' - '--skip-shutdown "True"') + "az networkcloud virtualmachine power-off --name {name} --resource-group {rg} " + '--skip-shutdown "True"' + ) def step_start(test, checks=None): - '''VirtualMachine start operation''' + """VirtualMachine start operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud virtualmachine start --name {name} --resource-group {rg} ') + "az networkcloud virtualmachine start --name {name} --resource-group {rg} " + ) def step_delete(test, checks=None): - '''VirtualMachine delete operation''' + """VirtualMachine delete operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud virtualmachine delete --name {name} --resource-group {rg} -y') + "az networkcloud virtualmachine delete --name {name} --resource-group {rg} -y" + ) def step_list_resource_group(test, checks=None): - '''VirtualMachine list by resource group operation''' + """VirtualMachine list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine list --resource-group {rg}') + test.cmd("az networkcloud virtualmachine list --resource-group {rg}") def step_list_subscription(test, checks=None): - '''VirtualMachine list by subscription operation''' + """VirtualMachine list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine list') + test.cmd("az networkcloud virtualmachine list") def step_update(test, checks=None): - '''VirtualMachine update operation''' + """VirtualMachine update operation""" if checks is None: checks = [] test.cmd( - 'az networkcloud virtualmachine update --name {name} ' - '--vm-image-repository-credentials password={password} registry-url={registryURL} username={userName} ' - '--tags {tagsUpdate} --resource-group {rg}') + "az networkcloud virtualmachine update --name {name} " + "--vm-image-repository-credentials password={password} registry-url={registryURL} username={userName} " + "--tags {tagsUpdate} --resource-group {rg}" + ) class VirtualMachineScenarioTest(ScenarioTest): - '''VirtualMachine scenario test''' + """VirtualMachine scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cliTestVM", length=24), - 'location': CONFIG.get('VIRTUALMACHINE', 'location'), - 'extendedLocation': CONFIG.get('VIRTUALMACHINE', 'extended_location'), - 'adminUserName': CONFIG.get('VIRTUALMACHINE', 'admin_user_name'), - 'bootMethod': CONFIG.get('VIRTUALMACHINE', 'boot_method'), - 'attachedNetworkID': CONFIG.get('VIRTUALMACHINE', 'attached_network_id'), - 'cpuCores': CONFIG.get('VIRTUALMACHINE', 'cpu_cores'), - 'memorySize': CONFIG.get('VIRTUALMACHINE', 'memory_size'), - 'networkAttachments': CONFIG.get('VIRTUALMACHINE', 'network_attachments'), - 'networkData': CONFIG.get('VIRTUALMACHINE', 'network_data'), - 'placementHints': CONFIG.get('VIRTUALMACHINE', 'placement_hints'), - 'sshKeyValues': CONFIG.get('VIRTUALMACHINE', 'ssh_key_values'), - 'diskSize': CONFIG.get('VIRTUALMACHINE', 'disk_size'), - 'createOpt': CONFIG.get('VIRTUALMACHINE', 'create_opt'), - 'deleteOpt': CONFIG.get('VIRTUALMACHINE', 'delete_opt'), - 'tags': CONFIG.get('VIRTUALMACHINE', 'tags'), - 'tagsUpdate': CONFIG.get('VIRTUALMACHINE', 'tags_update'), - 'userData': CONFIG.get('VIRTUALMACHINE', 'user_data'), - 'vmDeviceModel': CONFIG.get('VIRTUALMACHINE', 'vm_device_model'), - 'vmName': CONFIG.get('VIRTUALMACHINE', 'vm_name'), - 'password': CONFIG.get('VIRTUALMACHINE', 'password'), - 'registryURL': CONFIG.get('VIRTUALMACHINE', 'registry_url'), - 'userName': CONFIG.get('VIRTUALMACHINE', 'user_name'), - }) + self.kwargs.update( + { + "name": self.create_random_name(prefix="cliTestVM", length=24), + "location": CONFIG.get("VIRTUALMACHINE", "location"), + "extendedLocation": CONFIG.get("VIRTUALMACHINE", "extended_location"), + "adminUserName": CONFIG.get("VIRTUALMACHINE", "admin_user_name"), + "bootMethod": CONFIG.get("VIRTUALMACHINE", "boot_method"), + "attachedNetworkID": CONFIG.get( + "VIRTUALMACHINE", "attached_network_id" + ), + "cpuCores": CONFIG.get("VIRTUALMACHINE", "cpu_cores"), + "memorySize": CONFIG.get("VIRTUALMACHINE", "memory_size"), + "networkAttachments": CONFIG.get( + "VIRTUALMACHINE", "network_attachments" + ), + "networkData": CONFIG.get("VIRTUALMACHINE", "network_data"), + "placementHints": CONFIG.get("VIRTUALMACHINE", "placement_hints"), + "sshKeyValues": CONFIG.get("VIRTUALMACHINE", "ssh_key_values"), + "diskSize": CONFIG.get("VIRTUALMACHINE", "disk_size"), + "createOpt": CONFIG.get("VIRTUALMACHINE", "create_opt"), + "deleteOpt": CONFIG.get("VIRTUALMACHINE", "delete_opt"), + "tags": CONFIG.get("VIRTUALMACHINE", "tags"), + "tagsUpdate": CONFIG.get("VIRTUALMACHINE", "tags_update"), + "userData": CONFIG.get("VIRTUALMACHINE", "user_data"), + "vmDeviceModel": CONFIG.get("VIRTUALMACHINE", "vm_device_model"), + "vmName": CONFIG.get("VIRTUALMACHINE", "vm_name"), + "password": CONFIG.get("VIRTUALMACHINE", "password"), + "registryURL": CONFIG.get("VIRTUALMACHINE", "registry_url"), + "userName": CONFIG.get("VIRTUALMACHINE", "user_name"), + } + ) @AllowLargeResponse() - @ResourceGroupPreparer(name_prefix='clitest_rg'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix="clitest_rg"[:7], key="rg", parameter_name="rg") def test_virtualmachine_scenario1(self): - ''' test scenario for VirtualMachine CRUD operations''' + """test scenario for VirtualMachine CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachineconsole.py b/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachineconsole.py index 3f86a4f39a9..cf710e6db90 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachineconsole.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_virtualmachineconsole.py @@ -9,22 +9,23 @@ VirtualMachine console tests scenarios """ -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) step_create(test, checks=[]) step_update(test, checks=[]) @@ -35,71 +36,89 @@ def call_scenario1(test): def step_create(test, checks=None): - '''VirtualMachine console create operation''' + """VirtualMachine console create operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine console create ' - '--extended-location name={extendedLocation} type="CustomLocation" --location {location} ' - '--enabled {enabled} --expiration {expiration} --tags {tags} ' - '--ssh-public-key {sshPublicKey} --resource-group {resourceGroup} ' - '--virtual-machine-name {virtualMachineName}', - checks=checks) + test.cmd( + "az networkcloud virtualmachine console create " + '--extended-location name={extendedLocation} type="CustomLocation" --location {location} ' + "--enabled {enabled} --expiration {expiration} --tags {tags} " + "--ssh-public-key {sshPublicKey} --resource-group {resourceGroup} " + "--virtual-machine-name {virtualMachineName}", + checks=checks, + ) def step_update(test, checks=None): - '''VirtualMachine console update operation''' + """VirtualMachine console update operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine console update ' - '--enabled {enabled} --expiration {newExpiration} ' - '--ssh-public-key {sshPublicKey} --tags {tagsUpdate} ' - '--resource-group {resourceGroup} --virtual-machine-name {virtualMachineName}', - checks=checks) + test.cmd( + "az networkcloud virtualmachine console update " + "--enabled {enabled} --expiration {newExpiration} " + "--ssh-public-key {sshPublicKey} --tags {tagsUpdate} " + "--resource-group {resourceGroup} --virtual-machine-name {virtualMachineName}", + checks=checks, + ) def step_show(test, checks=None): - '''VirtualMachine console show operation''' + """VirtualMachine console show operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine console show ' - '--resource-group {resourceGroup} --virtual-machine-name {virtualMachineName}', - checks=checks) + test.cmd( + "az networkcloud virtualmachine console show " + "--resource-group {resourceGroup} --virtual-machine-name {virtualMachineName}", + checks=checks, + ) def step_list(test, checks=None): - '''VirtualMachine console list operation''' + """VirtualMachine console list operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine console list ' - '--resource-group {resourceGroup} --virtual-machine-name {virtualMachineName}', checks=checks) + test.cmd( + "az networkcloud virtualmachine console list " + "--resource-group {resourceGroup} --virtual-machine-name {virtualMachineName}", + checks=checks, + ) def step_delete(test, checks=None): - '''VirtualMachine console delete operation''' + """VirtualMachine console delete operation""" if checks is None: checks = [] - test.cmd('az networkcloud virtualmachine console delete --resource-group {resourceGroup} ' - '--virtual-machine-name {virtualMachineName} --yes', checks=checks) + test.cmd( + "az networkcloud virtualmachine console delete --resource-group {resourceGroup} " + "--virtual-machine-name {virtualMachineName} --yes", + checks=checks, + ) class VirtualMachineConsoleScenarioTest(ScenarioTest): - '''VirtualMachine console scenario test''' + """VirtualMachine console scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'location': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'location'), - 'extendedLocation': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'extended_location'), - 'resourceGroup': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'resource_group'), - 'tags': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'tags'), - 'tagsUpdate': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'tags_update'), - 'enabled': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'enabled'), - 'expiration': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'expiration'), - 'newExpiration': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'new_expiration'), - 'sshPublicKey': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'ssh_public_key'), - 'virtualMachineName': CONFIG.get('VIRTUALMACHINE_CONSOLE', 'virtual_machine_name'), - }) + self.kwargs.update( + { + "location": CONFIG.get("VIRTUALMACHINE_CONSOLE", "location"), + "extendedLocation": CONFIG.get( + "VIRTUALMACHINE_CONSOLE", "extended_location" + ), + "resourceGroup": CONFIG.get("VIRTUALMACHINE_CONSOLE", "resource_group"), + "tags": CONFIG.get("VIRTUALMACHINE_CONSOLE", "tags"), + "tagsUpdate": CONFIG.get("VIRTUALMACHINE_CONSOLE", "tags_update"), + "enabled": CONFIG.get("VIRTUALMACHINE_CONSOLE", "enabled"), + "expiration": CONFIG.get("VIRTUALMACHINE_CONSOLE", "expiration"), + "newExpiration": CONFIG.get("VIRTUALMACHINE_CONSOLE", "new_expiration"), + "sshPublicKey": CONFIG.get("VIRTUALMACHINE_CONSOLE", "ssh_public_key"), + "virtualMachineName": CONFIG.get( + "VIRTUALMACHINE_CONSOLE", "virtual_machine_name" + ), + } + ) def test_virtualmachineconsole_scenario1(self): - ''' test scenario for VirtualMachine console CRUD operations''' + """test scenario for VirtualMachine console CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/latest/test_volumes.py b/src/networkcloud/azext_networkcloud/tests/latest/test_volumes.py index 431935ce327..59f08092079 100644 --- a/src/networkcloud/azext_networkcloud/tests/latest/test_volumes.py +++ b/src/networkcloud/azext_networkcloud/tests/latest/test_volumes.py @@ -10,21 +10,22 @@ """ from azure.cli.testsdk import ScenarioTest + from .config import CONFIG def setup_scenario1(test): - ''' Env setup_scenario1 ''' + """Env setup_scenario1""" pass def cleanup_scenario1(test): - '''Env cleanup_scenario1 ''' + """Env cleanup_scenario1""" pass def call_scenario1(test): - ''' # Testcase: scenario1''' + """# Testcase: scenario1""" setup_scenario1(test) step_create(test, checks=[]) step_update(test, checks=[]) @@ -36,70 +37,80 @@ def call_scenario1(test): def step_create(test, checks=None): - '''Volume create operation''' + """Volume create operation""" if checks is None: checks = [] - test.cmd('az networkcloud volume create --resource-group {resourceGroup} ' - '--name {name} --location {location} ' - '--extended-location name={extendedLocation} type="CustomLocation" ' - '--size {size} --tags {tags}') + test.cmd( + "az networkcloud volume create --resource-group {resourceGroup} " + "--name {name} --location {location} " + '--extended-location name={extendedLocation} type="CustomLocation" ' + "--size {size} --tags {tags}" + ) def step_update(test, checks=None): - '''Volume update operation''' + """Volume update operation""" if checks is None: checks = [] - test.cmd('az networkcloud volume update --resource-group {resourceGroup} ' - '--name {name} --tags {tagsUpdate}') + test.cmd( + "az networkcloud volume update --resource-group {resourceGroup} " + "--name {name} --tags {tagsUpdate}" + ) def step_show(test, checks=None): - '''Volume show operation''' + """Volume show operation""" if checks is None: checks = [] - test.cmd('az networkcloud volume show --resource-group {resourceGroup} ' - '--name {name}', - checks=checks) + test.cmd( + "az networkcloud volume show --resource-group {resourceGroup} " "--name {name}", + checks=checks, + ) def step_list_by_resource_group(test, checks=None): - '''Volume list by resource group operation''' + """Volume list by resource group operation""" if checks is None: checks = [] - test.cmd('az networkcloud volume list --resource-group {resourceGroup}', - checks=checks) + test.cmd( + "az networkcloud volume list --resource-group {resourceGroup}", checks=checks + ) def step_list_by_subscription(test, checks=None): - '''Volume list by subscription operation''' + """Volume list by subscription operation""" if checks is None: checks = [] - test.cmd('az networkcloud volume list', checks=checks) + test.cmd("az networkcloud volume list", checks=checks) def step_delete(test, checks=None): - '''Volume delete operation''' + """Volume delete operation""" if checks is None: checks = [] - test.cmd('az networkcloud volume delete --resource-group {resourceGroup} ' - ' --name {name} -y') + test.cmd( + "az networkcloud volume delete --resource-group {resourceGroup} " + " --name {name} -y" + ) class VolumeScenarioTest(ScenarioTest): - '''Volume scenario test''' + """Volume scenario test""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.kwargs.update({ - 'name': self.create_random_name(prefix="cli-test-volume-", length=24), - 'location': CONFIG.get('VOLUME', 'location'), - 'extendedLocation': CONFIG.get('VOLUME', 'extended_location'), - 'resourceGroup': CONFIG.get('VOLUME', 'resource_group'), - 'tags': CONFIG.get('VOLUME', 'tags'), - 'tagsUpdate': CONFIG.get('VOLUME', 'tags_update'), - 'size': CONFIG.get('VOLUME', 'size'), - }) + self.kwargs.update( + { + "name": self.create_random_name(prefix="cli-test-volume-", length=24), + "location": CONFIG.get("VOLUME", "location"), + "extendedLocation": CONFIG.get("VOLUME", "extended_location"), + "resourceGroup": CONFIG.get("VOLUME", "resource_group"), + "tags": CONFIG.get("VOLUME", "tags"), + "tagsUpdate": CONFIG.get("VOLUME", "tags_update"), + "size": CONFIG.get("VOLUME", "size"), + } + ) def test_volume_scenario1(self): - ''' test scenario for volume CRUD operations''' + """test scenario for volume CRUD operations""" call_scenario1(self) diff --git a/src/networkcloud/azext_networkcloud/tests/testdata/aggregatorOrSingleRackDefinition.json b/src/networkcloud/azext_networkcloud/tests/testdata/aggregatorOrSingleRackDefinition.json index 1ffc141632b..567aa2eb062 100644 --- a/src/networkcloud/azext_networkcloud/tests/testdata/aggregatorOrSingleRackDefinition.json +++ b/src/networkcloud/azext_networkcloud/tests/testdata/aggregatorOrSingleRackDefinition.json @@ -128,4 +128,4 @@ "serialNumber": "9M56PK3" } ] -} \ No newline at end of file +} diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_baremetalmachine.py b/src/networkcloud/azext_networkcloud/tests/unit/test_baremetalmachine.py index 7beb812af2c..9711d9799a0 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_baremetalmachine.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_baremetalmachine.py @@ -12,7 +12,9 @@ from azext_networkcloud.operations.baremetalmachine._run_read_command import ( RunReadCommand, ) -from azext_networkcloud.tests.unit.test_run_command_options import RunCommandOptionsTestClass +from azext_networkcloud.tests.unit.test_run_command_options import ( + RunCommandOptionsTestClass, +) from azure.cli.core.mock import DummyCli diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_clustermetricsconfiguration.py b/src/networkcloud/azext_networkcloud/tests/unit/test_clustermetricsconfiguration.py index 0ca0aa2df44..749499dce00 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_clustermetricsconfiguration.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_clustermetricsconfiguration.py @@ -10,7 +10,11 @@ from azext_networkcloud import NetworkcloudCommandsLoader from azext_networkcloud.operations.cluster.metricsconfiguration import ( - Create, Delete, Show, Update, ClusterMetricsConfiguration + ClusterMetricsConfiguration, + Create, + Delete, + Show, + Update, ) from azure.cli.core.mock import DummyCli @@ -28,10 +32,8 @@ def test_build_arguments_schema(self): """Test that _build_arguments_schema unregisters the command.""" args_schema = mock.Mock() results_args_schema = self.cmd._build_arguments_schema(args_schema) - self.assertFalse( - results_args_schema.metrics_configuration_name._registered) - self.assertFalse( - results_args_schema.metrics_configuration_name._required) + self.assertFalse(results_args_schema.metrics_configuration_name._registered) + self.assertFalse(results_args_schema.metrics_configuration_name._required) def test_pre_operations(self): """ @@ -58,8 +60,7 @@ def test_pre_operations(self): self.cmd.ctx.args = mock.Mock() self.cmd.pre_operations() - self.assertEqual( - self.cmd.ctx.args.metrics_configuration_name, "default") + self.assertEqual(self.cmd.ctx.args.metrics_configuration_name, "default") class TestClusterMetricsConfigurationCreate( @@ -75,9 +76,7 @@ def setUp(self): """Set command to ClusterMetricsConfigurationCreate.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Create( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Create(loader=self._loader, cli_ctx=self._cli_ctx) class TestClusterMetricsConfigurationDelete( @@ -93,9 +92,7 @@ def setUp(self): """Set command to ClusterMetricsConfigurationDelete.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Delete( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Delete(loader=self._loader, cli_ctx=self._cli_ctx) class TestClusterMetricsConfigurationShow( @@ -111,9 +108,7 @@ def setUp(self): """Set command to ClusterMetricsConfigurationShow.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Show( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Show(loader=self._loader, cli_ctx=self._cli_ctx) class TestClusterMetricsConfigurationUpdate( @@ -129,6 +124,4 @@ def setUp(self): """Set command to ClusterMetricsConfigurationUpdate.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Update( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Update(loader=self._loader, cli_ctx=self._cli_ctx) diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_common_ssh.py b/src/networkcloud/azext_networkcloud/tests/unit/test_common_ssh.py index 94dc132daad..9e0b04e01f1 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_common_ssh.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_common_ssh.py @@ -9,16 +9,16 @@ from unittest import mock from azext_networkcloud.operations.common_ssh import CustomSshOptions +from azure.cli.core.azclierror import InvalidArgumentValueError from azure.cli.core.commands import AzCliCommand from azure.cli.core.mock import DummyCli from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa -from azure.cli.core.azclierror import InvalidArgumentValueError class TestCommonSsh(unittest.TestCase): - """ TestCommonSsh provides common methods to validate ssh - operations in CommonSsh like generate ssh key, read sshkey from path,etc """ + """TestCommonSsh provides common methods to validate ssh + operations in CommonSsh like generate ssh key, read sshkey from path,etc""" def validate_generate_ssh_keys(self, mock_expand_user, mock_keys): # Mock user home dir path @@ -78,8 +78,7 @@ def validate_get_ssh_keys_from_path(self, mock_isfile, mock_isdir, mock_listdir) mock_isfile.return_value = False with mock.patch("builtins.open", mock.mock_open(None, valid_key)): result = CustomSshOptions.get_ssh_keys_from_path(paths) - self.assertEqual([{"keyData": valid_key} - for _ in range(4)], result) + self.assertEqual([{"keyData": valid_key} for _ in range(4)], result) # Test that a valid dir path to invalid keys raises exception with mock.patch("builtins.open", mock.mock_open(None, invalid_key)): @@ -114,8 +113,7 @@ def validate_add_key_action(self): # pass keys wrapped in the type the code expects. Passing as a string # achieves the same result for now. Example: # values = [AAZStrType(x) for x in keys] - self.assertEqual( - expected_result, CustomSshOptions.add_ssh_key_action(keys)) + self.assertEqual(expected_result, CustomSshOptions.add_ssh_key_action(keys)) # Change a key to an invalid type and validate it raises exception keys[1] = "==== ssh-rsa invalid-key" diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_custom_arguments.py b/src/networkcloud/azext_networkcloud/tests/unit/test_custom_arguments.py new file mode 100644 index 00000000000..f25511d44cd --- /dev/null +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_custom_arguments.py @@ -0,0 +1,67 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# flake8: noqa + +import os +import unittest +from unittest import mock + +from azext_networkcloud.operations.custom_arguments import AAZFileStringArgFormat +from azure.cli.core import azclierror +from azure.cli.core.aaz import AAZArgumentsSchema, AAZObjectArg, AAZStrArg +from azure.cli.core.aaz._command_ctx import AAZCommandCtx +from azure.cli.core.mock import DummyCli +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric import rsa + + +class TestAAZFileStringArgFormat(unittest.TestCase): + @staticmethod + def format_arg(schema, data): + ctx = AAZCommandCtx(cli_ctx=DummyCli(), schema=schema, command_args=data) + ctx.format_args() + return ctx.args + + def test_ssh_key_fmt(self): + schema = AAZArgumentsSchema() + schema.ssh_public_key = AAZObjectArg( + fmt=AAZFileStringArgFormat(), nullable=True + ) + key = rsa.generate_private_key(65537, 2048) + valid_key = str( + key.public_key().public_bytes( + serialization.Encoding.OpenSSH, serialization.PublicFormat.OpenSSH + ), + "UTF-8", + ) + invalid_key = "==== ssh-rsa" + + # Empty value for ssh key + schema.ssh_public_key.key_data = AAZStrArg() + with self.assertRaises(azclierror.InvalidArgumentValueError): + self.format_arg(schema, {"ssh_public_key": {"key_data": ""}}) + + # Test invalid ssh key raises exception + with self.assertRaises(azclierror.InvalidArgumentValueError): + self.format_arg(schema, {"ssh_public_key": {"key_data": invalid_key}}) + + # Test that a path that is not a valid file raises exception + with self.assertRaises(azclierror.InvalidArgumentValueError): + self.format_arg( + schema, {"ssh_public_key": {"key_data": "/.ssh/id_rsa.pub"}} + ) + + # Valid ssh key + args = self.format_arg(schema, {"ssh_public_key": {"key_data": valid_key}}) + self.assertEqual(args.ssh_public_key.key_data, valid_key) + + # Valid ssh key path + # path = "/home/user/.ssh/id_rsa.pub" + test_file = "test_id_rsa.pub" + with open(test_file, "w") as f: + f.write(valid_key) + args = self.format_arg(schema, {"ssh_public_key": {"key_data": test_file}}) + self.assertEqual(args.ssh_public_key.key_data, valid_key) + os.remove(test_file) diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_custom_properties.py b/src/networkcloud/azext_networkcloud/tests/unit/test_custom_properties.py index a4bd1f3077c..3d8f654977d 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_custom_properties.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_custom_properties.py @@ -8,12 +8,11 @@ from unittest import mock from azext_networkcloud.operations.custom_properties import CustomActionProperties - from azure.cli.core.aaz._base import AAZUndefined class TestCustomProperties(unittest.TestCase): - """ Test CustomProperties methods """ + """Test CustomProperties methods""" def test_output(self): self.cmd = mock.Mock() @@ -33,11 +32,12 @@ def test_output(self): # Mock output head self.cmd.ctx.vars.instance.properties = mock.Mock() self.cmd.ctx.vars.instance.properties.output_head = mock.Mock() - self.cmd.ctx.vars.instance.properties.output_head.to_serialized_data = mock.Mock( - side_effect='HEADER') + self.cmd.ctx.vars.instance.properties.output_head.to_serialized_data = ( + mock.Mock(side_effect="HEADER") + ) # Validate URL download skipped when result URL not provided - with mock.patch('urllib.request.urlopen') as mock_urlopen: + with mock.patch("urllib.request.urlopen") as mock_urlopen: # Set output dir to undefined self.cmd.ctx.args.output = AAZUndefined @@ -51,10 +51,11 @@ def test_output(self): test_url = "https://aka.ms/fakeurl" self.cmd.ctx.vars.instance.properties.result_url = mock.Mock() self.cmd.ctx.vars.instance.properties.result_url.to_serialized_data = mock.Mock( - side_effect=test_url) + side_effect=test_url + ) # Validate results not downloaded when no output dir provided - with mock.patch('urllib.request.urlopen') as mock_urlopen: + with mock.patch("urllib.request.urlopen") as mock_urlopen: # Set output dir to undefined self.cmd.ctx.args.output = AAZUndefined @@ -62,13 +63,13 @@ def test_output(self): mock_urlopen.assert_not_called() # Validate exceptions handled - with mock.patch('urllib.request.urlopen') as mock_urlopen: + with mock.patch("urllib.request.urlopen") as mock_urlopen: test_output_dir = "/path/to/test/output/dir" self.cmd.ctx.args.output = mock.Mock() self.cmd.ctx.args.output.to_serialized_data.return_value = test_output_dir # Raise exception when calling tar lib - with mock.patch('tarfile.open') as tar_open: + with mock.patch("tarfile.open") as tar_open: tar_open.side_effect = Exception with self.assertRaises(Exception): CustomActionProperties()._output(self.cmd, args) diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetescluster.py b/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetescluster.py index cf28ddb0bdd..023e6ef24c0 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetescluster.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetescluster.py @@ -7,15 +7,15 @@ from unittest import mock from azext_networkcloud import NetworkcloudCommandsLoader -from azext_networkcloud.operations.kubernetescluster._create import Create -from .test_common_ssh import TestCommonSsh - from azext_networkcloud.operations.common_ssh import CustomSshOptions +from azext_networkcloud.operations.kubernetescluster._create import Create +from azure.cli.core.azclierror import InvalidArgumentValueError from azure.cli.core.commands import AzCliCommand from azure.cli.core.mock import DummyCli from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa -from azure.cli.core.azclierror import InvalidArgumentValueError + +from .test_common_ssh import TestCommonSsh class TestKubernetesClusterCreate(unittest.TestCase): @@ -45,16 +45,20 @@ def test_build_arguments_schema(self): # validate the ssh-key-values parameter exists at root and child level self.assertIsNotNone(results_args_schema.ssh_key_values) self.assertIsNotNone( - results_args_schema.control_plane_node_configuration.ssh_key_values) + results_args_schema.control_plane_node_configuration.ssh_key_values + ) self.assertIsNotNone( - results_args_schema.initial_agent_pool_configurations.Element.ssh_key_values) + results_args_schema.initial_agent_pool_configurations.Element.ssh_key_values + ) # validate registered parameters self.assertFalse(results_args_schema.ssh_public_keys._registered) self.assertFalse( - results_args_schema.initial_agent_pool_configurations.Element.ssh_public_keys._registered) + results_args_schema.initial_agent_pool_configurations.Element.ssh_public_keys._registered + ) self.assertFalse( - results_args_schema.control_plane_node_configuration.ssh_public_keys._registered) + results_args_schema.control_plane_node_configuration.ssh_public_keys._registered + ) def test_pre_operations(self): """ @@ -92,8 +96,7 @@ def test_pre_operations(self): self.cmd.pre_operations() # Validate control_plane_node_configuration is updated self.assertEqual(len(args.ssh_public_keys), 0) - self.assertEqual( - len(args.control_plane_node_configuration.ssh_public_keys), 2) + self.assertEqual(len(args.control_plane_node_configuration.ssh_public_keys), 2) for x in args.initial_agent_pool_configurations: self.assertEqual(len(x.ssh_public_keys), 0) @@ -109,8 +112,7 @@ def test_pre_operations(self): self.cmd.pre_operations() # Validate initial node configuration is updated self.assertEqual(len(args.ssh_public_keys), 0) - self.assertEqual( - len(args.control_plane_node_configuration.ssh_public_keys), 0) + self.assertEqual(len(args.control_plane_node_configuration.ssh_public_keys), 0) for x in args.initial_agent_pool_configurations: self.assertEqual(len(x.ssh_public_keys), 2) @@ -125,26 +127,25 @@ def test_pre_operations(self): self.cmd.pre_operations() self.assertEqual(len(args.ssh_public_keys), 0) - self.assertEqual( - len(args.control_plane_node_configuration.ssh_public_keys), 0) + self.assertEqual(len(args.control_plane_node_configuration.ssh_public_keys), 0) for x in args.initial_agent_pool_configurations: self.assertEqual(len(x.ssh_public_keys), 0) @mock.patch("azure.cli.core.keys.generate_ssh_keys") @mock.patch("os.path.expanduser") def test_vm_generate_ssh_keys(self, mock_expand_user, mock_keys): - """ Test KubernetesCluster generate ssh key option """ - TestCommonSsh.validate_generate_ssh_keys( - self, mock_expand_user, mock_keys) + """Test KubernetesCluster generate ssh key option""" + TestCommonSsh.validate_generate_ssh_keys(self, mock_expand_user, mock_keys) @mock.patch("os.listdir") @mock.patch("os.path.isdir") @mock.patch("os.path.isfile") def test_vm_get_ssh_keys_from_path(self, mock_isfile, mock_isdir, mock_listdir): - """ Test KubernetesCluster ssh-key-from-path parameter enabled """ + """Test KubernetesCluster ssh-key-from-path parameter enabled""" TestCommonSsh.validate_get_ssh_keys_from_path( - self, mock_isfile, mock_isdir, mock_listdir) + self, mock_isfile, mock_isdir, mock_listdir + ) def test_vm_add_key_action(self): - """ Test ssh key provided as input are correctly set in ssh-public-keys""" + """Test ssh key provided as input are correctly set in ssh-public-keys""" TestCommonSsh.validate_add_key_action(self) diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetesclusteragentpool.py b/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetesclusteragentpool.py index 845aaeaa0f7..54bd6c0b791 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetesclusteragentpool.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_kubernetesclusteragentpool.py @@ -11,6 +11,7 @@ from azure.cli.core.mock import DummyCli from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa + from .test_common_ssh import TestCommonSsh @@ -73,18 +74,18 @@ def test_pre_operations(self): @mock.patch("azure.cli.core.keys.generate_ssh_keys") @mock.patch("os.path.expanduser") def test_vm_generate_ssh_keys(self, mock_expand_user, mock_keys): - """ Test KubernetesCluster agentpool generate ssh key option""" - TestCommonSsh.validate_generate_ssh_keys( - self, mock_expand_user, mock_keys) + """Test KubernetesCluster agentpool generate ssh key option""" + TestCommonSsh.validate_generate_ssh_keys(self, mock_expand_user, mock_keys) @mock.patch("os.listdir") @mock.patch("os.path.isdir") @mock.patch("os.path.isfile") def test_vm_get_ssh_keys_from_path(self, mock_isfile, mock_isdir, mock_listdir): - """ Test KubernetesCluster agent pool ssh-key-from-path parameter enabled """ + """Test KubernetesCluster agent pool ssh-key-from-path parameter enabled""" TestCommonSsh.validate_get_ssh_keys_from_path( - self, mock_isfile, mock_isdir, mock_listdir) + self, mock_isfile, mock_isdir, mock_listdir + ) def test_vm_add_key_action(self): - """ Test ssh key provided as input are correctly set in ssh-public-keys""" + """Test ssh key provided as input are correctly set in ssh-public-keys""" TestCommonSsh.validate_add_key_action(self) diff --git a/src/networkcloud/azext_networkcloud/tests/unit/test_virtualmachine.py b/src/networkcloud/azext_networkcloud/tests/unit/test_virtualmachine.py index e6ce14ac8b0..a128e9b1c83 100644 --- a/src/networkcloud/azext_networkcloud/tests/unit/test_virtualmachine.py +++ b/src/networkcloud/azext_networkcloud/tests/unit/test_virtualmachine.py @@ -7,13 +7,19 @@ from unittest import mock from azext_networkcloud import NetworkcloudCommandsLoader +from azext_networkcloud.operations.custom_arguments import AAZFileStringArgFormat from azext_networkcloud.operations.virtualmachine.console import ( - Create, Delete, Show, Update, VirtualMachineConsole + Create, + Delete, + Show, + Update, + VirtualMachineConsole, ) -from .test_common_ssh import TestCommonSsh from azure.cli.core.commands import AzCliCommand from azure.cli.core.mock import DummyCli +from .test_common_ssh import TestCommonSsh + class TestVirtualMachineConsole(unittest.TestCase): """ @@ -72,9 +78,18 @@ def setUp(self): """Set command to VirtualMachineConsoleCreate.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Create( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Create(loader=self._loader, cli_ctx=self._cli_ctx) + + def test_build_arguments_schema(self): + """ + Test that build_arguments_schema changes the ssh_public_key argument format + """ + # Mock CLI args + self.cmd.ctx = mock.Mock() + self.cmd.ctx.args = mock.Mock() + + result_args = self.cmd._build_arguments_schema() + self.assertIsInstance(result_args.ssh_public_key._fmt, AAZFileStringArgFormat) class TestVirtualMachineConsoleDelete( @@ -90,9 +105,7 @@ def setUp(self): """Set command to VirtualMachineConsoleDelete.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Delete( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Delete(loader=self._loader, cli_ctx=self._cli_ctx) class TestVirtualMachineConsoleShow( @@ -124,9 +137,18 @@ def setUp(self): """Set command to VirtualMachineConsoleUpdate.""" self._cli_ctx = DummyCli() self._loader = NetworkcloudCommandsLoader(cli_ctx=self._cli_ctx) - self.cmd = Update( - loader=self._loader, cli_ctx=self._cli_ctx - ) + self.cmd = Update(loader=self._loader, cli_ctx=self._cli_ctx) + + def test_build_arguments_schema(self): + """ + Test that build_arguments_schema changes the ssh_public_key argument format + """ + # Mock CLI args + self.cmd.ctx = mock.Mock() + self.cmd.ctx.args = mock.Mock() + + result_args = self.cmd._build_arguments_schema() + self.assertIsInstance(result_args.ssh_public_key._fmt, AAZFileStringArgFormat) class TestVirtualMachineCreate(unittest.TestCase): @@ -138,15 +160,15 @@ def setUp(self): @mock.patch("azure.cli.core.keys.generate_ssh_keys") @mock.patch("os.path.expanduser") def test_vm_generate_ssh_keys(self, mock_expand_user, mock_keys): - TestCommonSsh.validate_generate_ssh_keys( - self, mock_expand_user, mock_keys) + TestCommonSsh.validate_generate_ssh_keys(self, mock_expand_user, mock_keys) @mock.patch("os.listdir") @mock.patch("os.path.isdir") @mock.patch("os.path.isfile") def test_get_ssh_keys_from_path(self, mock_isfile, mock_isdir, mock_listdir): TestCommonSsh.validate_get_ssh_keys_from_path( - self, mock_isfile, mock_isdir, mock_listdir) + self, mock_isfile, mock_isdir, mock_listdir + ) def test_add_key_action(self): TestCommonSsh.validate_add_key_action(self) diff --git a/src/networkcloud/setup.py b/src/networkcloud/setup.py index b7e892c1018..051fbbf0374 100644 --- a/src/networkcloud/setup.py +++ b/src/networkcloud/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0b1' +VERSION = '1.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers