From 97dfa246ad69026ab9708a013a4ed2dc8c872471 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Tue, 5 Sep 2023 17:58:48 -0500 Subject: [PATCH 01/21] Add stack-hci-vm --- src/index.json | 45 + src/stack-hci-vm/HISTORY.rst | 8 + src/stack-hci-vm/README.md | 135 +++ .../azext_stack_hci_vm/__init__.py | 42 + src/stack-hci-vm/azext_stack_hci_vm/_help.py | 11 + .../azext_stack_hci_vm/_params.py | 13 + .../azext_stack_hci_vm/aaz/__init__.py | 6 + .../azext_stack_hci_vm/aaz/latest/__init__.py | 6 + .../aaz/latest/stack_hci/__cmd_group.py | 23 + .../aaz/latest/stack_hci/__init__.py | 11 + .../stack_hci/arc_setting/__cmd_group.py | 23 + .../latest/stack_hci/arc_setting/__init__.py | 21 + .../_consent_and_install_default_extension.py | 276 ++++++ .../latest/stack_hci/arc_setting/_create.py | 341 +++++++ .../stack_hci/arc_setting/_create_identity.py | 208 ++++ .../latest/stack_hci/arc_setting/_delete.py | 173 ++++ .../arc_setting/_generate_password.py | 188 ++++ .../arc_setting/_initialize_disable_proces.py | 160 ++++ .../aaz/latest/stack_hci/arc_setting/_list.py | 277 ++++++ .../aaz/latest/stack_hci/arc_setting/_show.py | 276 ++++++ .../latest/stack_hci/arc_setting/_update.py | 459 +++++++++ .../aaz/latest/stack_hci/arc_setting/_wait.py | 272 ++++++ .../latest/stack_hci/cluster/__cmd_group.py | 23 + .../aaz/latest/stack_hci/cluster/__init__.py | 19 + .../aaz/latest/stack_hci/cluster/_create.py | 554 +++++++++++ .../stack_hci/cluster/_create_identity.py | 198 ++++ .../aaz/latest/stack_hci/cluster/_delete.py | 163 ++++ .../_extend_software_assurance_benefit.py | 468 +++++++++ .../aaz/latest/stack_hci/cluster/_list.py | 775 +++++++++++++++ .../aaz/latest/stack_hci/cluster/_show.py | 423 +++++++++ .../aaz/latest/stack_hci/cluster/_update.py | 657 +++++++++++++ .../aaz/latest/stack_hci/cluster/_wait.py | 419 ++++++++ .../stack_hci/cluster/identity/__cmd_group.py | 23 + .../stack_hci/cluster/identity/__init__.py | 13 + .../stack_hci/cluster/identity/_assign.py | 605 ++++++++++++ .../stack_hci/cluster/identity/_remove.py | 607 ++++++++++++ .../latest/stack_hci/extension/__cmd_group.py | 23 + .../latest/stack_hci/extension/__init__.py | 16 + .../aaz/latest/stack_hci/extension/_create.py | 389 ++++++++ .../aaz/latest/stack_hci/extension/_delete.py | 183 ++++ .../aaz/latest/stack_hci/extension/_list.py | 302 ++++++ .../aaz/latest/stack_hci/extension/_show.py | 300 ++++++ .../aaz/latest/stack_hci/extension/_wait.py | 296 ++++++ .../azext_stack_hci_vm/azext_metadata.json | 3 + .../azext_stack_hci_vm/commands.py | 21 + src/stack-hci-vm/azext_stack_hci_vm/custom.py | 77 ++ .../azext_stack_hci_vm/tests/__init__.py | 116 +++ .../tests/latest/__init__.py | 12 + .../test_stack_hci_arc_setting_crud.yaml | 771 +++++++++++++++ .../test_stack_hci_cluster_crud.yaml | 894 ++++++++++++++++++ .../test_stack_hci_cluster_identity.yaml | 544 +++++++++++ .../test_stack_hci_extension_crud.yaml | 481 ++++++++++ .../tests/latest/test_stack_hci_commands.py | 141 +++ src/stack-hci-vm/linter_exclusions.yml | 15 + src/stack-hci-vm/setup.cfg | 1 + src/stack-hci-vm/setup.py | 58 ++ 56 files changed, 12564 insertions(+) create mode 100644 src/stack-hci-vm/HISTORY.rst create mode 100644 src/stack-hci-vm/README.md create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/_help.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/_params.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/commands.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/custom.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py create mode 100644 src/stack-hci-vm/linter_exclusions.yml create mode 100644 src/stack-hci-vm/setup.cfg create mode 100644 src/stack-hci-vm/setup.py diff --git a/src/index.json b/src/index.json index 9163f429566..cd85dff35d2 100644 --- a/src/index.json +++ b/src/index.json @@ -56400,6 +56400,51 @@ "sha256Digest": "58074ff73a72a1a9c76d406a4b6988a7b714dfaa9259b92172a7b6f66680db31" } ], + "stack-hci-vm": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/stack_hci_vm-0.1.2-py3-none-any.whl", + "filename": "stack_hci_vm-0.1.2-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "stack-hci", + "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", + "version": "0.1.2" + }, + "sha256Digest": "3A72672F48FCC2765A6B21FCC7282B2801AC4D68ABF0F303815CDDB8095C9E7B" + } + ], "staticwebapp": [ { "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/staticwebapp-1.0.0-py3-none-any.whl", diff --git a/src/stack-hci-vm/HISTORY.rst b/src/stack-hci-vm/HISTORY.rst new file mode 100644 index 00000000000..1cb3d46bf79 --- /dev/null +++ b/src/stack-hci-vm/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.2 +++++++ +* Initial release. diff --git a/src/stack-hci-vm/README.md b/src/stack-hci-vm/README.md new file mode 100644 index 00000000000..1be0316c961 --- /dev/null +++ b/src/stack-hci-vm/README.md @@ -0,0 +1,135 @@ +# Azure CLI stack-hci-vm Extension + +This is the extension for stack-hci-vm + +### How to use + +Install this extension using the below CLI command + +``` +az extension add --name stack-hci-vm +``` + +### Included Features + +#### stack-hci-vm arc-setting + +##### Create + +``` +az stack-hci-vm arc-setting create --name "default" --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### Show + +``` +az stack-hci-vm arc-setting show --name "default" --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### List + +``` +az stack-hci-vm arc-setting list --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### Update + +``` +az stack-hci-vm arc-setting update --connectivity-properties "{\\"enabled\\":true}" --name "default" \ + --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### Create-identity + +``` +az stack-hci-vm arc-setting create-identity --name "default" --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### Generate-password + +``` +az stack-hci-vm arc-setting generate-password --name "default" --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### Delete + +``` +az stack-hci-vm arc-setting delete --name "default" --cluster-name "myCluster" --resource-group "test-rg" +``` + +#### stack-hci-vm cluster + +##### Create + +``` +az stack-hci-vm cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" \ + --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" \ + --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" --name "myCluster" \ + --resource-group "test-rg" +``` + +##### Show + +``` +az stack-hci-vm cluster show --name "myCluster" --resource-group "test-rg" +``` + +##### List + +``` +az stack-hci-vm cluster list --resource-group "test-rg" +``` + +##### Update + +``` +az stack-hci-vm cluster update --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" \ + --desired-properties diagnostic-level="Basic" windows-server-subscription="Enabled" \ + --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group "test-rg" +``` + +##### Create-identity + +``` +az stack-hci-vm cluster create-identity --name "myCluster" --resource-group "test-rg" +``` + +##### Delete + +``` +az stack-hci-vm cluster delete --name "myCluster" --resource-group "test-rg" +``` + +#### stack-hci-vm extension + +##### Create + +``` +az stack-hci-vm extension create --arc-setting-name "default" --cluster-name "myCluster" \ + --type "MicrosoftMonitoringAgent" --protected-settings "{\\"workspaceKey\\":\\"xx\\"}" \ + --publisher "Microsoft.Compute" --settings "{\\"workspaceId\\":\\"xx\\"}" --type-handler-version "1.10" \ + --name "MicrosoftMonitoringAgent" --resource-group "test-rg" + +az stack-hci-vm extension wait --created --arc-setting-name "{myArcSetting}" --cluster-name "{myCluster}" \ + --name "{myExtension}" --resource-group "{rg}" +``` + +##### Show + +``` +az stack-hci-vm extension show --arc-setting-name "default" --cluster-name "myCluster" --name "MicrosoftMonitoringAgent" \ + --resource-group "test-rg" +``` + +##### List + +``` +az stack-hci-vm extension list --arc-setting-name "default" --cluster-name "myCluster" --resource-group "test-rg" +``` + +##### Delete + +``` +az stack-hci-vm extension delete --arc-setting-name "default" --cluster-name "myCluster" \ + --name "MicrosoftMonitoringAgent" --resource-group "test-rg" +``` diff --git a/src/stack-hci-vm/azext_stack_hci_vm/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/__init__.py new file mode 100644 index 00000000000..d2ef95e351a --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_stack_hci._help import helps # pylint: disable=unused-import + + +class AzureStackHCICommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_stack_hci.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_stack_hci.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_stack_hci._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = AzureStackHCICommandsLoader diff --git a/src/stack-hci-vm/azext_stack_hci_vm/_help.py b/src/stack-hci-vm/azext_stack_hci_vm/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/_help.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/stack-hci-vm/azext_stack_hci_vm/_params.py b/src/stack-hci-vm/azext_stack_hci_vm/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py new file mode 100644 index 00000000000..077d618e907 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "stack-hci-vm", +) +class __CMDGroup(AAZCommandGroup): + """Manage Azure Stack HCI. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py new file mode 100644 index 00000000000..5a9d61963d6 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py new file mode 100644 index 00000000000..32f08cc4deb --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "stack-hci-vm arc-setting", +) +class __CMDGroup(AAZCommandGroup): + """Manage arc setting with stack hci. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py new file mode 100644 index 00000000000..57c54ad53e5 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._consent_and_install_default_extension import * +from ._create import * +from ._create_identity import * +from ._delete import * +from ._generate_password import * +from ._initialize_disable_proces import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py new file mode 100644 index 00000000000..61622ac9184 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py @@ -0,0 +1,276 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting consent-and-install-default-extension", +) +class ConsentAndInstallDefaultExtension(AAZCommand): + """Add consent time for default extensions and initiate extensions installation + + :example: Consent and install default extension + az stack-hci-vm arc-setting consent-and-install-default-extension -g rg --arc-setting-name default --cluster-name name + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/consentandinstalldefaultextensions", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsConsentAndInstallDefaultExtensions(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ArcSettingsConsentAndInstallDefaultExtensions(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_instance_resource_group = AAZStrType( + serialized_name="arcInstanceResourceGroup", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + properties.connectivity_properties = AAZObjectType( + serialized_name="connectivityProperties", + ) + properties.default_extensions = AAZListType( + serialized_name="defaultExtensions", + flags={"read_only": True}, + ) + properties.per_node_details = AAZListType( + serialized_name="perNodeDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + connectivity_properties = cls._schema_on_200.properties.connectivity_properties + connectivity_properties.enabled = AAZBoolType() + + default_extensions = cls._schema_on_200.properties.default_extensions + default_extensions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.default_extensions.Element + _element.category = AAZStrType( + flags={"read_only": True}, + ) + _element.consent_time = AAZStrType( + serialized_name="consentTime", + flags={"read_only": True}, + ) + + per_node_details = cls._schema_on_200.properties.per_node_details + per_node_details.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.per_node_details.Element + _element.arc_instance = AAZStrType( + serialized_name="arcInstance", + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ConsentAndInstallDefaultExtensionHelper: + """Helper class for ConsentAndInstallDefaultExtension""" + + +__all__ = ["ConsentAndInstallDefaultExtension"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py new file mode 100644 index 00000000000..35010669d62 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py @@ -0,0 +1,341 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting create", +) +class Create(AAZCommand): + """Create arc setting for HCI cluster. + + :example: Create arc setting + az stack-hci-vm arc-setting create --name "default" --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.arc_application_client_id = AAZStrArg( + options=["--arc-application-client-id"], + arg_group="Properties", + help="App id of arc AAD identity.", + ) + _args_schema.arc_application_object_id = AAZStrArg( + options=["--arc-application-object-id"], + arg_group="Properties", + help="Object id of arc AAD identity.", + ) + _args_schema.arc_application_tenant_id = AAZStrArg( + options=["--arc-application-tenant-id"], + arg_group="Properties", + help="Tenant id of arc AAD identity.", + ) + _args_schema.arc_instance_rg = AAZStrArg( + options=["--arc-instance-rg"], + arg_group="Properties", + help="The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources.", + ) + _args_schema.arc_service_principal_object_id = AAZStrArg( + options=["--arc-service-principal-object-id"], + arg_group="Properties", + help="Object id of arc AAD service principal.", + ) + _args_schema.connectivity_properties = AAZObjectArg( + options=["--connectivity-properties"], + arg_group="Properties", + help="contains connectivity related configuration for ARC resources", + ) + + connectivity_properties = cls._args_schema.connectivity_properties + connectivity_properties.enabled = AAZBoolArg( + options=["enabled"], + help="True indicates ARC connectivity is enabled", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ArcSettingsCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("arcApplicationClientId", AAZStrType, ".arc_application_client_id") + properties.set_prop("arcApplicationObjectId", AAZStrType, ".arc_application_object_id") + properties.set_prop("arcApplicationTenantId", AAZStrType, ".arc_application_tenant_id") + properties.set_prop("arcInstanceResourceGroup", AAZStrType, ".arc_instance_rg") + properties.set_prop("arcServicePrincipalObjectId", AAZStrType, ".arc_service_principal_object_id") + properties.set_prop("connectivityProperties", AAZObjectType, ".connectivity_properties") + + connectivity_properties = _builder.get(".properties.connectivityProperties") + if connectivity_properties is not None: + connectivity_properties.set_prop("enabled", AAZBoolType, ".enabled") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_instance_resource_group = AAZStrType( + serialized_name="arcInstanceResourceGroup", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + properties.connectivity_properties = AAZObjectType( + serialized_name="connectivityProperties", + ) + properties.default_extensions = AAZListType( + serialized_name="defaultExtensions", + flags={"read_only": True}, + ) + properties.per_node_details = AAZListType( + serialized_name="perNodeDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + connectivity_properties = cls._schema_on_200.properties.connectivity_properties + connectivity_properties.enabled = AAZBoolType() + + default_extensions = cls._schema_on_200.properties.default_extensions + default_extensions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.default_extensions.Element + _element.category = AAZStrType( + flags={"read_only": True}, + ) + _element.consent_time = AAZStrType( + serialized_name="consentTime", + flags={"read_only": True}, + ) + + per_node_details = cls._schema_on_200.properties.per_node_details + per_node_details.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.per_node_details.Element + _element.arc_instance = AAZStrType( + serialized_name="arcInstance", + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py new file mode 100644 index 00000000000..34fff9d77d3 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py @@ -0,0 +1,208 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting create-identity", +) +class CreateIdentity(AAZCommand): + """Create AAD identity for arc settings. + + :example: Create arc identity + az stack-hci-vm arc-setting create-identity --name "default" --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/createarcidentity", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ArcSettingsCreateIdentity(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ArcSettingsCreateIdentity(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True, "read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + + return cls._schema_on_200 + + +class _CreateIdentityHelper: + """Helper class for CreateIdentity""" + + +__all__ = ["CreateIdentity"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py new file mode 100644 index 00000000000..7375ce04a8a --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py @@ -0,0 +1,173 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete arc setting resource details of HCI cluster. + + :example: Delete arc setting + az stack-hci-vm arc-setting delete --name "default" --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ArcSettingsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ArcSettingsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py new file mode 100644 index 00000000000..eeef6ef91c7 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py @@ -0,0 +1,188 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting generate-password", +) +class GeneratePassword(AAZCommand): + """Generate password for arc settings. + + :example: Generate password + az stack-hci-vm arc-setting generate-password --name "default" --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/generatepassword", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsGeneratePassword(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ArcSettingsGeneratePassword(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType( + flags={"read_only": True}, + ) + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.end_date_time = AAZStrType( + serialized_name="endDateTime", + ) + _schema_on_200.key_id = AAZStrType( + serialized_name="keyId", + ) + _schema_on_200.secret_text = AAZStrType( + serialized_name="secretText", + ) + _schema_on_200.start_date_time = AAZStrType( + serialized_name="startDateTime", + ) + + return cls._schema_on_200 + + +class _GeneratePasswordHelper: + """Helper class for GeneratePassword""" + + +__all__ = ["GeneratePassword"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py new file mode 100644 index 00000000000..eab9ffbe990 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py @@ -0,0 +1,160 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting initialize-disable-proces", +) +class InitializeDisableProces(AAZCommand): + """Initialize ARC Disable process on the cluster + + :example: Initialize disable proces + az stack-hci-vm arc-setting initialize-disable-proces -g rg --arc-setting-name default --cluster-name name + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/initializedisableprocess", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ArcSettingsInitializeDisableProcess(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ArcSettingsInitializeDisableProcess(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + +class _InitializeDisableProcesHelper: + """Helper class for InitializeDisableProces""" + + +__all__ = ["InitializeDisableProces"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py new file mode 100644 index 00000000000..2bc4e4408fa --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py @@ -0,0 +1,277 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting list", +) +class List(AAZCommand): + """List arc setting resources of HCI cluster. + + :example: List arc setting resources by HCI cluster + az stack-hci-vm arc-setting list --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsListByCluster(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class ArcSettingsListByCluster(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType( + flags={"read_only": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_instance_resource_group = AAZStrType( + serialized_name="arcInstanceResourceGroup", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + properties.connectivity_properties = AAZObjectType( + serialized_name="connectivityProperties", + ) + properties.default_extensions = AAZListType( + serialized_name="defaultExtensions", + flags={"read_only": True}, + ) + properties.per_node_details = AAZListType( + serialized_name="perNodeDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + connectivity_properties = cls._schema_on_200.value.Element.properties.connectivity_properties + connectivity_properties.enabled = AAZBoolType() + + default_extensions = cls._schema_on_200.value.Element.properties.default_extensions + default_extensions.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.default_extensions.Element + _element.category = AAZStrType( + flags={"read_only": True}, + ) + _element.consent_time = AAZStrType( + serialized_name="consentTime", + flags={"read_only": True}, + ) + + per_node_details = cls._schema_on_200.value.Element.properties.per_node_details + per_node_details.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.per_node_details.Element + _element.arc_instance = AAZStrType( + serialized_name="arcInstance", + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py new file mode 100644 index 00000000000..5525d2ee502 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py @@ -0,0 +1,276 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting show", +) +class Show(AAZCommand): + """Get arc setting resource details of HCI cluster. + + :example: Get arc setting + az stack-hci-vm arc-setting show --name "default" --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ArcSettingsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_instance_resource_group = AAZStrType( + serialized_name="arcInstanceResourceGroup", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + properties.connectivity_properties = AAZObjectType( + serialized_name="connectivityProperties", + ) + properties.default_extensions = AAZListType( + serialized_name="defaultExtensions", + flags={"read_only": True}, + ) + properties.per_node_details = AAZListType( + serialized_name="perNodeDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + connectivity_properties = cls._schema_on_200.properties.connectivity_properties + connectivity_properties.enabled = AAZBoolType() + + default_extensions = cls._schema_on_200.properties.default_extensions + default_extensions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.default_extensions.Element + _element.category = AAZStrType( + flags={"read_only": True}, + ) + _element.consent_time = AAZStrType( + serialized_name="consentTime", + flags={"read_only": True}, + ) + + per_node_details = cls._schema_on_200.properties.per_node_details + per_node_details.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.per_node_details.Element + _element.arc_instance = AAZStrType( + serialized_name="arcInstance", + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py new file mode 100644 index 00000000000..4b626449e6b --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py @@ -0,0 +1,459 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting update", +) +class Update(AAZCommand): + """Update arc setting for HCI cluster. + + :example: Update arc setting + az stack-hci-vm arc-setting update --resource-group "test-rg" --cluster-name "myCluster" --name "default" --tags "{tag:tag}" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.connectivity_properties = AAZObjectArg( + options=["--connectivity-properties"], + arg_group="Properties", + help="contains connectivity related configuration for ARC resources", + nullable=True, + ) + + connectivity_properties = cls._args_schema.connectivity_properties + connectivity_properties.enabled = AAZBoolArg( + options=["enabled"], + help="True indicates ARC connectivity is enabled", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ArcSettingsCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ArcSettingsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_arc_setting_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ArcSettingsCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_arc_setting_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("connectivityProperties", AAZObjectType, ".connectivity_properties") + + connectivity_properties = _builder.get(".properties.connectivityProperties") + if connectivity_properties is not None: + connectivity_properties.set_prop("enabled", AAZBoolType, ".enabled") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_arc_setting_read = None + + @classmethod + def _build_schema_arc_setting_read(cls, _schema): + if cls._schema_arc_setting_read is not None: + _schema.id = cls._schema_arc_setting_read.id + _schema.name = cls._schema_arc_setting_read.name + _schema.properties = cls._schema_arc_setting_read.properties + _schema.system_data = cls._schema_arc_setting_read.system_data + _schema.type = cls._schema_arc_setting_read.type + return + + cls._schema_arc_setting_read = _schema_arc_setting_read = AAZObjectType() + + arc_setting_read = _schema_arc_setting_read + arc_setting_read.id = AAZStrType( + flags={"read_only": True}, + ) + arc_setting_read.name = AAZStrType( + flags={"read_only": True}, + ) + arc_setting_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + arc_setting_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + arc_setting_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_arc_setting_read.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_instance_resource_group = AAZStrType( + serialized_name="arcInstanceResourceGroup", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + properties.connectivity_properties = AAZObjectType( + serialized_name="connectivityProperties", + ) + properties.default_extensions = AAZListType( + serialized_name="defaultExtensions", + flags={"read_only": True}, + ) + properties.per_node_details = AAZListType( + serialized_name="perNodeDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + connectivity_properties = _schema_arc_setting_read.properties.connectivity_properties + connectivity_properties.enabled = AAZBoolType() + + default_extensions = _schema_arc_setting_read.properties.default_extensions + default_extensions.Element = AAZObjectType() + + _element = _schema_arc_setting_read.properties.default_extensions.Element + _element.category = AAZStrType( + flags={"read_only": True}, + ) + _element.consent_time = AAZStrType( + serialized_name="consentTime", + flags={"read_only": True}, + ) + + per_node_details = _schema_arc_setting_read.properties.per_node_details + per_node_details.Element = AAZObjectType() + + _element = _schema_arc_setting_read.properties.per_node_details.Element + _element.arc_instance = AAZStrType( + serialized_name="arcInstance", + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + + system_data = _schema_arc_setting_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.id = cls._schema_arc_setting_read.id + _schema.name = cls._schema_arc_setting_read.name + _schema.properties = cls._schema_arc_setting_read.properties + _schema.system_data = cls._schema_arc_setting_read.system_data + _schema.type = cls._schema_arc_setting_read.type + + +__all__ = ["Update"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py new file mode 100644 index 00000000000..58e20b3bf91 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py @@ -0,0 +1,272 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm arc-setting wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["-n", "--name", "--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ArcSettingsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class ArcSettingsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.arc_application_client_id = AAZStrType( + serialized_name="arcApplicationClientId", + ) + properties.arc_application_object_id = AAZStrType( + serialized_name="arcApplicationObjectId", + ) + properties.arc_application_tenant_id = AAZStrType( + serialized_name="arcApplicationTenantId", + ) + properties.arc_instance_resource_group = AAZStrType( + serialized_name="arcInstanceResourceGroup", + ) + properties.arc_service_principal_object_id = AAZStrType( + serialized_name="arcServicePrincipalObjectId", + ) + properties.connectivity_properties = AAZObjectType( + serialized_name="connectivityProperties", + ) + properties.default_extensions = AAZListType( + serialized_name="defaultExtensions", + flags={"read_only": True}, + ) + properties.per_node_details = AAZListType( + serialized_name="perNodeDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + connectivity_properties = cls._schema_on_200.properties.connectivity_properties + connectivity_properties.enabled = AAZBoolType() + + default_extensions = cls._schema_on_200.properties.default_extensions + default_extensions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.default_extensions.Element + _element.category = AAZStrType( + flags={"read_only": True}, + ) + _element.consent_time = AAZStrType( + serialized_name="consentTime", + flags={"read_only": True}, + ) + + per_node_details = cls._schema_on_200.properties.per_node_details + per_node_details.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.per_node_details.Element + _element.arc_instance = AAZStrType( + serialized_name="arcInstance", + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py new file mode 100644 index 00000000000..9ded5a965a0 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "stack-hci-vm cluster", +) +class __CMDGroup(AAZCommandGroup): + """Manage cluster with stack hci. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py new file mode 100644 index 00000000000..22932474eee --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._create_identity import * +from ._delete import * +from ._extend_software_assurance_benefit import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py new file mode 100644 index 00000000000..ed75a99802c --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py @@ -0,0 +1,554 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster create", +) +class Create(AAZCommand): + """Create an HCI cluster. + + :example: Create cluster + az stack-hci-vm cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" --name "myCluster" --resource- group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["-n", "--name", "--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Cluster" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="Cluster", + help="Identity of Cluster resource", + ) + _args_schema.location = AAZResourceLocationArg( + arg_group="Cluster", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Cluster", + help="Resource tags.", + ) + + identity = cls._args_schema.identity + identity.type = AAZStrArg( + options=["type"], + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + required=True, + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, + ) + identity.user_assigned_identities = AAZDictArg( + options=["user-assigned-identities"], + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + ) + + user_assigned_identities = cls._args_schema.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + blank={}, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.aad_application_object_id = AAZStrArg( + options=["--aad-application-object-id"], + arg_group="Properties", + help="Object id of cluster AAD identity.", + ) + _args_schema.aad_client_id = AAZStrArg( + options=["--aad-client-id"], + arg_group="Properties", + help="App id of cluster AAD identity.", + ) + _args_schema.aad_service_principal_object_id = AAZStrArg( + options=["--aad-service-principal-object-id"], + arg_group="Properties", + help="Id of cluster identity service principal.", + ) + _args_schema.aad_tenant_id = AAZStrArg( + options=["--aad-tenant-id"], + arg_group="Properties", + help="Tenant id of cluster AAD identity.", + ) + _args_schema.endpoint = AAZStrArg( + options=["--endpoint"], + arg_group="Properties", + help="Endpoint configured for management from the Azure portal.", + ) + _args_schema.desired_properties = AAZObjectArg( + options=["--desired-properties"], + arg_group="Properties", + help="Desired properties of the cluster.", + ) + + desired_properties = cls._args_schema.desired_properties + desired_properties.diagnostic_level = AAZStrArg( + options=["diagnostic-level"], + help="Desired level of diagnostic data emitted by the cluster.", + enum={"Basic": "Basic", "Enhanced": "Enhanced", "Off": "Off"}, + ) + desired_properties.windows_server_subscription = AAZStrArg( + options=["windows-server-subscription"], + help="Desired state of Windows Server Subscription.", + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ClustersCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ClustersCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("identity", AAZObjectType, ".identity") + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("aadApplicationObjectId", AAZStrType, ".aad_application_object_id") + properties.set_prop("aadClientId", AAZStrType, ".aad_client_id") + properties.set_prop("aadServicePrincipalObjectId", AAZStrType, ".aad_service_principal_object_id") + properties.set_prop("aadTenantId", AAZStrType, ".aad_tenant_id") + properties.set_prop("cloudManagementEndpoint", AAZStrType, ".endpoint") + properties.set_prop("desiredProperties", AAZObjectType, ".desired_properties") + + desired_properties = _builder.get(".properties.desiredProperties") + if desired_properties is not None: + desired_properties.set_prop("diagnosticLevel", AAZStrType, ".diagnostic_level") + desired_properties.set_prop("windowsServerSubscription", AAZStrType, ".windows_server_subscription") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = cls._schema_on_200.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = cls._schema_on_200.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = cls._schema_on_200.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py new file mode 100644 index 00000000000..a3798296c23 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py @@ -0,0 +1,198 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster create-identity", +) +class CreateIdentity(AAZCommand): + """Create cluster identity. + + :example: Create cluster identity + az stack-hci-vm cluster create-identity --name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/createclusteridentity", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ClustersCreateIdentity(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ClustersCreateIdentity(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.properties = AAZObjectType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + + return cls._schema_on_200 + + +class _CreateIdentityHelper: + """Helper class for CreateIdentity""" + + +__all__ = ["CreateIdentity"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py new file mode 100644 index 00000000000..4f00b297e69 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py @@ -0,0 +1,163 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an HCI cluster. + + :example: Delete cluster + az stack-hci-vm cluster delete --name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["-n", "--name", "--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ClustersDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ClustersDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py new file mode 100644 index 00000000000..f7ac1ce5db3 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py @@ -0,0 +1,468 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster extend-software-assurance-benefit", +) +class ExtendSoftwareAssuranceBenefit(AAZCommand): + """Extend Software Assurance Benefit to a cluster + + :example: Extend software assurance benefit + az stack-hci-vm cluster extend-software-assurance-benefit --cluster-name name -g rg --software-assurance-intent enable + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/extendsoftwareassurancebenefit", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.software_assurance_intent = AAZStrArg( + options=["--software-assurance-intent"], + arg_group="Properties", + help="Customer Intent for Software Assurance Benefit.", + enum={"Disable": "Disable", "Enable": "Enable"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ClustersExtendSoftwareAssuranceBenefit(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ClustersExtendSoftwareAssuranceBenefit(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("softwareAssuranceIntent", AAZStrType, ".software_assurance_intent") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = cls._schema_on_200.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = cls._schema_on_200.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = cls._schema_on_200.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ExtendSoftwareAssuranceBenefitHelper: + """Helper class for ExtendSoftwareAssuranceBenefit""" + + +__all__ = ["ExtendSoftwareAssuranceBenefit"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py new file mode 100644 index 00000000000..7177242c9b6 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py @@ -0,0 +1,775 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster list", +) +class List(AAZCommand): + """List all HCI clusters in a subscription. + + :example: List clusters in a given resource group + az stack-hci-vm cluster list --resource-group "test-rg" + + :example: List clusters in a given subscription + az stack-hci-vm cluster list + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.azurestackhci/clusters", "2023-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + if condition_0: + self.ClustersListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.ClustersListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class ClustersListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = cls._schema_on_200.value.Element.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = cls._schema_on_200.value.Element.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = cls._schema_on_200.value.Element.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = cls._schema_on_200.value.Element.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = cls._schema_on_200.value.Element.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class ClustersListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = cls._schema_on_200.value.Element.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = cls._schema_on_200.value.Element.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = cls._schema_on_200.value.Element.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = cls._schema_on_200.value.Element.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = cls._schema_on_200.value.Element.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py new file mode 100644 index 00000000000..74738b08081 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py @@ -0,0 +1,423 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster show", +) +class Show(AAZCommand): + """Get HCI cluster. + + :example: Get cluster + az stack-hci-vm cluster show --name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["-n", "--name", "--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ClustersGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ClustersGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = cls._schema_on_200.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = cls._schema_on_200.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = cls._schema_on_200.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py new file mode 100644 index 00000000000..77583b72b63 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py @@ -0,0 +1,657 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster update", +) +class Update(AAZCommand): + """Update an HCI cluster. + + :example: Update cluster + az stack-hci-vm cluster update --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" --desired-properties "{diagnosticLevel:Basic,windowsServerSubscription:Enabled}" --tags "tag:"value" --name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["-n", "--name", "--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Cluster" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Cluster", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.aad_client_id = AAZStrArg( + options=["--aad-client-id"], + arg_group="Properties", + help="App id of cluster AAD identity.", + nullable=True, + ) + _args_schema.aad_tenant_id = AAZStrArg( + options=["--aad-tenant-id"], + arg_group="Properties", + help="Tenant id of cluster AAD identity.", + nullable=True, + ) + _args_schema.endpoint = AAZStrArg( + options=["--endpoint"], + arg_group="Properties", + help="Endpoint configured for management from the Azure portal.", + nullable=True, + ) + _args_schema.desired_properties = AAZObjectArg( + options=["--desired-properties"], + arg_group="Properties", + help="Desired properties of the cluster.", + nullable=True, + ) + + desired_properties = cls._args_schema.desired_properties + desired_properties.diagnostic_level = AAZStrArg( + options=["diagnostic-level"], + help="Desired level of diagnostic data emitted by the cluster.", + nullable=True, + enum={"Basic": "Basic", "Enhanced": "Enhanced", "Off": "Off"}, + ) + desired_properties.windows_server_subscription = AAZStrArg( + options=["windows-server-subscription"], + help="Desired state of Windows Server Subscription.", + nullable=True, + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ClustersGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.ClustersCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ClustersGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_cluster_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ClustersCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_cluster_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("aadClientId", AAZStrType, ".aad_client_id") + properties.set_prop("aadTenantId", AAZStrType, ".aad_tenant_id") + properties.set_prop("cloudManagementEndpoint", AAZStrType, ".endpoint") + properties.set_prop("desiredProperties", AAZObjectType, ".desired_properties") + + desired_properties = _builder.get(".properties.desiredProperties") + if desired_properties is not None: + desired_properties.set_prop("diagnosticLevel", AAZStrType, ".diagnostic_level") + desired_properties.set_prop("windowsServerSubscription", AAZStrType, ".windows_server_subscription") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_cluster_read = None + + @classmethod + def _build_schema_cluster_read(cls, _schema): + if cls._schema_cluster_read is not None: + _schema.id = cls._schema_cluster_read.id + _schema.identity = cls._schema_cluster_read.identity + _schema.location = cls._schema_cluster_read.location + _schema.name = cls._schema_cluster_read.name + _schema.properties = cls._schema_cluster_read.properties + _schema.system_data = cls._schema_cluster_read.system_data + _schema.tags = cls._schema_cluster_read.tags + _schema.type = cls._schema_cluster_read.type + return + + cls._schema_cluster_read = _schema_cluster_read = AAZObjectType() + + cluster_read = _schema_cluster_read + cluster_read.id = AAZStrType( + flags={"read_only": True}, + ) + cluster_read.identity = AAZObjectType() + cluster_read.location = AAZStrType( + flags={"required": True}, + ) + cluster_read.name = AAZStrType( + flags={"read_only": True}, + ) + cluster_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + cluster_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cluster_read.tags = AAZDictType() + cluster_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_cluster_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_cluster_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_cluster_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_cluster_read.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = _schema_cluster_read.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = _schema_cluster_read.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = _schema_cluster_read.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = _schema_cluster_read.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = _schema_cluster_read.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = _schema_cluster_read.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = _schema_cluster_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_cluster_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_cluster_read.id + _schema.identity = cls._schema_cluster_read.identity + _schema.location = cls._schema_cluster_read.location + _schema.name = cls._schema_cluster_read.name + _schema.properties = cls._schema_cluster_read.properties + _schema.system_data = cls._schema_cluster_read.system_data + _schema.tags = cls._schema_cluster_read.tags + _schema.type = cls._schema_cluster_read.type + + +__all__ = ["Update"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py new file mode 100644 index 00000000000..ae0abc3aca6 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py @@ -0,0 +1,419 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["-n", "--name", "--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ClustersGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class ClustersGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = cls._schema_on_200.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = cls._schema_on_200.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = cls._schema_on_200.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py new file mode 100644 index 00000000000..5bf45544fac --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "stack-hci-vm cluster identity", +) +class __CMDGroup(AAZCommandGroup): + """Manage identity + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py new file mode 100644 index 00000000000..9fa7324972a --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._assign import * +from ._remove import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py new file mode 100644 index 00000000000..32de0c73f52 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py @@ -0,0 +1,605 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster identity assign", +) +class Assign(AAZCommand): + """Assign identities + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01", "identity"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Cluster.identity" + + _args_schema = cls._args_schema + _args_schema.type = AAZStrArg( + options=["--type"], + arg_group="Cluster.identity", + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + required=True, + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, + ) + _args_schema.user_assigned_identities = AAZDictArg( + options=["--user-assigned-identities"], + arg_group="Cluster.identity", + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + ) + + user_assigned_identities = cls._args_schema.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + blank={}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ClustersGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.ClustersCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.identity + + def _set(self, value): + result = self.ctx.vars.instance + result.identity = value + return + + class ClustersGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _AssignHelper._build_schema_cluster_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ClustersCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _AssignHelper._build_schema_cluster_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + return _instance_value + + +class _AssignHelper: + """Helper class for Assign""" + + _schema_cluster_read = None + + @classmethod + def _build_schema_cluster_read(cls, _schema): + if cls._schema_cluster_read is not None: + _schema.id = cls._schema_cluster_read.id + _schema.identity = cls._schema_cluster_read.identity + _schema.location = cls._schema_cluster_read.location + _schema.name = cls._schema_cluster_read.name + _schema.properties = cls._schema_cluster_read.properties + _schema.system_data = cls._schema_cluster_read.system_data + _schema.tags = cls._schema_cluster_read.tags + _schema.type = cls._schema_cluster_read.type + return + + cls._schema_cluster_read = _schema_cluster_read = AAZObjectType() + + cluster_read = _schema_cluster_read + cluster_read.id = AAZStrType( + flags={"read_only": True}, + ) + cluster_read.identity = AAZObjectType() + cluster_read.location = AAZStrType( + flags={"required": True}, + ) + cluster_read.name = AAZStrType( + flags={"read_only": True}, + ) + cluster_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + cluster_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cluster_read.tags = AAZDictType() + cluster_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_cluster_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_cluster_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_cluster_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_cluster_read.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = _schema_cluster_read.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = _schema_cluster_read.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = _schema_cluster_read.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = _schema_cluster_read.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = _schema_cluster_read.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = _schema_cluster_read.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = _schema_cluster_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_cluster_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_cluster_read.id + _schema.identity = cls._schema_cluster_read.identity + _schema.location = cls._schema_cluster_read.location + _schema.name = cls._schema_cluster_read.name + _schema.properties = cls._schema_cluster_read.properties + _schema.system_data = cls._schema_cluster_read.system_data + _schema.tags = cls._schema_cluster_read.tags + _schema.type = cls._schema_cluster_read.type + + +__all__ = ["Assign"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py new file mode 100644 index 00000000000..ecffd909b25 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py @@ -0,0 +1,607 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm cluster identity remove", +) +class Remove(AAZCommand): + """Remove identities + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01", "identity"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Cluster.identity" + + _args_schema = cls._args_schema + _args_schema.type = AAZStrArg( + options=["--type"], + arg_group="Cluster.identity", + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, + ) + _args_schema.user_assigned_identities = AAZDictArg( + options=["--user-assigned-identities"], + arg_group="Cluster.identity", + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + nullable=True, + ) + + user_assigned_identities = cls._args_schema.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + nullable=True, + blank={}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ClustersGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.selectors.subresource.required()) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.post_instance_update(self.ctx.selectors.subresource.required()) + self.ClustersCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.identity + + def _set(self, value): + result = self.ctx.vars.instance + result.identity = value + return + + class ClustersGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _RemoveHelper._build_schema_cluster_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ClustersCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _RemoveHelper._build_schema_cluster_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.selectors.subresource.required()) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + return _instance_value + + +class _RemoveHelper: + """Helper class for Remove""" + + _schema_cluster_read = None + + @classmethod + def _build_schema_cluster_read(cls, _schema): + if cls._schema_cluster_read is not None: + _schema.id = cls._schema_cluster_read.id + _schema.identity = cls._schema_cluster_read.identity + _schema.location = cls._schema_cluster_read.location + _schema.name = cls._schema_cluster_read.name + _schema.properties = cls._schema_cluster_read.properties + _schema.system_data = cls._schema_cluster_read.system_data + _schema.tags = cls._schema_cluster_read.tags + _schema.type = cls._schema_cluster_read.type + return + + cls._schema_cluster_read = _schema_cluster_read = AAZObjectType() + + cluster_read = _schema_cluster_read + cluster_read.id = AAZStrType( + flags={"read_only": True}, + ) + cluster_read.identity = AAZObjectType() + cluster_read.location = AAZStrType( + flags={"required": True}, + ) + cluster_read.name = AAZStrType( + flags={"read_only": True}, + ) + cluster_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + cluster_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cluster_read.tags = AAZDictType() + cluster_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_cluster_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_cluster_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_cluster_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_cluster_read.properties + properties.aad_application_object_id = AAZStrType( + serialized_name="aadApplicationObjectId", + ) + properties.aad_client_id = AAZStrType( + serialized_name="aadClientId", + ) + properties.aad_service_principal_object_id = AAZStrType( + serialized_name="aadServicePrincipalObjectId", + ) + properties.aad_tenant_id = AAZStrType( + serialized_name="aadTenantId", + ) + properties.billing_model = AAZStrType( + serialized_name="billingModel", + flags={"read_only": True}, + ) + properties.cloud_id = AAZStrType( + serialized_name="cloudId", + flags={"read_only": True}, + ) + properties.cloud_management_endpoint = AAZStrType( + serialized_name="cloudManagementEndpoint", + ) + properties.desired_properties = AAZObjectType( + serialized_name="desiredProperties", + ) + properties.last_billing_timestamp = AAZStrType( + serialized_name="lastBillingTimestamp", + flags={"read_only": True}, + ) + properties.last_sync_timestamp = AAZStrType( + serialized_name="lastSyncTimestamp", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timestamp = AAZStrType( + serialized_name="registrationTimestamp", + flags={"read_only": True}, + ) + properties.reported_properties = AAZObjectType( + serialized_name="reportedProperties", + ) + properties.resource_provider_object_id = AAZStrType( + serialized_name="resourceProviderObjectId", + flags={"read_only": True}, + ) + properties.service_endpoint = AAZStrType( + serialized_name="serviceEndpoint", + flags={"read_only": True}, + ) + properties.software_assurance_properties = AAZObjectType( + serialized_name="softwareAssuranceProperties", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.trial_days_remaining = AAZFloatType( + serialized_name="trialDaysRemaining", + flags={"read_only": True}, + ) + + desired_properties = _schema_cluster_read.properties.desired_properties + desired_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + desired_properties.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + ) + + reported_properties = _schema_cluster_read.properties.reported_properties + reported_properties.cluster_id = AAZStrType( + serialized_name="clusterId", + flags={"read_only": True}, + ) + reported_properties.cluster_name = AAZStrType( + serialized_name="clusterName", + flags={"read_only": True}, + ) + reported_properties.cluster_type = AAZStrType( + serialized_name="clusterType", + flags={"read_only": True}, + ) + reported_properties.cluster_version = AAZStrType( + serialized_name="clusterVersion", + flags={"read_only": True}, + ) + reported_properties.diagnostic_level = AAZStrType( + serialized_name="diagnosticLevel", + ) + reported_properties.imds_attestation = AAZStrType( + serialized_name="imdsAttestation", + flags={"read_only": True}, + ) + reported_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + reported_properties.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + reported_properties.nodes = AAZListType( + flags={"read_only": True}, + ) + reported_properties.supported_capabilities = AAZListType( + serialized_name="supportedCapabilities", + flags={"read_only": True}, + ) + + nodes = _schema_cluster_read.properties.reported_properties.nodes + nodes.Element = AAZObjectType() + + _element = _schema_cluster_read.properties.reported_properties.nodes.Element + _element.core_count = AAZFloatType( + serialized_name="coreCount", + flags={"read_only": True}, + ) + _element.ehc_resource_id = AAZStrType( + serialized_name="ehcResourceId", + flags={"read_only": True}, + ) + _element.id = AAZFloatType( + flags={"read_only": True}, + ) + _element.last_licensing_timestamp = AAZStrType( + serialized_name="lastLicensingTimestamp", + flags={"read_only": True}, + ) + _element.manufacturer = AAZStrType( + flags={"read_only": True}, + ) + _element.memory_in_gi_b = AAZFloatType( + serialized_name="memoryInGiB", + flags={"read_only": True}, + ) + _element.model = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.node_type = AAZStrType( + serialized_name="nodeType", + flags={"read_only": True}, + ) + _element.os_display_version = AAZStrType( + serialized_name="osDisplayVersion", + flags={"read_only": True}, + ) + _element.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + _element.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + _element.serial_number = AAZStrType( + serialized_name="serialNumber", + flags={"read_only": True}, + ) + _element.windows_server_subscription = AAZStrType( + serialized_name="windowsServerSubscription", + flags={"read_only": True}, + ) + + supported_capabilities = _schema_cluster_read.properties.reported_properties.supported_capabilities + supported_capabilities.Element = AAZStrType( + flags={"read_only": True}, + ) + + software_assurance_properties = _schema_cluster_read.properties.software_assurance_properties + software_assurance_properties.last_updated = AAZStrType( + serialized_name="lastUpdated", + flags={"read_only": True}, + ) + software_assurance_properties.software_assurance_intent = AAZStrType( + serialized_name="softwareAssuranceIntent", + ) + software_assurance_properties.software_assurance_status = AAZStrType( + serialized_name="softwareAssuranceStatus", + ) + + system_data = _schema_cluster_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_cluster_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_cluster_read.id + _schema.identity = cls._schema_cluster_read.identity + _schema.location = cls._schema_cluster_read.location + _schema.name = cls._schema_cluster_read.name + _schema.properties = cls._schema_cluster_read.properties + _schema.system_data = cls._schema_cluster_read.system_data + _schema.tags = cls._schema_cluster_read.tags + _schema.type = cls._schema_cluster_read.type + + +__all__ = ["Remove"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py new file mode 100644 index 00000000000..3e9caa4d9c5 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "stack-hci-vm extension", +) +class __CMDGroup(AAZCommandGroup): + """Manage extension with stack hci. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py new file mode 100644 index 00000000000..2d1a2078686 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._wait import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py new file mode 100644 index 00000000000..fb24cbc615b --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py @@ -0,0 +1,389 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm extension create", +) +class Create(AAZCommand): + """Create extension for HCI cluster. + + :example: Create arc extension + az stack-hci-vm extension create --arc-setting-name "default" --cluster-name "myCluster" --type "MicrosoftMonitoringAgent" --protected-settings '{"workspaceId": "xx", "port": "6516"}' --publisher "Microsoft.Compute" --settings '{"workspaceKey": "xx"}' --type-handler-version "1.10" --name "MicrosoftMonitoringAgent" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "ExtensionParameters" + + _args_schema = cls._args_schema + _args_schema.auto_upgrade = AAZBoolArg( + options=["--auto-upgrade"], + arg_group="ExtensionParameters", + help="Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.", + ) + _args_schema.force_update_tag = AAZStrArg( + options=["--force-update-tag"], + arg_group="ExtensionParameters", + help="How the extension handler should be forced to update even if the extension configuration has not changed.", + ) + _args_schema.protected_settings = AAZFreeFormDictArg( + options=["--protected-settings"], + arg_group="ExtensionParameters", + help="Protected settings (may contain secrets).", + ) + _args_schema.publisher = AAZStrArg( + options=["--publisher"], + arg_group="ExtensionParameters", + help="The name of the extension handler publisher.", + ) + _args_schema.settings = AAZFreeFormDictArg( + options=["--settings"], + arg_group="ExtensionParameters", + help="Json formatted public settings for the extension.", + ) + _args_schema.type = AAZStrArg( + options=["--type"], + arg_group="ExtensionParameters", + help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", + ) + _args_schema.type_handler_version = AAZStrArg( + options=["--type-handler-version"], + arg_group="ExtensionParameters", + help="Specifies the version of the script handler. Latest version would be used if not specified.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ExtensionsCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ExtensionsCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("extensionParameters", AAZObjectType) + + extension_parameters = _builder.get(".properties.extensionParameters") + if extension_parameters is not None: + extension_parameters.set_prop("autoUpgradeMinorVersion", AAZBoolType, ".auto_upgrade") + extension_parameters.set_prop("forceUpdateTag", AAZStrType, ".force_update_tag") + extension_parameters.set_prop("protectedSettings", AAZFreeFormDictType, ".protected_settings", typ_kwargs={"flags": {"secret": True}}) + extension_parameters.set_prop("publisher", AAZStrType, ".publisher") + extension_parameters.set_prop("settings", AAZFreeFormDictType, ".settings") + extension_parameters.set_prop("type", AAZStrType, ".type") + extension_parameters.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") + + protected_settings = _builder.get(".properties.extensionParameters.protectedSettings") + if protected_settings is not None: + protected_settings.set_anytype_elements(".") + + settings = _builder.get(".properties.extensionParameters.settings") + if settings is not None: + settings.set_anytype_elements(".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.extension_parameters = AAZObjectType( + serialized_name="extensionParameters", + ) + properties.managed_by = AAZStrType( + serialized_name="managedBy", + flags={"read_only": True}, + ) + properties.per_node_extension_details = AAZListType( + serialized_name="perNodeExtensionDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + extension_parameters = cls._schema_on_200_201.properties.extension_parameters + extension_parameters.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + extension_parameters.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + extension_parameters.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + extension_parameters.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + flags={"secret": True}, + ) + extension_parameters.publisher = AAZStrType() + extension_parameters.settings = AAZFreeFormDictType() + extension_parameters.type = AAZStrType() + extension_parameters.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + per_node_extension_details = cls._schema_on_200_201.properties.per_node_extension_details + per_node_extension_details.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.per_node_extension_details.Element + _element.extension = AAZStrType( + flags={"read_only": True}, + ) + _element.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + _element.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + flags={"read_only": True}, + ) + + instance_view = cls._schema_on_200_201.properties.per_node_extension_details.Element.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200_201.properties.per_node_extension_details.Element.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py new file mode 100644 index 00000000000..7c54ab021f7 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py @@ -0,0 +1,183 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm extension delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete particular arc extension of HCI Cluster. + + :example: Delete arc extension + az stack-hci-vm extension delete --arc-setting-name "default" --cluster-name "myCluster" --name "MicrosoftMonitoringAgent" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_2", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ExtensionsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ExtensionsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py new file mode 100644 index 00000000000..dabf72b74eb --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm extension list", +) +class List(AAZCommand): + """List all extensions under arc setting resource. + + :example: List extensions under arc setting resource + az stack-hci-vm extension list --arc-setting-name "default" --cluster-name "myCluster" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions", "2023-03-01"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ExtensionsListByArcSetting(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class ExtensionsListByArcSetting(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType( + flags={"read_only": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.extension_parameters = AAZObjectType( + serialized_name="extensionParameters", + ) + properties.managed_by = AAZStrType( + serialized_name="managedBy", + flags={"read_only": True}, + ) + properties.per_node_extension_details = AAZListType( + serialized_name="perNodeExtensionDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + extension_parameters = cls._schema_on_200.value.Element.properties.extension_parameters + extension_parameters.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + extension_parameters.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + extension_parameters.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + extension_parameters.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + flags={"secret": True}, + ) + extension_parameters.publisher = AAZStrType() + extension_parameters.settings = AAZFreeFormDictType() + extension_parameters.type = AAZStrType() + extension_parameters.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + per_node_extension_details = cls._schema_on_200.value.Element.properties.per_node_extension_details + per_node_extension_details.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.per_node_extension_details.Element + _element.extension = AAZStrType( + flags={"read_only": True}, + ) + _element.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + _element.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + flags={"read_only": True}, + ) + + instance_view = cls._schema_on_200.value.Element.properties.per_node_extension_details.Element.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.value.Element.properties.per_node_extension_details.Element.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py new file mode 100644 index 00000000000..550a4e2ac6f --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py @@ -0,0 +1,300 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm extension show", +) +class Show(AAZCommand): + """Get particular arc extension of HCI cluster. + + :example: Get arc settings extension + az stack-hci-vm extension show --arc-setting-name "default" --cluster-name "myCluster" --name "MicrosoftMonitoringAgent" --resource-group "test-rg" + """ + + _aaz_info = { + "version": "2023-03-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_2", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ExtensionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ExtensionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.extension_parameters = AAZObjectType( + serialized_name="extensionParameters", + ) + properties.managed_by = AAZStrType( + serialized_name="managedBy", + flags={"read_only": True}, + ) + properties.per_node_extension_details = AAZListType( + serialized_name="perNodeExtensionDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + extension_parameters = cls._schema_on_200.properties.extension_parameters + extension_parameters.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + extension_parameters.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + extension_parameters.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + extension_parameters.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + flags={"secret": True}, + ) + extension_parameters.publisher = AAZStrType() + extension_parameters.settings = AAZFreeFormDictType() + extension_parameters.type = AAZStrType() + extension_parameters.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + per_node_extension_details = cls._schema_on_200.properties.per_node_extension_details + per_node_extension_details.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.per_node_extension_details.Element + _element.extension = AAZStrType( + flags={"read_only": True}, + ) + _element.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + _element.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + flags={"read_only": True}, + ) + + instance_view = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py new file mode 100644 index 00000000000..df103b64221 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py @@ -0,0 +1,296 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "stack-hci-vm extension wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.arc_setting_name = AAZStrArg( + options=["--arc-setting-name"], + help="The name of the proxy resource holding details of HCI ArcSetting information.", + required=True, + id_part="child_name_1", + ) + _args_schema.cluster_name = AAZStrArg( + options=["--cluster-name"], + help="The name of the cluster.", + required=True, + id_part="name", + ) + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_2", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ExtensionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class ExtensionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "arcSettingName", self.ctx.args.arc_setting_name, + required=True, + ), + **self.serialize_url_param( + "clusterName", self.ctx.args.cluster_name, + required=True, + ), + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2023-03-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.aggregate_state = AAZStrType( + serialized_name="aggregateState", + flags={"read_only": True}, + ) + properties.extension_parameters = AAZObjectType( + serialized_name="extensionParameters", + ) + properties.managed_by = AAZStrType( + serialized_name="managedBy", + flags={"read_only": True}, + ) + properties.per_node_extension_details = AAZListType( + serialized_name="perNodeExtensionDetails", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + extension_parameters = cls._schema_on_200.properties.extension_parameters + extension_parameters.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + extension_parameters.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + extension_parameters.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + extension_parameters.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + flags={"secret": True}, + ) + extension_parameters.publisher = AAZStrType() + extension_parameters.settings = AAZFreeFormDictType() + extension_parameters.type = AAZStrType() + extension_parameters.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + per_node_extension_details = cls._schema_on_200.properties.per_node_extension_details + per_node_extension_details.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.per_node_extension_details.Element + _element.extension = AAZStrType( + flags={"read_only": True}, + ) + _element.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.state = AAZStrType( + flags={"read_only": True}, + ) + _element.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + flags={"read_only": True}, + ) + + instance_view = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json b/src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json new file mode 100644 index 00000000000..c91b1a720cc --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json @@ -0,0 +1,3 @@ +{ + "azext.minCliCoreVersion": "2.50.0" +} \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/commands.py b/src/stack-hci-vm/azext_stack_hci_vm/commands.py new file mode 100644 index 00000000000..df961c762cd --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/commands.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): # pylint: disable=unused-argument + + with self.command_group('stack-hci-vm cluster'): + from azext_stack_hci.custom import ClusterList, ClusterCreate, IdentityAssign, IdentityRemove + self.command_table['stack-hci-vm cluster list'] = ClusterList(loader=self) + self.command_table['stack-hci-vm cluster create'] = ClusterCreate(loader=self) + self.command_table['stack-hci-vm cluster identity assign'] = IdentityAssign(loader=self) + self.command_table['stack-hci-vm cluster identity remove'] = IdentityRemove(loader=self) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/custom.py b/src/stack-hci-vm/azext_stack_hci_vm/custom.py new file mode 100644 index 00000000000..c59c1778af3 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/custom.py @@ -0,0 +1,77 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements, protected-access +from azext_stack_hci.aaz.latest.stack_hci.cluster import List as _ClusterList +from azext_stack_hci.aaz.latest.stack_hci.cluster import Create as _ClusterCreate +from azext_stack_hci.aaz.latest.stack_hci.cluster.identity import Assign as _IdentityAssign +from azext_stack_hci.aaz.latest.stack_hci.cluster.identity import Remove as _IdentityRemove + + +class ClusterList(_ClusterList): + def post_operations(self): + # next_link cannot be accessed + if self.ctx.vars.instance.next_link.to_serialized_data(): + self.ctx.vars.instance.next_link = None + + +class ClusterCreate(_ClusterCreate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZBoolArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.mi_system_assigned = AAZBoolArg( + options=["--mi-system-assigned"], + help="Enable system assigned identity" + ) + args_schema.identity._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + if args.mi_system_assigned: + args.identity.type = "SystemAssigned" + + +class IdentityAssign(_IdentityAssign): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZBoolArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.system_assigned = AAZBoolArg( + options=["--system-assigned"], + help="Enable system assigned identity" + ) + args_schema.type._registered = False + args_schema.type._required = False + args_schema.user_assigned_identities._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + if args.system_assigned: + args.type = "SystemAssigned" + + +class IdentityRemove(_IdentityRemove): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZBoolArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.system_assigned = AAZBoolArg( + options=["--system-assigned"], + help="Enable system assigned identity" + ) + args_schema.type._registered = False + args_schema.user_assigned_identities._registered = False + return args_schema + + def pre_instance_update(self, instance): + args = self.ctx.args + if args.system_assigned: + args.type = 'None' diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/__init__.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml new file mode 100644 index 00000000000..214c9ee47de --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml @@ -0,0 +1,771 @@ +interactions: + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 + method: GET + uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000003%27%29 + response: + body: + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' + headers: + cache-control: + - no-cache + content-length: + - "87" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Mon, 29 May 2023 08:57:46 GMT + odata-version: + - "4.0" + request-id: + - 1bed73da-5a5d-4bae-b13d-03ef55b28ca5 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"SI2PEPF00000BC4"}}' + x-ms-resource-unit: + - "2" + status: + code: 200 + message: OK + - request: + body: '{"displayName": "app000003", "keyCredentials": []}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + Content-Length: + - "50" + Content-Type: + - application/json + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 + method: POST + uri: https://graph.microsoft.com/v1.0/applications + response: + body: + string: + '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", + "id": "9d59b3c9-1099-4598-8124-527d26e6a19a", "deletedDateTime": null, "appId": + "a5934ecc-a01a-480b-90c8-2263be2885f7", "applicationTemplateId": null, "disabledByMicrosoftStatus": + null, "createdDateTime": "2023-05-29T08:57:47.2444123Z", "displayName": "app000003", + "description": null, "groupMembershipClaims": null, "identifierUris": [], + "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": + null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": + null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], + "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": + null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": + null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": + null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": + [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": + null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, + "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": + {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": + [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": + {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, + "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": + {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": + []}, "spa": {"redirectUris": []}}' + headers: + cache-control: + - no-cache + content-length: + - "1717" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Mon, 29 May 2023 08:57:51 GMT + location: + - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/9d59b3c9-1099-4598-8124-527d26e6a19a/Microsoft.DirectoryServices.Application + odata-version: + - "4.0" + request-id: + - 8fe495c5-6cde-4327-b7a0-587964efe863 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"SI2PEPF00001640"}}' + x-ms-resource-unit: + - "1" + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_arc_setting000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001","name":"cli_test_stack_hci_arc_setting000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_arc_setting_crud","date":"2023-05-29T08:57:39Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - "412" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:57:51 GMT + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: + '{"location": "eastus", "properties": {"aadClientId": "a5934ecc-a01a-480b-90c8-2263be2885f7", + "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + Content-Length: + - "148" + Content-Type: + - application/json + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-05-29T08:57:55.9188585Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-05-29T08:57:55.9188585Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"6e333549-147d-4ec2-915a-d71da3b1ab70","aadClientId":"a5934ecc-a01a-480b-90c8-2263be2885f7","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1091" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:57:57 GMT + etag: + - '"1100988c-0000-0100-0000-647469150000"' + expires: + - "-1" + mise-correlation-id: + - 21afe15c-2572-423d-9f44-0fbb51175557 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: "{}" + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting create + Connection: + - keep-alive + Content-Length: + - "2" + Content-Type: + - application/json + ParameterSetName: + - -n -g --cluster-name + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-05-29T08:57:59.5118167Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-05-29T08:57:59.5118167Z"},"properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","defaultExtensions":[{"category":"ProductQualityAndSupport"}]}}' + headers: + cache-control: + - no-cache + content-length: + - "781" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:00 GMT + etag: + - '"b0004831-0000-0100-0000-647469180000"' + expires: + - "-1" + mise-correlation-id: + - 1100563b-9d91-4111-ab4c-9cd4b6be56f2 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting create-identity + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -n --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/createArcIdentity?api-version=2023-03-01 + response: + body: + string: "null" + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + cache-control: + - no-cache + content-length: + - "4" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:03 GMT + expires: + - "-1" + location: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + mise-correlation-id: + - 0d208147-8b77-4dcf-a7b5-3aed4b6b80ca + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting create-identity + Connection: + - keep-alive + ParameterSetName: + - -n --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","name":"39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","status":"Accepted","startTime":"2023-05-29T08:58:03.8056473Z"}' + headers: + cache-control: + - no-cache + content-length: + - "550" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:03 GMT + etag: + - '"37002f59-0000-0100-0000-6474691b0000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting create-identity + Connection: + - keep-alive + ParameterSetName: + - -n --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","name":"39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","status":"Succeeded","startTime":"2023-05-29T08:58:03.8056473Z","endTime":"2023-05-29T08:58:09.8717017Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - "610" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:34 GMT + etag: + - '"37003459-0000-0100-0000-647469210000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting consent-and-install-default-extension + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -g --arc-setting-name --cluster-name + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/consentAndInstallDefaultExtensions?api-version=2023-03-01 + response: + body: + string: '{"properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","arcApplicationTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","arcApplicationClientId":"4cd5b949-138b-426e-8f07-0fe2c79f596e","arcApplicationObjectId":"fb68accd-3ee0-46d7-acf7-4fa0749eda2d","arcServicePrincipalObjectId":"16a9a3f4-7b38-4621-b04d-d9e37d015dcf","defaultExtensions":[{"category":"ProductQualityAndSupport","consentTime":"2023-05-29T08:58:36.4965053Z"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings"}' + headers: + cache-control: + - no-cache + content-length: + - "843" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:36 GMT + expires: + - "-1" + mise-correlation-id: + - 1a25070d-4d73-448b-b37a-ab73a8c55a2a + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting initialize-disable-proces + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -g --arc-setting-name --cluster-name + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/initializeDisableProcess?api-version=2023-03-01 + response: + body: + string: "null" + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + cache-control: + - no-cache + content-length: + - "4" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:38 GMT + expires: + - "-1" + location: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + mise-correlation-id: + - c1140600-f82c-4f51-8a1e-c55870ea035d + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting initialize-disable-proces + Connection: + - keep-alive + ParameterSetName: + - -g --arc-setting-name --cluster-name + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","name":"cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","status":"Succeeded","startTime":"2023-05-29T08:58:38.7683478Z","endTime":"2023-05-29T08:58:38.8985219Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - "610" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:39 GMT + etag: + - '"37005c59-0000-0100-0000-6474693e0000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings?api-version=2023-03-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","perNodeDetails":[],"arcApplicationTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","arcApplicationClientId":"4cd5b949-138b-426e-8f07-0fe2c79f596e","arcApplicationObjectId":"fb68accd-3ee0-46d7-acf7-4fa0749eda2d","arcServicePrincipalObjectId":"16a9a3f4-7b38-4621-b04d-d9e37d015dcf","defaultExtensions":[{"category":"ProductQualityAndSupport","consentTime":"2023-05-29T08:58:36.4965053Z"}]}}]}' + headers: + cache-control: + - no-cache + content-length: + - "875" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:39 GMT + expires: + - "-1" + mise-correlation-id: + - faa6bfd7-9be3-41a0-8023-b63f3878599b + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting show + Connection: + - keep-alive + ParameterSetName: + - -n -g --cluster-name + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","perNodeDetails":[],"arcApplicationTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","arcApplicationClientId":"4cd5b949-138b-426e-8f07-0fe2c79f596e","arcApplicationObjectId":"fb68accd-3ee0-46d7-acf7-4fa0749eda2d","arcServicePrincipalObjectId":"16a9a3f4-7b38-4621-b04d-d9e37d015dcf","defaultExtensions":[{"category":"ProductQualityAndSupport","consentTime":"2023-05-29T08:58:36.4965053Z"}]}}' + headers: + cache-control: + - no-cache + content-length: + - "863" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:41 GMT + etag: + - '"b000f931-0000-0100-0000-6474693c0000"' + expires: + - "-1" + mise-correlation-id: + - 86386ed0-7a4e-441f-bf73-5a6754ed552e + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting generate-password + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -n --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/generatePassword?api-version=2023-03-01 + response: + body: + string: '{"secretText":"vKU8Q~7Zj3fEvgui66-EWnhh8bHlfCjT2wXYGbqM","startDateTime":"2023-05-29T08:58:43.6841781+00:00","endDateTime":"2025-05-29T08:58:43.6841782+00:00","keyId":"b4b5d17b-411d-42fa-bff0-57e8f85eaaa3"}' + headers: + cache-control: + - no-cache + content-length: + - "206" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:43 GMT + expires: + - "-1" + mise-correlation-id: + - 715bbb9d-f157-4118-b8aa-fbe14bcf657c + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting delete + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -n -g --cluster-name --no-wait --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 + response: + body: + string: "null" + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/5eaf5a98-695a-438a-bbbe-bb96457fb0d3*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + cache-control: + - no-cache + content-length: + - "4" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 29 May 2023 08:58:46 GMT + etag: + - '"b0001d32-0000-0100-0000-647469460000"' + expires: + - "-1" + location: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/5eaf5a98-695a-438a-bbbe-bb96457fb0d3*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 + mise-correlation-id: + - 23f42d0d-0776-4433-a206-d4e4808e8960 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-deletes: + - "14999" + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml new file mode 100644 index 00000000000..e853b4db356 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml @@ -0,0 +1,894 @@ +interactions: + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 + method: GET + uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000003%27%29 + response: + body: + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' + headers: + cache-control: + - no-cache + content-length: + - "87" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Thu, 01 Jun 2023 02:57:28 GMT + odata-version: + - "4.0" + request-id: + - 454ccc3e-9d4f-4cef-9817-e9081f76ab6e + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Japan East","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"TY1PEPF0000604C"}}' + x-ms-resource-unit: + - "2" + status: + code: 200 + message: OK + - request: + body: '{"displayName": "app000003", "keyCredentials": []}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + Content-Length: + - "50" + Content-Type: + - application/json + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 + method: POST + uri: https://graph.microsoft.com/v1.0/applications + response: + body: + string: + '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", + "id": "dd60e7e1-4023-4714-8c97-10b879ee6bf6", "deletedDateTime": null, "appId": + "999b5f21-41f6-4357-8fc1-86fe171f8024", "applicationTemplateId": null, "disabledByMicrosoftStatus": + null, "createdDateTime": "2023-06-01T02:57:30.0436864Z", "displayName": "app000003", + "description": null, "groupMembershipClaims": null, "identifierUris": [], + "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": + null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": + null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], + "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": + null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": + null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": + null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": + [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": + null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, + "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": + {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": + [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": + {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, + "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": + {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": + []}, "spa": {"redirectUris": []}}' + headers: + cache-control: + - no-cache + content-length: + - "1717" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Thu, 01 Jun 2023 02:57:30 GMT + location: + - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/dd60e7e1-4023-4714-8c97-10b879ee6bf6/Microsoft.DirectoryServices.Application + odata-version: + - "4.0" + request-id: + - ee62b343-0357-40c4-b0fb-048eb5415908 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Japan East","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"TY1PEPF00006059"}}' + x-ms-resource-unit: + - "1" + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_cluster000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001","name":"cli_test_stack_hci_cluster000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_cluster_crud","date":"2023-06-01T02:57:23Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - "400" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:57:31 GMT + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: + '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": + {"aadClientId": "999b5f21-41f6-4357-8fc1-86fe171f8024", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}, + "tags": {"key0": "value0"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + Content-Length: + - "216" + Content-Type: + - application/json + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T02:57:35.1143798Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T02:57:35.1143798Z"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"999b5f21-41f6-4357-8fc1-86fe171f8024","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1252" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:57:38 GMT + etag: + - '"1100c6e7-0000-0100-0000-647809210000"' + expires: + - "-1" + mise-correlation-id: + - f0266864-8d55-4f31-bdc1-71de6d7f1479 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create-identity + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/createClusterIdentity?api-version=2023-03-01 + response: + body: + string: "null" + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + cache-control: + - no-cache + content-length: + - "4" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:57:39 GMT + expires: + - "-1" + location: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + mise-correlation-id: + - 4b6301b1-3932-4491-b396-584d51eb606c + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create-identity + Connection: + - keep-alive + ParameterSetName: + - --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Accepted","startTime":"2023-06-01T02:57:40.5133087Z"}' + headers: + cache-control: + - no-cache + content-length: + - "526" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:57:40 GMT + etag: + - '"4300df2b-0000-0100-0000-647809240000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create-identity + Connection: + - keep-alive + ParameterSetName: + - --cluster-name -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Succeeded","startTime":"2023-06-01T02:57:40.5133087Z","endTime":"2023-06-01T02:57:42.8906594Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - "586" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:11 GMT + etag: + - '"4300ee2b-0000-0100-0000-647809260000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters?api-version=2023-03-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}]}' + headers: + cache-control: + - no-cache + content-length: + - "1153" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:14 GMT + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 7fccb38e-9b1e-4694-8559-85d56be7c2d4 + - c6f39ed1-9cbb-4be5-a0ce-7cddd07814f6 + - 51ce5ccb-e600-4219-8de0-0ca99c30551d + - 65d4017b-aeb4-4e72-ba26-50c21da8d2a6 + - 916961d9-cba7-489a-82e7-a2a5e8772284 + - 9b893e4d-e77d-4704-9f06-5d04d99d6e05 + - 26b7f6f6-5f80-43c4-b8ab-63a0b76233ce + - 3c1e8971-f190-485b-9a54-62bb74e4c4ea + - 4d97dd7a-bc0c-4e5d-aec5-58b2d6a60519 + - da04ba3b-4a1f-4a55-87cf-cb86f644016f + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1141" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:15 GMT + etag: + - '"1100c7e7-0000-0100-0000-647809260000"' + expires: + - "-1" + mise-correlation-id: + - 91fef0e2-8a2e-4bfe-bb29-ef4aecdec127 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: + '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": + {"aadApplicationObjectId": "2e404a96-2452-4490-a1a8-daa2eb03a2a6", "aadClientId": + "59a00546-885a-46b1-a01a-f7b8ea0b51a1", "aadServicePrincipalObjectId": "93b58b7d-cd78-4c57-b9f9-749f7b7ae989", + "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "desiredProperties": + {"diagnosticLevel": "Basic", "windowsServerSubscription": "Disabled"}, "softwareAssuranceProperties": + {"softwareAssuranceIntent": "Disable", "softwareAssuranceStatus": "Disabled"}}, + "tags": {"key0": "value1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster update + Connection: + - keep-alive + Content-Length: + - "555" + Content-Type: + - application/json + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value1"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T02:57:35.1143798Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T02:58:16.6568224Z"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1385" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:19 GMT + etag: + - '"1100c8e7-0000-0100-0000-647809490000"' + expires: + - "-1" + mise-correlation-id: + - 72ab32e6-4461-43c9-85d7-361efad360f1 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value1"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1141" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:20 GMT + etag: + - '"1100c8e7-0000-0100-0000-647809490000"' + expires: + - "-1" + mise-correlation-id: + - 3cc78b67-a8a3-4e10-acda-03ebfcc6c82e + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster show + Connection: + - keep-alive + ParameterSetName: + - --ids + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value1"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1141" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:22 GMT + etag: + - '"1100c8e7-0000-0100-0000-647809490000"' + expires: + - "-1" + mise-correlation-id: + - 9dbe8a0b-f657-4805-9fcd-89136f01d150 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster delete + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -n -g --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: "null" + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + cache-control: + - no-cache + content-length: + - "4" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:23 GMT + etag: + - '"1100c9e7-0000-0100-0000-647809500000"' + expires: + - "-1" + location: + - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-deletes: + - "14999" + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster delete + Connection: + - keep-alive + ParameterSetName: + - -n -g --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' + headers: + cache-control: + - no-cache + content-length: + - "526" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:25 GMT + etag: + - '"4300302d-0000-0100-0000-647809500000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster delete + Connection: + - keep-alive + ParameterSetName: + - -n -g --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' + headers: + cache-control: + - no-cache + content-length: + - "526" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:58:55 GMT + etag: + - '"4300302d-0000-0100-0000-647809500000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster delete + Connection: + - keep-alive + ParameterSetName: + - -n -g --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' + headers: + cache-control: + - no-cache + content-length: + - "526" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:59:25 GMT + etag: + - '"4300302d-0000-0100-0000-647809500000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster delete + Connection: + - keep-alive + ParameterSetName: + - -n -g --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' + headers: + cache-control: + - no-cache + content-length: + - "526" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 02:59:55 GMT + etag: + - '"4300302d-0000-0100-0000-647809500000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster delete + Connection: + - keep-alive + ParameterSetName: + - -n -g --yes + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 + response: + body: + string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Succeeded","startTime":"2023-06-01T02:58:24.4957878Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - "545" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 03:00:26 GMT + etag: + - '"5000a4a8-0000-0800-0000-647809b20000"' + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml new file mode 100644 index 00000000000..d8ae5c23a22 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml @@ -0,0 +1,544 @@ +interactions: + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 + method: GET + uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000004%27%29 + response: + body: + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' + headers: + cache-control: + - no-cache + content-length: + - "87" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:29 GMT + odata-version: + - "4.0" + request-id: + - 09900153-ad2f-4105-94e0-4374298377f1 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"SG1PEPF000066F9"}}' + x-ms-resource-unit: + - "2" + status: + code: 200 + message: OK + - request: + body: '{"displayName": "app000004", "keyCredentials": []}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + Content-Length: + - "50" + Content-Type: + - application/json + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 + method: POST + uri: https://graph.microsoft.com/v1.0/applications + response: + body: + string: + '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", + "id": "f844340b-7526-46b3-92e4-34654be18046", "deletedDateTime": null, "appId": + "9a3a3aa8-cd35-4d65-950d-3682e61be381", "applicationTemplateId": null, "disabledByMicrosoftStatus": + null, "createdDateTime": "2023-06-01T09:54:29.9196249Z", "displayName": "app000004", + "description": null, "groupMembershipClaims": null, "identifierUris": [], + "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": + null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": + null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], + "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": + null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": + null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": + null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": + [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": + null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, + "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": + {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": + [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": + {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, + "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": + {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": + []}, "spa": {"redirectUris": []}}' + headers: + cache-control: + - no-cache + content-length: + - "1717" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:31 GMT + location: + - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/f844340b-7526-46b3-92e4-34654be18046/Microsoft.DirectoryServices.Application + odata-version: + - "4.0" + request-id: + - 6ae4936d-1b8a-4f85-af3f-fb164177d39c + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"SG1PEPF00006137"}}' + x-ms-resource-unit: + - "1" + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_cluster000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001","name":"cli_test_stack_hci_cluster000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_cluster_identity","date":"2023-06-01T09:54:25Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - "404" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:31 GMT + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: + '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": + {"aadClientId": "9a3a3aa8-cd35-4d65-950d-3682e61be381", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}, + "tags": {"key0": "value0"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + Content-Length: + - "216" + Content-Type: + - application/json + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:36.0575373Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:36.0575373Z"},"identity":{"principalId":"d1e6eee7-ff34-4713-bb5f-caf4f2007206","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"0294a950-b673-4cd3-aed2-607e7237d06a","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1252" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:39 GMT + etag: + - '"1100d7ef-0000-0100-0000-64786add0000"' + expires: + - "-1" + mise-correlation-id: + - f6a0920f-c270-4351-a7d6-94689330e3a7 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_cluster000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001","name":"cli_test_stack_hci_cluster000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_cluster_identity","date":"2023-06-01T09:54:25Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - "404" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:39 GMT + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: + '{"location": "eastus", "properties": {"aadClientId": "9a3a3aa8-cd35-4d65-950d-3682e61be381", + "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + Content-Length: + - "148" + Content-Type: + - application/json + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:44.0894892Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:44.0894892Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1087" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:46 GMT + etag: + - '"1100d9ef-0000-0100-0000-64786ae50000"' + expires: + - "-1" + mise-correlation-id: + - 96b11de5-aa99-448a-b115-15966624d03a + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster identity assign + Connection: + - keep-alive + ParameterSetName: + - --cluster-name -g --system-assigned + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "843" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:48 GMT + etag: + - '"1100d9ef-0000-0100-0000-64786ae50000"' + expires: + - "-1" + mise-correlation-id: + - 1d5b0ce4-65b2-492d-8f99-7073768ac5de + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: + '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": + {"aadClientId": "9a3a3aa8-cd35-4d65-950d-3682e61be381", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + "desiredProperties": {"diagnosticLevel": "Basic", "windowsServerSubscription": + "Disabled"}, "softwareAssuranceProperties": {"softwareAssuranceIntent": "Disable", + "softwareAssuranceStatus": "Disabled"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster identity assign + Connection: + - keep-alive + Content-Length: + - "390" + Content-Type: + - application/json + ParameterSetName: + - --cluster-name -g --system-assigned + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:44.0894892Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:49.168997Z"},"identity":{"principalId":"cd7610a9-0d16-4153-aa78-0915dc5af0e1","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1226" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:53 GMT + etag: + - '"1100daef-0000-0100-0000-64786aea0000"' + expires: + - "-1" + mise-correlation-id: + - 596e8b1e-3a3c-4424-aef2-93855c32183c + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster identity remove + Connection: + - keep-alive + ParameterSetName: + - --cluster-name -g --system-assigned + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","identity":{"principalId":"cd7610a9-0d16-4153-aa78-0915dc5af0e1","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "983" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:54:55 GMT + etag: + - '"1100daef-0000-0100-0000-64786aea0000"' + expires: + - "-1" + mise-correlation-id: + - fb397559-72ab-44bf-b3ae-13b6227820d5 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: + '{"identity": {"type": "None"}, "location": "eastus", "properties": {"aadClientId": + "9a3a3aa8-cd35-4d65-950d-3682e61be381", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + "desiredProperties": {"diagnosticLevel": "Basic", "windowsServerSubscription": + "Disabled"}, "softwareAssuranceProperties": {"softwareAssuranceIntent": "Disable", + "softwareAssuranceStatus": "Disabled"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster identity remove + Connection: + - keep-alive + Content-Length: + - "380" + Content-Type: + - application/json + ParameterSetName: + - --cluster-name -g --system-assigned + User-Agent: + - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:44.0894892Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:56.1247294Z"},"identity":{"type":"None"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1114" + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Jun 2023 09:55:00 GMT + etag: + - '"1100dbef-0000-0100-0000-64786af10000"' + expires: + - "-1" + mise-correlation-id: + - 46dbae79-a5d4-4b86-a509-5145f7dbb46f + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK +version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml new file mode 100644 index 00000000000..b82ed9e2d6f --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml @@ -0,0 +1,481 @@ +interactions: + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.51.0 + method: GET + uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000003%27%29 + response: + body: + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' + headers: + cache-control: + - no-cache + content-length: + - "87" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:05 GMT + odata-version: + - "4.0" + request-id: + - 910d2be5-1df4-46ce-842d-8868f28f8fef + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"SI1PEPF0001104C"}}' + x-ms-resource-unit: + - "2" + status: + code: 200 + message: OK + - request: + body: '{"displayName": "app000003", "keyCredentials": []}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + Content-Length: + - "50" + Content-Type: + - application/json + ParameterSetName: + - --display-name + User-Agent: + - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.51.0 + method: POST + uri: https://graph.microsoft.com/v1.0/applications + response: + body: + string: + '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", + "id": "f550ce24-074d-4a8e-b811-096bb4a060c6", "deletedDateTime": null, "appId": + "71e0238a-e9ae-4c12-8f3b-0aa425837779", "applicationTemplateId": null, "disabledByMicrosoftStatus": + null, "createdDateTime": "2023-08-28T07:10:07.1114243Z", "displayName": "app000003", + "description": null, "groupMembershipClaims": null, "identifierUris": [], + "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": + null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": + null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], + "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": + null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": + null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": + null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": + [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": + null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, + "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": + {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": + [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": + {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, + "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": + {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": + []}, "spa": {"redirectUris": []}}' + headers: + cache-control: + - no-cache + content-length: + - "1717" + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:09 GMT + location: + - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/f550ce24-074d-4a8e-b811-096bb4a060c6/Microsoft.DirectoryServices.Application + odata-version: + - "4.0" + request-id: + - e65d716c-e4d9-4a01-a990-2e3cdd9da029 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"SI1PEPF00001A31"}}' + x-ms-resource-unit: + - "1" + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_extension000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001","name":"cli_test_stack_hci_extension000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_extension_crud","date":"2023-08-28T07:10:00Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - "406" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:10 GMT + expires: + - "-1" + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK + - request: + body: + '{"location": "eastus", "properties": {"aadClientId": "71e0238a-e9ae-4c12-8f3b-0aa425837779", + "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm cluster create + Connection: + - keep-alive + Content-Length: + - "148" + Content-Type: + - application/json + ParameterSetName: + - -n -g --aad-client-id --aad-tenant-id + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-08-28T07:10:14.4029371Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-28T07:10:14.4029371Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"31f5b678-68a1-490d-999d-886da92582da","aadClientId":"71e0238a-e9ae-4c12-8f3b-0aa425837779","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' + headers: + cache-control: + - no-cache + content-length: + - "1089" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:15 GMT + etag: + - '"ed0316be-0000-0100-0000-64ec48570000"' + expires: + - "-1" + mise-correlation-id: + - 1f3193e5-5f2a-444e-8270-b29b187caaaa + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: "{}" + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm arc-setting create + Connection: + - keep-alive + Content-Length: + - "2" + Content-Type: + - application/json + ParameterSetName: + - -n -g --cluster-name + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-08-28T07:10:16.9321198Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-28T07:10:16.9321198Z"},"properties":{"connectivityProperties":{"enabled":false,"serviceConfigurations":[]},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-31f5b678-68a1-490d-999d-886da92582da-Arc-Infra-RG","aggregateState":"NotSpecified","defaultExtensions":[{"category":"ProductQualityAndSupport"}]}}' + headers: + cache-control: + - no-cache + content-length: + - "806" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:23 GMT + etag: + - '"c300f340-0000-0100-0000-64ec485f0000"' + expires: + - "-1" + mise-correlation-id: + - f59a1d55-8fd1-4954-a7d2-2fb75c7d732d + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: + '{"properties": {"extensionParameters": {"protectedSettings": {"workspaceKey": + "xx"}, "publisher": "Microsoft.Compute", "settings": {"workspaceId": "xx", "port": + "6516"}, "type": "MicrosoftMonitoringAgent", "typeHandlerVersion": "1.10"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm extension create + Connection: + - keep-alive + Content-Length: + - "237" + Content-Type: + - application/json + ParameterSetName: + - -n -g --cluster-name --arc-setting-name --settings --protected-settings --publisher + --type --type-handler-version + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent","name":"MicrosoftMonitoringAgent","type":"microsoft.azurestackhci/clusters/arcsettings/extensions","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-08-28T07:10:24.4415908Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-28T07:10:24.4415908Z"},"properties":{"provisioningState":"Succeeded","aggregateState":"NotSpecified","extensionParameters":{"type":"MicrosoftMonitoringAgent","publisher":"Microsoft.Compute","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"workspaceId":"xx","port":"6516"}},"managedBy":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - "862" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:27 GMT + etag: + - '"d101e9e5-0000-0100-0000-64ec48630000"' + expires: + - "-1" + mise-correlation-id: + - cc407c22-18de-46e2-91a3-07e40b3caffe + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-writes: + - "1199" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm extension list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name --arc-setting-name + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions?api-version=2023-03-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent","name":"MicrosoftMonitoringAgent","type":"microsoft.azurestackhci/clusters/arcsettings/extensions","properties":{"provisioningState":"Succeeded","aggregateState":"NotSpecified","perNodeExtensionDetails":[],"extensionParameters":{"type":"MicrosoftMonitoringAgent","publisher":"Microsoft.Compute","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"workspaceId":"xx","port":"6516"}},"managedBy":"User"}}]}' + headers: + cache-control: + - no-cache + content-length: + - "659" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:29 GMT + expires: + - "-1" + mise-correlation-id: + - bbdc371d-7107-4a0e-ac3c-f8f91e536750 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm extension show + Connection: + - keep-alive + ParameterSetName: + - -n -g --cluster-name --arc-setting-name + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent?api-version=2023-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent","name":"MicrosoftMonitoringAgent","type":"microsoft.azurestackhci/clusters/arcsettings/extensions","properties":{"provisioningState":"Succeeded","aggregateState":"NotSpecified","perNodeExtensionDetails":[],"extensionParameters":{"type":"MicrosoftMonitoringAgent","publisher":"Microsoft.Compute","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"workspaceId":"xx","port":"6516"}},"managedBy":"User"}}' + headers: + cache-control: + - no-cache + content-length: + - "647" + content-type: + - application/json; charset=utf-8 + date: + - Mon, 28 Aug 2023 07:10:33 GMT + etag: + - '"d101e9e5-0000-0100-0000-64ec48630000"' + expires: + - "-1" + mise-correlation-id: + - 87727d91-66e0-4159-90dd-774233e1154f + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + CommandName: + - stack-hci-vm extension delete + Connection: + - keep-alive + Content-Length: + - "0" + ParameterSetName: + - -n -g --cluster-name --arc-setting-name --no-wait --yes + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent?api-version=2023-03-01 + response: + body: + string: "" + headers: + cache-control: + - no-cache + content-length: + - "0" + date: + - Mon, 28 Aug 2023 07:10:35 GMT + expires: + - "-1" + mise-correlation-id: + - c2505f20-5cbe-4bf5-9e9f-fe933e2d4963 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - "True" + x-ms-ratelimit-remaining-subscription-deletes: + - "14999" + status: + code: 200 + message: OK +version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py new file mode 100644 index 00000000000..b2fe84ec243 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py @@ -0,0 +1,141 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +import json + +from azure.cli.testsdk import ( + ResourceGroupPreparer, + ScenarioTest +) + + +class StackHciClientTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_cluster', location='eastus') + def test_stack_hci_cluster_crud(self): + self.kwargs.update({ + 'cluster_name': self.create_random_name('cluster', 15), + 'app_name': self.create_random_name('app', 15) + }) + self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] + self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] + + cluster = self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id} --tags key0=value0 --mi-system-assigned', checks=[ + self.check('name', '{cluster_name}'), + self.check('tags', {'key0': 'value0'}), + self.check('type', 'microsoft.azurestackhci/clusters'), + self.check('identity.type', 'SystemAssigned') + ]).get_output_in_json() + self.kwargs.update({ + 'cluster_id': cluster['id'] + }) + self.cmd('stack-hci-vm cluster create-identity --cluster-name {cluster_name} -g {rg}') + self.cmd('stack-hci-vm cluster list -g {rg}', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', '{cluster_name}'), + self.check('[0].identity.type', 'SystemAssigned'), + self.check('[0].type', 'microsoft.azurestackhci/clusters') + ]) + self.cmd('stack-hci-vm cluster update -n {cluster_name} -g {rg} --tags key0=value1') + self.cmd('stack-hci-vm cluster show -n {cluster_name} -g {rg}', checks=[ + self.check('name', '{cluster_name}'), + self.check('tags', {'key0': 'value1'}), + self.check('type', 'microsoft.azurestackhci/clusters'), + self.exists('aadApplicationObjectId'), + self.exists('aadServicePrincipalObjectId') + ]) + self.cmd('stack-hci-vm cluster show --ids {cluster_id}', checks=[ + self.check('name', '{cluster_name}'), + self.check('tags', {'key0': 'value1'}), + self.check('type', 'microsoft.azurestackhci/clusters'), + self.exists('aadApplicationObjectId'), + self.exists('aadServicePrincipalObjectId') + ]) + self.cmd('stack-hci-vm cluster delete -n {cluster_name} -g {rg} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_arc_setting', location='eastus') + def test_stack_hci_arc_setting_crud(self): + self.kwargs.update({ + 'cluster_name': self.create_random_name('cluster', 15), + 'app_name': self.create_random_name('app', 15) + }) + self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] + self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] + self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id}') + + self.cmd('stack-hci-vm arc-setting create -n default -g {rg} --cluster-name {cluster_name}', checks=[ + self.check('name', 'default'), + self.check('type', 'microsoft.azurestackhci/clusters/arcsettings') + ]) + self.cmd('stack-hci-vm arc-setting create-identity -n default --cluster-name {cluster_name} -g {rg}') + self.cmd('stack-hci-vm arc-setting consent-and-install-default-extension -g {rg} --arc-setting-name default --cluster-name {cluster_name}', checks=[ + self.check('name', 'default'), + self.check('type', 'microsoft.azurestackhci/clusters/arcsettings'), + self.check('defaultExtensions[0].category', 'ProductQualityAndSupport') + ]) + self.cmd('stack-hci-vm arc-setting initialize-disable-proces -g {rg} --arc-setting-name default --cluster-name {cluster_name}') + self.cmd('stack-hci-vm arc-setting list -g {rg} --cluster-name {cluster_name}', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', 'default') + ]) + self.cmd('stack-hci-vm arc-setting show -n default -g {rg} --cluster-name {cluster_name}', checks=[ + self.check('name', 'default'), + self.check('type', 'microsoft.azurestackhci/clusters/arcsettings') + ]) + self.cmd('stack-hci-vm arc-setting generate-password -n default --cluster-name {cluster_name} -g {rg}', checks=[ + self.exists('secretText') + ]) + self.cmd('stack-hci-vm arc-setting delete -n default -g {rg} --cluster-name {cluster_name} --no-wait --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_extension', location='eastus') + def test_stack_hci_extension_crud(self): + self.kwargs.update({ + 'cluster_name': self.create_random_name('cluster', 15), + 'app_name': self.create_random_name('app', 15), + 'type': 'MicrosoftMonitoringAgent', + 'publisher': 'Microsoft.Compute' + }) + self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] + self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] + self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id}') + self.cmd('stack-hci-vm arc-setting create -n default -g {rg} --cluster-name {cluster_name}') + self.cmd('stack-hci-vm extension create -n {type} -g {rg} --cluster-name {cluster_name} --arc-setting-name default --settings "{{\'workspaceId\': \'xx\', \'port\': \'6516\'}}" --protected-settings "{{\'workspaceKey\': \'xx\'}}" --publisher {publisher} --type {type} --type-handler-version 1.10', checks=[ + self.check('name', self.kwargs['type']), + self.check('type', 'microsoft.azurestackhci/clusters/arcsettings/extensions'), + self.check('extensionParameters.settings.workspaceId', 'xx'), + self.check('extensionParameters.settings.port', '6516') + ]) + self.cmd('stack-hci-vm extension list -g {rg} --cluster-name {cluster_name} --arc-setting-name default', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', self.kwargs['type']) + ]) + self.cmd('stack-hci-vm extension show -n {type} -g {rg} --cluster-name {cluster_name} --arc-setting-name default', checks=[ + self.check('name', self.kwargs['type']), + self.check('type', 'microsoft.azurestackhci/clusters/arcsettings/extensions') + ]) + self.cmd('stack-hci-vm extension delete -n {type} -g {rg} --cluster-name {cluster_name} --arc-setting-name default --no-wait --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_cluster', location='eastus') + def test_stack_hci_cluster_identity(self): + self.kwargs.update({ + 'cluster_name': self.create_random_name('cluster', 15), + 'cluster_name1': self.create_random_name('cluster', 15), + 'app_name': self.create_random_name('app', 15) + }) + self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] + self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] + + self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id} --tags key0=value0 --mi-system-assigned', checks=[ + self.check('identity.type', 'SystemAssigned') + ]) + self.cmd('stack-hci-vm cluster create -n {cluster_name1} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id}') + self.cmd('stack-hci-vm cluster identity assign --cluster-name {cluster_name1} -g {rg} --system-assigned', checks=[ + self.check('type', 'SystemAssigned') + ]) + self.cmd('stack-hci-vm cluster identity remove --cluster-name {cluster_name1} -g {rg} --system-assigned', checks=[ + self.check('type', 'None') + ]) diff --git a/src/stack-hci-vm/linter_exclusions.yml b/src/stack-hci-vm/linter_exclusions.yml new file mode 100644 index 00000000000..cc050b12dbb --- /dev/null +++ b/src/stack-hci-vm/linter_exclusions.yml @@ -0,0 +1,15 @@ +stack-hci-vm cluster create: + parameters: + user_assigned_identities: + rule_exclusions: + - option_length_too_long +stack-hci-vm cluster update: + parameters: + user_assigned_identities: + rule_exclusions: + - option_length_too_long +stack-hci-vm cluster extend-software-assurance-benefit: + parameters: + software_assurance_intent: + rule_exclusions: + - option_length_too_long diff --git a/src/stack-hci-vm/setup.cfg b/src/stack-hci-vm/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/stack-hci-vm/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/stack-hci-vm/setup.py b/src/stack-hci-vm/setup.py new file mode 100644 index 00000000000..1b5f4bafd34 --- /dev/null +++ b/src/stack-hci-vm/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '1.0.0' +try: + from azext_stack_hci.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_stack_hci.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='stack_hci', + version=VERSION, + description='Microsoft Azure Command-Line Tools AzureStackHCIClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/stack-hci-vm', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_stack_hci': ['azext_metadata.json']}, +) From 3b1d91e4c5d48a6633015e87f064b3e0a1d20850 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 08:41:23 -0500 Subject: [PATCH 02/21] Add stack HCI VM source code --- src/stack-hci-vm/README.md | 260 +- src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO | 218 ++ .../azext_stack_hci_vm/__init__.py | 42 - src/stack-hci-vm/azext_stack_hci_vm/_help.py | 11 - .../azext_stack_hci_vm/_params.py | 13 - .../azext_stack_hci_vm/aaz/__init__.py | 6 - .../azext_stack_hci_vm/aaz/latest/__init__.py | 6 - .../aaz/latest/stack_hci/__cmd_group.py | 23 - .../stack_hci/arc_setting/__cmd_group.py | 23 - .../latest/stack_hci/arc_setting/__init__.py | 21 - .../_consent_and_install_default_extension.py | 276 -- .../latest/stack_hci/arc_setting/_create.py | 341 --- .../stack_hci/arc_setting/_create_identity.py | 208 -- .../latest/stack_hci/arc_setting/_delete.py | 173 -- .../arc_setting/_generate_password.py | 188 -- .../arc_setting/_initialize_disable_proces.py | 160 - .../aaz/latest/stack_hci/arc_setting/_list.py | 277 -- .../aaz/latest/stack_hci/arc_setting/_show.py | 276 -- .../latest/stack_hci/arc_setting/_update.py | 459 --- .../aaz/latest/stack_hci/arc_setting/_wait.py | 272 -- .../latest/stack_hci/cluster/__cmd_group.py | 23 - .../aaz/latest/stack_hci/cluster/__init__.py | 19 - .../aaz/latest/stack_hci/cluster/_create.py | 554 ---- .../stack_hci/cluster/_create_identity.py | 198 -- .../aaz/latest/stack_hci/cluster/_delete.py | 163 - .../_extend_software_assurance_benefit.py | 468 --- .../aaz/latest/stack_hci/cluster/_list.py | 775 ----- .../aaz/latest/stack_hci/cluster/_show.py | 423 --- .../aaz/latest/stack_hci/cluster/_update.py | 657 ---- .../aaz/latest/stack_hci/cluster/_wait.py | 419 --- .../stack_hci/cluster/identity/__cmd_group.py | 23 - .../stack_hci/cluster/identity/_assign.py | 605 ---- .../stack_hci/cluster/identity/_remove.py | 607 ---- .../latest/stack_hci/extension/__cmd_group.py | 23 - .../latest/stack_hci/extension/__init__.py | 16 - .../aaz/latest/stack_hci/extension/_create.py | 389 --- .../aaz/latest/stack_hci/extension/_delete.py | 183 -- .../aaz/latest/stack_hci/extension/_list.py | 302 -- .../aaz/latest/stack_hci/extension/_show.py | 300 -- .../aaz/latest/stack_hci/extension/_wait.py | 296 -- .../azext_azurestackhci/__init__.py | 50 + .../azext_azurestackhci/action.py | 17 + .../azext_azurestackhci/azext_metadata.json | 4 + .../azext_azurestackhci/custom.py | 17 + .../generated}/__init__.py | 0 .../generated/_client_factory.py | 47 + .../azext_azurestackhci/generated/_help.py | 794 +++++ .../azext_azurestackhci/generated/_params.py | 430 +++ .../generated/_validators.py | 279 ++ .../azext_azurestackhci/generated/action.py | 353 +++ .../azext_azurestackhci/generated/commands.py | 145 + .../azext_azurestackhci/generated/custom.py | 847 ++++++ .../azext_azurestackhci/generated/helpers.py | 20 + .../azext_azurestackhci/manual/__init__.py | 12 + .../tests/__init__.py | 0 .../tests/latest/__init__.py | 12 + .../tests/latest/example_steps.py | 503 +++ .../latest/test_azurestackhci_scenario.py | 169 ++ .../vendored_sdks/__init__.py | 12 + .../vendored_sdks/azurestackhci/__init__.py | 19 + .../azurestackhci/_azure_stack_hci.py | 109 + .../azurestackhci/_azure_stack_hci_client.py | 89 + .../azurestackhci/_configuration.py | 48 + .../azurestackhci/aio}/__init__.py | 15 +- .../azurestackhci/aio/_azure_stack_hci.py | 103 + .../azurestackhci/aio/_configuration.py | 66 + .../azurestackhci/aio/operations/__init__.py | 29 + .../_arc_vmextensions_operations.py | 537 ++++ .../aio/operations/_clusters_operations.py | 429 +++ .../operations/_galleryimages_operations.py | 497 +++ .../_networkinterfaces_operations.py | 497 +++ .../aio/operations/_operations.py | 88 + .../_storagecontainers_operations.py | 497 +++ .../_virtualharddisks_operations.py | 497 +++ .../operations/_virtualmachines_operations.py | 609 ++++ .../operations/_virtualnetworks_operations.py | 497 +++ .../azurestackhci/models/__init__.py | 307 ++ .../models/_azure_stack_hci_client_enums.py | 36 + .../models/_azure_stack_hci_enums.py | 56 + .../azurestackhci/models/_models.py | 2678 ++++++++++++++++ .../azurestackhci/models/_models_py3.py | 2691 +++++++++++++++++ .../azurestackhci/models/_paged_models.py | 117 + .../azurestackhci/operations/__init__.py | 32 + .../_arc_vmextensions_operations.py | 490 +++ .../operations/_clusters_operations.py | 432 +++ .../operations/_galleryimages_operations.py | 728 +++++ .../_networkinterfaces_operations.py | 470 +++ .../azurestackhci/operations/_operations.py | 89 + .../_storagecontainers_operations.py | 470 +++ .../_virtualharddisks_operations.py | 470 +++ .../operations/_virtualmachines_operations.py | 816 +++++ .../operations/_virtualnetworks_operations.py | 470 +++ .../vendored_sdks/azurestackhci/version.py} | 18 +- .../azext_stack_hci_vm/azext_metadata.json | 3 - .../azext_stack_hci_vm/commands.py | 21 - src/stack-hci-vm/azext_stack_hci_vm/custom.py | 77 - .../test_stack_hci_arc_setting_crud.yaml | 771 ----- .../test_stack_hci_cluster_crud.yaml | 894 ------ .../test_stack_hci_cluster_identity.yaml | 544 ---- .../test_stack_hci_extension_crud.yaml | 481 --- .../tests/latest/test_stack_hci_commands.py | 141 - src/stack-hci-vm/setup.cfg | 5 +- src/stack-hci-vm/setup.py | 22 +- 103 files changed, 19092 insertions(+), 12270 deletions(-) create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/_help.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/_params.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py rename src/stack-hci-vm/azext_stack_hci_vm/{tests/latest => azext_azurestackhci/generated}/__init__.py (100%) create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py rename src/stack-hci-vm/azext_stack_hci_vm/{ => azext_azurestackhci}/tests/__init__.py (100%) create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py rename src/stack-hci-vm/azext_stack_hci_vm/{aaz/latest/stack_hci => azext_azurestackhci/vendored_sdks/azurestackhci/aio}/__init__.py (52%) create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py create mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py rename src/stack-hci-vm/azext_stack_hci_vm/{aaz/latest/stack_hci/cluster/identity/__init__.py => azext_azurestackhci/vendored_sdks/azurestackhci/version.py} (50%) delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/commands.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/custom.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py diff --git a/src/stack-hci-vm/README.md b/src/stack-hci-vm/README.md index 1be0316c961..90628c91a1f 100644 --- a/src/stack-hci-vm/README.md +++ b/src/stack-hci-vm/README.md @@ -1,135 +1,207 @@ -# Azure CLI stack-hci-vm Extension - -This is the extension for stack-hci-vm - -### How to use +# Azure CLI azurestackhci Extension # +This is the extension for azurestackhci +### How to use ### Install this extension using the below CLI command - ``` -az extension add --name stack-hci-vm +az extension add --name azurestackhci ``` -### Included Features - -#### stack-hci-vm arc-setting - -##### Create - +### Included Features ### +#### azurestackhci galleryimage #### +##### Create ##### ``` -az stack-hci-vm arc-setting create --name "default" --cluster-name "myCluster" --resource-group "test-rg" +az azurestackhci galleryimage create \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --container-name "Default_Container" --image-path "C:\\\\test.vhdx" \ + --galleryimages-name "test-gallery-image" --resource-group "test-rg" ``` - -##### Show - +##### List ##### ``` -az stack-hci-vm arc-setting show --name "default" --cluster-name "myCluster" --resource-group "test-rg" +az azurestackhci galleryimage list --resource-group "test-rg" ``` - -##### List - +##### Update ##### ``` -az stack-hci-vm arc-setting list --cluster-name "myCluster" --resource-group "test-rg" +az azurestackhci galleryimage update --tags additionalProperties="sample" --galleryimages-name "test-gallery-image" \ + --resource-group "test-rg" ``` - -##### Update - +##### Retrieve ##### ``` -az stack-hci-vm arc-setting update --connectivity-properties "{\\"enabled\\":true}" --name "default" \ - --cluster-name "myCluster" --resource-group "test-rg" +az azurestackhci galleryimage retrieve --galleryimages-name "test-gallery-image" --resource-group "test-rg" ``` - -##### Create-identity - +##### Delete ##### ``` -az stack-hci-vm arc-setting create-identity --name "default" --cluster-name "myCluster" --resource-group "test-rg" +az azurestackhci galleryimage delete --galleryimages-name "test-gallery-image" --resource-group "test-rg" ``` +#### azurestackhci networkinterface #### +##### Create ##### +``` +az azurestackhci networkinterface create \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --name "test-nic" + --location "West US2" \ + --subnet-id" "test-vnet" --gateway "1.2.3.4" --ip-address "1.2.3.4" -##### Generate-password +OR +az azurestackhci networkinterface create \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" \ + --ip-configurations "[{\"name\":\"ipconfig-sample\",\"properties\":{\"subnet\":{\"id\":\"test-vnet\"}, \"gateway\":\"1.2.3.4\", \"ip_address\":\"1.2.3.4\"}}]" \ + --networkinterfaces-name "test-nic" ``` -az stack-hci-vm arc-setting generate-password --name "default" --cluster-name "myCluster" --resource-group "test-rg" +##### List ##### ``` - -##### Delete - +az azurestackhci networkinterface list --resource-group "test-rg" ``` -az stack-hci-vm arc-setting delete --name "default" --cluster-name "myCluster" --resource-group "test-rg" +##### Update ##### ``` - -#### stack-hci-vm cluster - -##### Create - +az azurestackhci networkinterface update --tags additionalProperties="sample" --networkinterfaces-name "test-nic" \ + --resource-group "test-rg" ``` -az stack-hci-vm cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" \ - --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" \ - --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" --name "myCluster" \ - --resource-group "test-rg" +##### Retrieve ##### ``` - -##### Show - +az azurestackhci networkinterface retrieve --networkinterfaces-name "test-nic" --resource-group "test-rg" ``` -az stack-hci-vm cluster show --name "myCluster" --resource-group "test-rg" +##### Delete ##### ``` - -##### List - +az azurestackhci networkinterface delete --networkinterfaces-name "test-nic" --resource-group "test-rg" ``` -az stack-hci-vm cluster list --resource-group "test-rg" +#### azurestackhci virtualharddisk #### +##### Create ##### ``` - -##### Update - +az azurestackhci virtualharddisk create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --disk-size-gb 32 --virtualharddisks-name "test-vhd" ``` -az stack-hci-vm cluster update --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" \ - --desired-properties diagnostic-level="Basic" windows-server-subscription="Enabled" \ - --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group "test-rg" +##### List ##### ``` - -##### Create-identity - +az azurestackhci virtualharddisk list --resource-group "test-rg" ``` -az stack-hci-vm cluster create-identity --name "myCluster" --resource-group "test-rg" +##### Update ##### ``` - -##### Delete - +az azurestackhci virtualharddisk update --resource-group "test-rg" --tags additionalProperties="sample" \ + --virtualharddisks-name "test-vhd" ``` -az stack-hci-vm cluster delete --name "myCluster" --resource-group "test-rg" +##### Retrieve ##### ``` - -#### stack-hci-vm extension - -##### Create - +az azurestackhci virtualharddisk retrieve --resource-group "test-rg" --virtualharddisks-name "test-vhd" ``` -az stack-hci-vm extension create --arc-setting-name "default" --cluster-name "myCluster" \ - --type "MicrosoftMonitoringAgent" --protected-settings "{\\"workspaceKey\\":\\"xx\\"}" \ - --publisher "Microsoft.Compute" --settings "{\\"workspaceId\\":\\"xx\\"}" --type-handler-version "1.10" \ - --name "MicrosoftMonitoringAgent" --resource-group "test-rg" - -az stack-hci-vm extension wait --created --arc-setting-name "{myArcSetting}" --cluster-name "{myCluster}" \ - --name "{myExtension}" --resource-group "{rg}" +##### Delete ##### ``` - -##### Show - +az azurestackhci virtualharddisk delete --resource-group "test-rg" --virtualharddisks-name "test-vhd" ``` -az stack-hci-vm extension show --arc-setting-name "default" --cluster-name "myCluster" --name "MicrosoftMonitoringAgent" \ - --resource-group "test-rg" +#### azurestackhci virtualmachine #### +##### Create ##### ``` - -##### List - +az azurestackhci virtualmachine create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --hardware-profile vm-size="Default" maximum_memory_mb=1 minimum_memory_mb=1 target_memory_buffer=100 --network-profile network-interfaces={"id":"test-nic"} \ + --os-profile "{\\"adminPassword\\":\\"password\\",\\"adminUsername\\":\\"localadmin\\",\\"computerName\\":\\"luamaster\\"}" \ + --storage-profile "{\\"imageReference\\":{\\"id\\":\\"test-gallery-image\\"}}" --virtualmachines-name "test-vm" + ----linux-configuration ssh_keys='{\"key_data\": \"ssh_public_key\"}' ssh_keys='{\"path\": \"/path/to/id_rsa.pub\"}' ``` -az stack-hci-vm extension list --arc-setting-name "default" --cluster-name "myCluster" --resource-group "test-rg" +##### List ##### ``` - -##### Delete - +az azurestackhci virtualmachine list --resource-group "test-rg" +``` +##### Update ##### +``` +az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" \ + --virtualmachines-name "test-vm" +``` +##### Retrieve ##### +``` +az azurestackhci virtualmachine retrieve --resource-group "test-rg" --virtualmachines-name "test-vm" +``` +##### Start ##### +``` +az azurestackhci virtualmachine start --resource-group "test-rg" --virtualmachines-name "test-vm" +``` +##### Stop ##### +``` +az azurestackhci virtualmachine stop --resource-group "test-rg" --virtualmachines-name "test-vm" +``` +##### Delete ##### +``` +az azurestackhci virtualmachine delete --resource-group "test-rg" --virtualmachines-name "test-vm" +``` +##### Add Vnic ##### +``` +az azurestackhci virtualmachine vnic add --resource-group "test-rg" --virtualmachines-name "test-vm" --vnic-name "test-vnic" +``` +##### Remove Vnic ##### +``` +az azurestackhci virtualmachine vnic remove --resource-group "test-rg" --virtualmachines-name "test-vm" --vnic-name "test-vnic" +``` +#### azurestackhci virtualnetwork #### +##### Create ##### +``` +az azurestackhci virtualnetwork create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --network-type "Transparent" ---name "test-vnet" --address-prefix "10.0.0.0/16" \ + --ip-allocation-method "Static" --ip-pool-type "Static" --ip-pool-start "10.0.0.0" ip-pool-end "10.0.0.16" --vlan 10" +``` +##### List ##### +``` +az azurestackhci virtualnetwork list --resource-group "test-rg" +``` +##### Update ##### +``` +az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" \ + --virtualnetworks-name "test-vnet" +``` +##### Retrieve ##### +``` +az azurestackhci virtualnetwork retrieve --resource-group "test-rg" --virtualnetworks-name "test-vnet" +``` +##### Delete ##### +``` +az azurestackhci virtualnetwork delete --resource-group "test-rg" --virtualnetworks-name "test-vnet" +``` +#### azurestackhci storagecontainer #### +##### Create ##### +``` +az azurestackhci storagecontainer create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --path "C:\\\\container_storage" --storagecontainers-name "Default_Container" +``` +##### List ##### +``` +az azurestackhci storagecontainer list --resource-group "test-rg" +``` +##### Update ##### +``` +az azurestackhci storagecontainer update --resource-group "test-rg" --tags additionalProperties="sample" \ + --storagecontainers-name "Default_Container" +``` +##### Retrieve ##### +``` +az azurestackhci storagecontainer retrieve --resource-group "test-rg" --storagecontainers-name "Default_Container" +``` +##### Delete ##### +``` +az azurestackhci storagecontainer delete --resource-group "test-rg" --storagecontainers-name "Default_Container" +``` +#### azurestackhci cluster #### +##### Create ##### +``` +az azurestackhci cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" \ + --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --name "myCluster" --resource-group "test-rg" +``` +##### Show ##### +``` +az azurestackhci cluster show --name "myCluster" --resource-group "test-rg" +``` +##### List ##### +``` +az azurestackhci cluster list --resource-group "test-rg" +``` +##### Update ##### +``` +az azurestackhci cluster update --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group "test-rg" ``` -az stack-hci-vm extension delete --arc-setting-name "default" --cluster-name "myCluster" \ - --name "MicrosoftMonitoringAgent" --resource-group "test-rg" +##### Delete ##### ``` +az azurestackhci cluster delete --name "myCluster" --resource-group "test-rg" +``` \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO b/src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO new file mode 100644 index 00000000000..0ed5616d93e --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO @@ -0,0 +1,218 @@ +Metadata-Version: 2.1 +Name: azurestackhci +Version: 0.2.9 +Summary: Microsoft Azure Command-Line Tools AzureStackHCI Extension +Home-page: https://github.com/Azure/azure-cli-extensions/tree/master/src/azurestackhci +Author: Microsoft Corporation +Author-email: azpycli@microsoft.com +License: MIT +Description: # Azure CLI azurestackhci Extension # + This is the extension for azurestackhci + + ### How to use ### + Install this extension using the below CLI command + ``` + az extension add --name azurestackhci + ``` + + ### Included Features ### + #### azurestackhci galleryimage #### + ##### Create ##### + ``` + az azurestackhci galleryimage create \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --container-name "Default_Container" --image-path "C:\\\\test.vhdx" \ + --galleryimages-name "test-gallery-image" --resource-group "test-rg" + ``` + ##### List ##### + ``` + az azurestackhci galleryimage list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci galleryimage update --tags additionalProperties="sample" --galleryimages-name "test-gallery-image" \ + --resource-group "test-rg" + ``` + ##### Retrieve ##### + ``` + az azurestackhci galleryimage retrieve --galleryimages-name "test-gallery-image" --resource-group "test-rg" + ``` + ##### Delete ##### + ``` + az azurestackhci galleryimage delete --galleryimages-name "test-gallery-image" --resource-group "test-rg" + ``` + #### azurestackhci networkinterface #### + ##### Create ##### + ``` + az azurestackhci networkinterface create \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" \ + --ip-configurations "[{\\"name\\":\\"ipconfig-sample\\",\\"properties\\":{\\"subnet\\":{\\"id\\":\\"test-vnet\\"}, \\"gateway\\":\\"1.2.3.4\\", \\"privateIPAddress\\":\\"1.2.3.4\\", \\"privateIPAllocationMethod\\":\\"Static\\"}}]" \ + --networkinterfaces-name "test-nic" --resource-group "test-rg" + ``` + ##### List ##### + ``` + az azurestackhci networkinterface list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci networkinterface update --tags additionalProperties="sample" --networkinterfaces-name "test-nic" \ + --resource-group "test-rg" + ``` + ##### Retrieve ##### + ``` + az azurestackhci networkinterface retrieve --networkinterfaces-name "test-nic" --resource-group "test-rg" + ``` + ##### Delete ##### + ``` + az azurestackhci networkinterface delete --networkinterfaces-name "test-nic" --resource-group "test-rg" + ``` + #### azurestackhci virtualharddisk #### + ##### Create ##### + ``` + az azurestackhci virtualharddisk create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --disk-size-gb 32 --virtualharddisks-name "test-vhd" + ``` + ##### List ##### + ``` + az azurestackhci virtualharddisk list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci virtualharddisk update --resource-group "test-rg" --tags additionalProperties="sample" \ + --virtualharddisks-name "test-vhd" + ``` + ##### Retrieve ##### + ``` + az azurestackhci virtualharddisk retrieve --resource-group "test-rg" --virtualharddisks-name "test-vhd" + ``` + ##### Delete ##### + ``` + az azurestackhci virtualharddisk delete --resource-group "test-rg" --virtualharddisks-name "test-vhd" + ``` + #### azurestackhci virtualmachine #### + ##### Create ##### + ``` + az azurestackhci virtualmachine create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --hardware-profile vm-size="Default" --network-profile network-interfaces={"id":"test-nic"} \ + --os-profile "{\\"adminPassword\\":\\"password\\",\\"adminUsername\\":\\"localadmin\\",\\"computerName\\":\\"luamaster\\"}" \ + --storage-profile "{\\"imageReference\\":{\\"id\\":\\"test-gallery-image\\"}}" --virtualmachines-name "test-vm" + ``` + ##### List ##### + ``` + az azurestackhci virtualmachine list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" \ + --virtualmachines-name "test-vm" + ``` + ##### Retrieve ##### + ``` + az azurestackhci virtualmachine retrieve --resource-group "test-rg" --virtualmachines-name "test-vm" + ``` + ##### Start ##### + ``` + az azurestackhci virtualmachine start --resource-group "test-rg" --virtualmachines-name "test-vm" + ``` + ##### Stop ##### + ``` + az azurestackhci virtualmachine stop --resource-group "test-rg" --virtualmachines-name "test-vm" + ``` + ##### Delete ##### + ``` + az azurestackhci virtualmachine delete --resource-group "test-rg" --virtualmachines-name "test-vm" + ``` + #### azurestackhci virtualnetwork #### + ##### Create ##### + ``` + az azurestackhci virtualnetwork create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --network-type "Transparent" --virtualnetworks-name "test-vnet" + --vlan 10 + ``` + ##### List ##### + ``` + az azurestackhci virtualnetwork list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" \ + --virtualnetworks-name "test-vnet" + ``` + ##### Retrieve ##### + ``` + az azurestackhci virtualnetwork retrieve --resource-group "test-rg" --virtualnetworks-name "test-vnet" + ``` + ##### Delete ##### + ``` + az azurestackhci virtualnetwork delete --resource-group "test-rg" --virtualnetworks-name "test-vnet" + ``` + #### azurestackhci storagecontainer #### + ##### Create ##### + ``` + az azurestackhci storagecontainer create --resource-group "test-rg" \ + --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ + --location "West US2" --path "C:\\\\container_storage" --storagecontainers-name "Default_Container" + ``` + ##### List ##### + ``` + az azurestackhci storagecontainer list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci storagecontainer update --resource-group "test-rg" --tags additionalProperties="sample" \ + --storagecontainers-name "Default_Container" + ``` + ##### Retrieve ##### + ``` + az azurestackhci storagecontainer retrieve --resource-group "test-rg" --storagecontainers-name "Default_Container" + ``` + ##### Delete ##### + ``` + az azurestackhci storagecontainer delete --resource-group "test-rg" --storagecontainers-name "Default_Container" + ``` + #### azurestackhci cluster #### + ##### Create ##### + ``` + az azurestackhci cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" \ + --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --name "myCluster" --resource-group "test-rg" + ``` + ##### Show ##### + ``` + az azurestackhci cluster show --name "myCluster" --resource-group "test-rg" + ``` + ##### List ##### + ``` + az azurestackhci cluster list --resource-group "test-rg" + ``` + ##### Update ##### + ``` + az azurestackhci cluster update --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group "test-rg" + ``` + ##### Delete ##### + ``` + az azurestackhci cluster delete --name "myCluster" --resource-group "test-rg" + ``` + + .. :changelog: + + Release History + =============== + + 0.1.0 + ++++++ + * Initial release. + +Platform: UNKNOWN +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: System Administrators +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: License :: OSI Approved :: MIT License diff --git a/src/stack-hci-vm/azext_stack_hci_vm/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/__init__.py deleted file mode 100644 index d2ef95e351a..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -from azure.cli.core import AzCommandsLoader -from azext_stack_hci._help import helps # pylint: disable=unused-import - - -class AzureStackHCICommandsLoader(AzCommandsLoader): - - def __init__(self, cli_ctx=None): - from azure.cli.core.commands import CliCommandType - custom_command_type = CliCommandType( - operations_tmpl='azext_stack_hci.custom#{}') - super().__init__(cli_ctx=cli_ctx, - custom_command_type=custom_command_type) - - def load_command_table(self, args): - from azext_stack_hci.commands import load_command_table - from azure.cli.core.aaz import load_aaz_command_table - try: - from . import aaz - except ImportError: - aaz = None - if aaz: - load_aaz_command_table( - loader=self, - aaz_pkg_name=aaz.__name__, - args=args - ) - load_command_table(self, args) - return self.command_table - - def load_arguments(self, command): - from azext_stack_hci._params import load_arguments - load_arguments(self, command) - - -COMMAND_LOADER_CLS = AzureStackHCICommandsLoader diff --git a/src/stack-hci-vm/azext_stack_hci_vm/_help.py b/src/stack-hci-vm/azext_stack_hci_vm/_help.py deleted file mode 100644 index 126d5d00714..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/_help.py +++ /dev/null @@ -1,11 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -# pylint: disable=too-many-lines - -from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/stack-hci-vm/azext_stack_hci_vm/_params.py b/src/stack-hci-vm/azext_stack_hci_vm/_params.py deleted file mode 100644 index cfcec717c9c..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: disable=too-many-lines -# pylint: disable=too-many-statements - - -def load_arguments(self, _): # pylint: disable=unused-argument - pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py deleted file mode 100644 index 5757aea3175..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py deleted file mode 100644 index 5757aea3175..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py deleted file mode 100644 index 077d618e907..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "stack-hci-vm", -) -class __CMDGroup(AAZCommandGroup): - """Manage Azure Stack HCI. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py deleted file mode 100644 index 32f08cc4deb..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "stack-hci-vm arc-setting", -) -class __CMDGroup(AAZCommandGroup): - """Manage arc setting with stack hci. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py deleted file mode 100644 index 57c54ad53e5..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._consent_and_install_default_extension import * -from ._create import * -from ._create_identity import * -from ._delete import * -from ._generate_password import * -from ._initialize_disable_proces import * -from ._list import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py deleted file mode 100644 index 61622ac9184..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_consent_and_install_default_extension.py +++ /dev/null @@ -1,276 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting consent-and-install-default-extension", -) -class ConsentAndInstallDefaultExtension(AAZCommand): - """Add consent time for default extensions and initiate extensions installation - - :example: Consent and install default extension - az stack-hci-vm arc-setting consent-and-install-default-extension -g rg --arc-setting-name default --cluster-name name - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/consentandinstalldefaultextensions", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsConsentAndInstallDefaultExtensions(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ArcSettingsConsentAndInstallDefaultExtensions(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_instance_resource_group = AAZStrType( - serialized_name="arcInstanceResourceGroup", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - properties.connectivity_properties = AAZObjectType( - serialized_name="connectivityProperties", - ) - properties.default_extensions = AAZListType( - serialized_name="defaultExtensions", - flags={"read_only": True}, - ) - properties.per_node_details = AAZListType( - serialized_name="perNodeDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - connectivity_properties = cls._schema_on_200.properties.connectivity_properties - connectivity_properties.enabled = AAZBoolType() - - default_extensions = cls._schema_on_200.properties.default_extensions - default_extensions.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.default_extensions.Element - _element.category = AAZStrType( - flags={"read_only": True}, - ) - _element.consent_time = AAZStrType( - serialized_name="consentTime", - flags={"read_only": True}, - ) - - per_node_details = cls._schema_on_200.properties.per_node_details - per_node_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.per_node_details.Element - _element.arc_instance = AAZStrType( - serialized_name="arcInstance", - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _ConsentAndInstallDefaultExtensionHelper: - """Helper class for ConsentAndInstallDefaultExtension""" - - -__all__ = ["ConsentAndInstallDefaultExtension"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py deleted file mode 100644 index 35010669d62..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create.py +++ /dev/null @@ -1,341 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting create", -) -class Create(AAZCommand): - """Create arc setting for HCI cluster. - - :example: Create arc setting - az stack-hci-vm arc-setting create --name "default" --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.arc_application_client_id = AAZStrArg( - options=["--arc-application-client-id"], - arg_group="Properties", - help="App id of arc AAD identity.", - ) - _args_schema.arc_application_object_id = AAZStrArg( - options=["--arc-application-object-id"], - arg_group="Properties", - help="Object id of arc AAD identity.", - ) - _args_schema.arc_application_tenant_id = AAZStrArg( - options=["--arc-application-tenant-id"], - arg_group="Properties", - help="Tenant id of arc AAD identity.", - ) - _args_schema.arc_instance_rg = AAZStrArg( - options=["--arc-instance-rg"], - arg_group="Properties", - help="The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources.", - ) - _args_schema.arc_service_principal_object_id = AAZStrArg( - options=["--arc-service-principal-object-id"], - arg_group="Properties", - help="Object id of arc AAD service principal.", - ) - _args_schema.connectivity_properties = AAZObjectArg( - options=["--connectivity-properties"], - arg_group="Properties", - help="contains connectivity related configuration for ARC resources", - ) - - connectivity_properties = cls._args_schema.connectivity_properties - connectivity_properties.enabled = AAZBoolArg( - options=["enabled"], - help="True indicates ARC connectivity is enabled", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ArcSettingsCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("arcApplicationClientId", AAZStrType, ".arc_application_client_id") - properties.set_prop("arcApplicationObjectId", AAZStrType, ".arc_application_object_id") - properties.set_prop("arcApplicationTenantId", AAZStrType, ".arc_application_tenant_id") - properties.set_prop("arcInstanceResourceGroup", AAZStrType, ".arc_instance_rg") - properties.set_prop("arcServicePrincipalObjectId", AAZStrType, ".arc_service_principal_object_id") - properties.set_prop("connectivityProperties", AAZObjectType, ".connectivity_properties") - - connectivity_properties = _builder.get(".properties.connectivityProperties") - if connectivity_properties is not None: - connectivity_properties.set_prop("enabled", AAZBoolType, ".enabled") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_instance_resource_group = AAZStrType( - serialized_name="arcInstanceResourceGroup", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - properties.connectivity_properties = AAZObjectType( - serialized_name="connectivityProperties", - ) - properties.default_extensions = AAZListType( - serialized_name="defaultExtensions", - flags={"read_only": True}, - ) - properties.per_node_details = AAZListType( - serialized_name="perNodeDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - connectivity_properties = cls._schema_on_200.properties.connectivity_properties - connectivity_properties.enabled = AAZBoolType() - - default_extensions = cls._schema_on_200.properties.default_extensions - default_extensions.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.default_extensions.Element - _element.category = AAZStrType( - flags={"read_only": True}, - ) - _element.consent_time = AAZStrType( - serialized_name="consentTime", - flags={"read_only": True}, - ) - - per_node_details = cls._schema_on_200.properties.per_node_details - per_node_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.per_node_details.Element - _element.arc_instance = AAZStrType( - serialized_name="arcInstance", - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py deleted file mode 100644 index 34fff9d77d3..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_create_identity.py +++ /dev/null @@ -1,208 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting create-identity", -) -class CreateIdentity(AAZCommand): - """Create AAD identity for arc settings. - - :example: Create arc identity - az stack-hci-vm arc-setting create-identity --name "default" --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/createarcidentity", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ArcSettingsCreateIdentity(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ArcSettingsCreateIdentity(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - - return cls._schema_on_200 - - -class _CreateIdentityHelper: - """Helper class for CreateIdentity""" - - -__all__ = ["CreateIdentity"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py deleted file mode 100644 index 7375ce04a8a..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_delete.py +++ /dev/null @@ -1,173 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete arc setting resource details of HCI cluster. - - :example: Delete arc setting - az stack-hci-vm arc-setting delete --name "default" --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ArcSettingsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class ArcSettingsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py deleted file mode 100644 index eeef6ef91c7..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_generate_password.py +++ /dev/null @@ -1,188 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting generate-password", -) -class GeneratePassword(AAZCommand): - """Generate password for arc settings. - - :example: Generate password - az stack-hci-vm arc-setting generate-password --name "default" --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/generatepassword", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsGeneratePassword(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ArcSettingsGeneratePassword(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType( - flags={"read_only": True}, - ) - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.end_date_time = AAZStrType( - serialized_name="endDateTime", - ) - _schema_on_200.key_id = AAZStrType( - serialized_name="keyId", - ) - _schema_on_200.secret_text = AAZStrType( - serialized_name="secretText", - ) - _schema_on_200.start_date_time = AAZStrType( - serialized_name="startDateTime", - ) - - return cls._schema_on_200 - - -class _GeneratePasswordHelper: - """Helper class for GeneratePassword""" - - -__all__ = ["GeneratePassword"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py deleted file mode 100644 index eab9ffbe990..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_initialize_disable_proces.py +++ /dev/null @@ -1,160 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting initialize-disable-proces", -) -class InitializeDisableProces(AAZCommand): - """Initialize ARC Disable process on the cluster - - :example: Initialize disable proces - az stack-hci-vm arc-setting initialize-disable-proces -g rg --arc-setting-name default --cluster-name name - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/initializedisableprocess", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ArcSettingsInitializeDisableProcess(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class ArcSettingsInitializeDisableProcess(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - -class _InitializeDisableProcesHelper: - """Helper class for InitializeDisableProces""" - - -__all__ = ["InitializeDisableProces"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py deleted file mode 100644 index 2bc4e4408fa..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_list.py +++ /dev/null @@ -1,277 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting list", -) -class List(AAZCommand): - """List arc setting resources of HCI cluster. - - :example: List arc setting resources by HCI cluster - az stack-hci-vm arc-setting list --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsListByCluster(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class ArcSettingsListByCluster(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType( - flags={"read_only": True}, - ) - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_instance_resource_group = AAZStrType( - serialized_name="arcInstanceResourceGroup", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - properties.connectivity_properties = AAZObjectType( - serialized_name="connectivityProperties", - ) - properties.default_extensions = AAZListType( - serialized_name="defaultExtensions", - flags={"read_only": True}, - ) - properties.per_node_details = AAZListType( - serialized_name="perNodeDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - connectivity_properties = cls._schema_on_200.value.Element.properties.connectivity_properties - connectivity_properties.enabled = AAZBoolType() - - default_extensions = cls._schema_on_200.value.Element.properties.default_extensions - default_extensions.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.default_extensions.Element - _element.category = AAZStrType( - flags={"read_only": True}, - ) - _element.consent_time = AAZStrType( - serialized_name="consentTime", - flags={"read_only": True}, - ) - - per_node_details = cls._schema_on_200.value.Element.properties.per_node_details - per_node_details.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.per_node_details.Element - _element.arc_instance = AAZStrType( - serialized_name="arcInstance", - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - system_data = cls._schema_on_200.value.Element.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py deleted file mode 100644 index 5525d2ee502..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_show.py +++ /dev/null @@ -1,276 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting show", -) -class Show(AAZCommand): - """Get arc setting resource details of HCI cluster. - - :example: Get arc setting - az stack-hci-vm arc-setting show --name "default" --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ArcSettingsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_instance_resource_group = AAZStrType( - serialized_name="arcInstanceResourceGroup", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - properties.connectivity_properties = AAZObjectType( - serialized_name="connectivityProperties", - ) - properties.default_extensions = AAZListType( - serialized_name="defaultExtensions", - flags={"read_only": True}, - ) - properties.per_node_details = AAZListType( - serialized_name="perNodeDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - connectivity_properties = cls._schema_on_200.properties.connectivity_properties - connectivity_properties.enabled = AAZBoolType() - - default_extensions = cls._schema_on_200.properties.default_extensions - default_extensions.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.default_extensions.Element - _element.category = AAZStrType( - flags={"read_only": True}, - ) - _element.consent_time = AAZStrType( - serialized_name="consentTime", - flags={"read_only": True}, - ) - - per_node_details = cls._schema_on_200.properties.per_node_details - per_node_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.per_node_details.Element - _element.arc_instance = AAZStrType( - serialized_name="arcInstance", - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py deleted file mode 100644 index 4b626449e6b..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_update.py +++ /dev/null @@ -1,459 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting update", -) -class Update(AAZCommand): - """Update arc setting for HCI cluster. - - :example: Update arc setting - az stack-hci-vm arc-setting update --resource-group "test-rg" --cluster-name "myCluster" --name "default" --tags "{tag:tag}" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], - ] - } - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.connectivity_properties = AAZObjectArg( - options=["--connectivity-properties"], - arg_group="Properties", - help="contains connectivity related configuration for ARC resources", - nullable=True, - ) - - connectivity_properties = cls._args_schema.connectivity_properties - connectivity_properties.enabled = AAZBoolArg( - options=["enabled"], - help="True indicates ARC connectivity is enabled", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - self.ArcSettingsCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ArcSettingsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_arc_setting_read(cls._schema_on_200) - - return cls._schema_on_200 - - class ArcSettingsCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_arc_setting_read(cls._schema_on_200) - - return cls._schema_on_200 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("connectivityProperties", AAZObjectType, ".connectivity_properties") - - connectivity_properties = _builder.get(".properties.connectivityProperties") - if connectivity_properties is not None: - connectivity_properties.set_prop("enabled", AAZBoolType, ".enabled") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_arc_setting_read = None - - @classmethod - def _build_schema_arc_setting_read(cls, _schema): - if cls._schema_arc_setting_read is not None: - _schema.id = cls._schema_arc_setting_read.id - _schema.name = cls._schema_arc_setting_read.name - _schema.properties = cls._schema_arc_setting_read.properties - _schema.system_data = cls._schema_arc_setting_read.system_data - _schema.type = cls._schema_arc_setting_read.type - return - - cls._schema_arc_setting_read = _schema_arc_setting_read = AAZObjectType() - - arc_setting_read = _schema_arc_setting_read - arc_setting_read.id = AAZStrType( - flags={"read_only": True}, - ) - arc_setting_read.name = AAZStrType( - flags={"read_only": True}, - ) - arc_setting_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - arc_setting_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - arc_setting_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_arc_setting_read.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_instance_resource_group = AAZStrType( - serialized_name="arcInstanceResourceGroup", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - properties.connectivity_properties = AAZObjectType( - serialized_name="connectivityProperties", - ) - properties.default_extensions = AAZListType( - serialized_name="defaultExtensions", - flags={"read_only": True}, - ) - properties.per_node_details = AAZListType( - serialized_name="perNodeDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - connectivity_properties = _schema_arc_setting_read.properties.connectivity_properties - connectivity_properties.enabled = AAZBoolType() - - default_extensions = _schema_arc_setting_read.properties.default_extensions - default_extensions.Element = AAZObjectType() - - _element = _schema_arc_setting_read.properties.default_extensions.Element - _element.category = AAZStrType( - flags={"read_only": True}, - ) - _element.consent_time = AAZStrType( - serialized_name="consentTime", - flags={"read_only": True}, - ) - - per_node_details = _schema_arc_setting_read.properties.per_node_details - per_node_details.Element = AAZObjectType() - - _element = _schema_arc_setting_read.properties.per_node_details.Element - _element.arc_instance = AAZStrType( - serialized_name="arcInstance", - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - system_data = _schema_arc_setting_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - _schema.id = cls._schema_arc_setting_read.id - _schema.name = cls._schema_arc_setting_read.name - _schema.properties = cls._schema_arc_setting_read.properties - _schema.system_data = cls._schema_arc_setting_read.system_data - _schema.type = cls._schema_arc_setting_read.type - - -__all__ = ["Update"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py deleted file mode 100644 index 58e20b3bf91..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/arc_setting/_wait.py +++ /dev/null @@ -1,272 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm arc-setting wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["-n", "--name", "--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ArcSettingsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class ArcSettingsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.arc_application_client_id = AAZStrType( - serialized_name="arcApplicationClientId", - ) - properties.arc_application_object_id = AAZStrType( - serialized_name="arcApplicationObjectId", - ) - properties.arc_application_tenant_id = AAZStrType( - serialized_name="arcApplicationTenantId", - ) - properties.arc_instance_resource_group = AAZStrType( - serialized_name="arcInstanceResourceGroup", - ) - properties.arc_service_principal_object_id = AAZStrType( - serialized_name="arcServicePrincipalObjectId", - ) - properties.connectivity_properties = AAZObjectType( - serialized_name="connectivityProperties", - ) - properties.default_extensions = AAZListType( - serialized_name="defaultExtensions", - flags={"read_only": True}, - ) - properties.per_node_details = AAZListType( - serialized_name="perNodeDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - connectivity_properties = cls._schema_on_200.properties.connectivity_properties - connectivity_properties.enabled = AAZBoolType() - - default_extensions = cls._schema_on_200.properties.default_extensions - default_extensions.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.default_extensions.Element - _element.category = AAZStrType( - flags={"read_only": True}, - ) - _element.consent_time = AAZStrType( - serialized_name="consentTime", - flags={"read_only": True}, - ) - - per_node_details = cls._schema_on_200.properties.per_node_details - per_node_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.per_node_details.Element - _element.arc_instance = AAZStrType( - serialized_name="arcInstance", - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py deleted file mode 100644 index 9ded5a965a0..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "stack-hci-vm cluster", -) -class __CMDGroup(AAZCommandGroup): - """Manage cluster with stack hci. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py deleted file mode 100644 index 22932474eee..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._create import * -from ._create_identity import * -from ._delete import * -from ._extend_software_assurance_benefit import * -from ._list import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py deleted file mode 100644 index ed75a99802c..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create.py +++ /dev/null @@ -1,554 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster create", -) -class Create(AAZCommand): - """Create an HCI cluster. - - :example: Create cluster - az stack-hci-vm cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" --name "myCluster" --resource- group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["-n", "--name", "--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Cluster" - - _args_schema = cls._args_schema - _args_schema.identity = AAZObjectArg( - options=["--identity"], - arg_group="Cluster", - help="Identity of Cluster resource", - ) - _args_schema.location = AAZResourceLocationArg( - arg_group="Cluster", - help="The geo-location where the resource lives", - required=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Cluster", - help="Resource tags.", - ) - - identity = cls._args_schema.identity - identity.type = AAZStrArg( - options=["type"], - help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", - required=True, - enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, - ) - identity.user_assigned_identities = AAZDictArg( - options=["user-assigned-identities"], - help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - ) - - user_assigned_identities = cls._args_schema.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectArg( - blank={}, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.aad_application_object_id = AAZStrArg( - options=["--aad-application-object-id"], - arg_group="Properties", - help="Object id of cluster AAD identity.", - ) - _args_schema.aad_client_id = AAZStrArg( - options=["--aad-client-id"], - arg_group="Properties", - help="App id of cluster AAD identity.", - ) - _args_schema.aad_service_principal_object_id = AAZStrArg( - options=["--aad-service-principal-object-id"], - arg_group="Properties", - help="Id of cluster identity service principal.", - ) - _args_schema.aad_tenant_id = AAZStrArg( - options=["--aad-tenant-id"], - arg_group="Properties", - help="Tenant id of cluster AAD identity.", - ) - _args_schema.endpoint = AAZStrArg( - options=["--endpoint"], - arg_group="Properties", - help="Endpoint configured for management from the Azure portal.", - ) - _args_schema.desired_properties = AAZObjectArg( - options=["--desired-properties"], - arg_group="Properties", - help="Desired properties of the cluster.", - ) - - desired_properties = cls._args_schema.desired_properties - desired_properties.diagnostic_level = AAZStrArg( - options=["diagnostic-level"], - help="Desired level of diagnostic data emitted by the cluster.", - enum={"Basic": "Basic", "Enhanced": "Enhanced", "Off": "Off"}, - ) - desired_properties.windows_server_subscription = AAZStrArg( - options=["windows-server-subscription"], - help="Desired state of Windows Server Subscription.", - enum={"Disabled": "Disabled", "Enabled": "Enabled"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ClustersCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ClustersCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("identity", AAZObjectType, ".identity") - _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - identity = _builder.get(".identity") - if identity is not None: - identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) - identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") - - user_assigned_identities = _builder.get(".identity.userAssignedIdentities") - if user_assigned_identities is not None: - user_assigned_identities.set_elements(AAZObjectType, ".") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("aadApplicationObjectId", AAZStrType, ".aad_application_object_id") - properties.set_prop("aadClientId", AAZStrType, ".aad_client_id") - properties.set_prop("aadServicePrincipalObjectId", AAZStrType, ".aad_service_principal_object_id") - properties.set_prop("aadTenantId", AAZStrType, ".aad_tenant_id") - properties.set_prop("cloudManagementEndpoint", AAZStrType, ".endpoint") - properties.set_prop("desiredProperties", AAZObjectType, ".desired_properties") - - desired_properties = _builder.get(".properties.desiredProperties") - if desired_properties is not None: - desired_properties.set_prop("diagnosticLevel", AAZStrType, ".diagnostic_level") - desired_properties.set_prop("windowsServerSubscription", AAZStrType, ".windows_server_subscription") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.identity = AAZObjectType() - _schema_on_200.location = AAZStrType( - flags={"required": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = cls._schema_on_200.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = cls._schema_on_200.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = cls._schema_on_200.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = cls._schema_on_200.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = cls._schema_on_200.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py deleted file mode 100644 index a3798296c23..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_create_identity.py +++ /dev/null @@ -1,198 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster create-identity", -) -class CreateIdentity(AAZCommand): - """Create cluster identity. - - :example: Create cluster identity - az stack-hci-vm cluster create-identity --name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/createclusteridentity", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ClustersCreateIdentity(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ClustersCreateIdentity(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.properties = AAZObjectType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - - return cls._schema_on_200 - - -class _CreateIdentityHelper: - """Helper class for CreateIdentity""" - - -__all__ = ["CreateIdentity"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py deleted file mode 100644 index 4f00b297e69..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_delete.py +++ /dev/null @@ -1,163 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete an HCI cluster. - - :example: Delete cluster - az stack-hci-vm cluster delete --name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["-n", "--name", "--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ClustersDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class ClustersDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py deleted file mode 100644 index f7ac1ce5db3..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_extend_software_assurance_benefit.py +++ /dev/null @@ -1,468 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster extend-software-assurance-benefit", -) -class ExtendSoftwareAssuranceBenefit(AAZCommand): - """Extend Software Assurance Benefit to a cluster - - :example: Extend software assurance benefit - az stack-hci-vm cluster extend-software-assurance-benefit --cluster-name name -g rg --software-assurance-intent enable - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/extendsoftwareassurancebenefit", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.software_assurance_intent = AAZStrArg( - options=["--software-assurance-intent"], - arg_group="Properties", - help="Customer Intent for Software Assurance Benefit.", - enum={"Disable": "Disable", "Enable": "Enable"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ClustersExtendSoftwareAssuranceBenefit(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ClustersExtendSoftwareAssuranceBenefit(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("properties", AAZObjectType) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("softwareAssuranceIntent", AAZStrType, ".software_assurance_intent") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.identity = AAZObjectType() - _schema_on_200.location = AAZStrType( - flags={"required": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = cls._schema_on_200.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = cls._schema_on_200.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = cls._schema_on_200.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = cls._schema_on_200.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = cls._schema_on_200.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ExtendSoftwareAssuranceBenefitHelper: - """Helper class for ExtendSoftwareAssuranceBenefit""" - - -__all__ = ["ExtendSoftwareAssuranceBenefit"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py deleted file mode 100644 index 7177242c9b6..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_list.py +++ /dev/null @@ -1,775 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster list", -) -class List(AAZCommand): - """List all HCI clusters in a subscription. - - :example: List clusters in a given resource group - az stack-hci-vm cluster list --resource-group "test-rg" - - :example: List clusters in a given subscription - az stack-hci-vm cluster list - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.azurestackhci/clusters", "2023-03-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.ClustersListByResourceGroup(ctx=self.ctx)() - if condition_1: - self.ClustersListBySubscription(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class ClustersListByResourceGroup(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.identity = AAZObjectType() - _element.location = AAZStrType( - flags={"required": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = cls._schema_on_200.value.Element.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = cls._schema_on_200.value.Element.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = cls._schema_on_200.value.Element.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = cls._schema_on_200.value.Element.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = cls._schema_on_200.value.Element.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = cls._schema_on_200.value.Element.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = cls._schema_on_200.value.Element.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class ClustersListBySubscription(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.identity = AAZObjectType() - _element.location = AAZStrType( - flags={"required": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = cls._schema_on_200.value.Element.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = cls._schema_on_200.value.Element.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = cls._schema_on_200.value.Element.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = cls._schema_on_200.value.Element.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = cls._schema_on_200.value.Element.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = cls._schema_on_200.value.Element.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = cls._schema_on_200.value.Element.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py deleted file mode 100644 index 74738b08081..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_show.py +++ /dev/null @@ -1,423 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster show", -) -class Show(AAZCommand): - """Get HCI cluster. - - :example: Get cluster - az stack-hci-vm cluster show --name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["-n", "--name", "--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ClustersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ClustersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.identity = AAZObjectType() - _schema_on_200.location = AAZStrType( - flags={"required": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = cls._schema_on_200.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = cls._schema_on_200.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = cls._schema_on_200.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = cls._schema_on_200.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = cls._schema_on_200.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py deleted file mode 100644 index 77583b72b63..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_update.py +++ /dev/null @@ -1,657 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster update", -) -class Update(AAZCommand): - """Update an HCI cluster. - - :example: Update cluster - az stack-hci-vm cluster update --endpoint "https://98294836-31be-4668-aeae-698667faf99b.waconazure.com" --desired-properties "{diagnosticLevel:Basic,windowsServerSubscription:Enabled}" --tags "tag:"value" --name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], - ] - } - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["-n", "--name", "--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Cluster" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Cluster", - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.aad_client_id = AAZStrArg( - options=["--aad-client-id"], - arg_group="Properties", - help="App id of cluster AAD identity.", - nullable=True, - ) - _args_schema.aad_tenant_id = AAZStrArg( - options=["--aad-tenant-id"], - arg_group="Properties", - help="Tenant id of cluster AAD identity.", - nullable=True, - ) - _args_schema.endpoint = AAZStrArg( - options=["--endpoint"], - arg_group="Properties", - help="Endpoint configured for management from the Azure portal.", - nullable=True, - ) - _args_schema.desired_properties = AAZObjectArg( - options=["--desired-properties"], - arg_group="Properties", - help="Desired properties of the cluster.", - nullable=True, - ) - - desired_properties = cls._args_schema.desired_properties - desired_properties.diagnostic_level = AAZStrArg( - options=["diagnostic-level"], - help="Desired level of diagnostic data emitted by the cluster.", - nullable=True, - enum={"Basic": "Basic", "Enhanced": "Enhanced", "Off": "Off"}, - ) - desired_properties.windows_server_subscription = AAZStrArg( - options=["windows-server-subscription"], - help="Desired state of Windows Server Subscription.", - nullable=True, - enum={"Disabled": "Disabled", "Enabled": "Enabled"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ClustersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - self.ClustersCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ClustersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_cluster_read(cls._schema_on_200) - - return cls._schema_on_200 - - class ClustersCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_cluster_read(cls._schema_on_200) - - return cls._schema_on_200 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("aadClientId", AAZStrType, ".aad_client_id") - properties.set_prop("aadTenantId", AAZStrType, ".aad_tenant_id") - properties.set_prop("cloudManagementEndpoint", AAZStrType, ".endpoint") - properties.set_prop("desiredProperties", AAZObjectType, ".desired_properties") - - desired_properties = _builder.get(".properties.desiredProperties") - if desired_properties is not None: - desired_properties.set_prop("diagnosticLevel", AAZStrType, ".diagnostic_level") - desired_properties.set_prop("windowsServerSubscription", AAZStrType, ".windows_server_subscription") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_cluster_read = None - - @classmethod - def _build_schema_cluster_read(cls, _schema): - if cls._schema_cluster_read is not None: - _schema.id = cls._schema_cluster_read.id - _schema.identity = cls._schema_cluster_read.identity - _schema.location = cls._schema_cluster_read.location - _schema.name = cls._schema_cluster_read.name - _schema.properties = cls._schema_cluster_read.properties - _schema.system_data = cls._schema_cluster_read.system_data - _schema.tags = cls._schema_cluster_read.tags - _schema.type = cls._schema_cluster_read.type - return - - cls._schema_cluster_read = _schema_cluster_read = AAZObjectType() - - cluster_read = _schema_cluster_read - cluster_read.id = AAZStrType( - flags={"read_only": True}, - ) - cluster_read.identity = AAZObjectType() - cluster_read.location = AAZStrType( - flags={"required": True}, - ) - cluster_read.name = AAZStrType( - flags={"read_only": True}, - ) - cluster_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - cluster_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - cluster_read.tags = AAZDictType() - cluster_read.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = _schema_cluster_read.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = _schema_cluster_read.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = _schema_cluster_read.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = _schema_cluster_read.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = _schema_cluster_read.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = _schema_cluster_read.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = _schema_cluster_read.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = _schema_cluster_read.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = _schema_cluster_read.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = _schema_cluster_read.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = _schema_cluster_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = _schema_cluster_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_cluster_read.id - _schema.identity = cls._schema_cluster_read.identity - _schema.location = cls._schema_cluster_read.location - _schema.name = cls._schema_cluster_read.name - _schema.properties = cls._schema_cluster_read.properties - _schema.system_data = cls._schema_cluster_read.system_data - _schema.tags = cls._schema_cluster_read.tags - _schema.type = cls._schema_cluster_read.type - - -__all__ = ["Update"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py deleted file mode 100644 index ae0abc3aca6..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/_wait.py +++ /dev/null @@ -1,419 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["-n", "--name", "--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ClustersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class ClustersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.identity = AAZObjectType() - _schema_on_200.location = AAZStrType( - flags={"required": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = cls._schema_on_200.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = cls._schema_on_200.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = cls._schema_on_200.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = cls._schema_on_200.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = cls._schema_on_200.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = cls._schema_on_200.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = cls._schema_on_200.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py deleted file mode 100644 index 5bf45544fac..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "stack-hci-vm cluster identity", -) -class __CMDGroup(AAZCommandGroup): - """Manage identity - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py deleted file mode 100644 index 32de0c73f52..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_assign.py +++ /dev/null @@ -1,605 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster identity assign", -) -class Assign(AAZCommand): - """Assign identities - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01", "identity"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Cluster.identity" - - _args_schema = cls._args_schema - _args_schema.type = AAZStrArg( - options=["--type"], - arg_group="Cluster.identity", - help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", - required=True, - enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, - ) - _args_schema.user_assigned_identities = AAZDictArg( - options=["--user-assigned-identities"], - arg_group="Cluster.identity", - help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - ) - - user_assigned_identities = cls._args_schema.user_assigned_identities - user_assigned_identities.Element = AAZObjectArg( - blank={}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ClustersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - self.ClustersCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.identity - - def _set(self, value): - result = self.ctx.vars.instance - result.identity = value - return - - class ClustersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AssignHelper._build_schema_cluster_read(cls._schema_on_200) - - return cls._schema_on_200 - - class ClustersCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AssignHelper._build_schema_cluster_read(cls._schema_on_200) - - return cls._schema_on_200 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") - - user_assigned_identities = _builder.get(".userAssignedIdentities") - if user_assigned_identities is not None: - user_assigned_identities.set_elements(AAZObjectType, ".") - - return _instance_value - - -class _AssignHelper: - """Helper class for Assign""" - - _schema_cluster_read = None - - @classmethod - def _build_schema_cluster_read(cls, _schema): - if cls._schema_cluster_read is not None: - _schema.id = cls._schema_cluster_read.id - _schema.identity = cls._schema_cluster_read.identity - _schema.location = cls._schema_cluster_read.location - _schema.name = cls._schema_cluster_read.name - _schema.properties = cls._schema_cluster_read.properties - _schema.system_data = cls._schema_cluster_read.system_data - _schema.tags = cls._schema_cluster_read.tags - _schema.type = cls._schema_cluster_read.type - return - - cls._schema_cluster_read = _schema_cluster_read = AAZObjectType() - - cluster_read = _schema_cluster_read - cluster_read.id = AAZStrType( - flags={"read_only": True}, - ) - cluster_read.identity = AAZObjectType() - cluster_read.location = AAZStrType( - flags={"required": True}, - ) - cluster_read.name = AAZStrType( - flags={"read_only": True}, - ) - cluster_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - cluster_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - cluster_read.tags = AAZDictType() - cluster_read.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = _schema_cluster_read.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = _schema_cluster_read.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = _schema_cluster_read.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = _schema_cluster_read.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = _schema_cluster_read.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = _schema_cluster_read.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = _schema_cluster_read.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = _schema_cluster_read.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = _schema_cluster_read.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = _schema_cluster_read.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = _schema_cluster_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = _schema_cluster_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_cluster_read.id - _schema.identity = cls._schema_cluster_read.identity - _schema.location = cls._schema_cluster_read.location - _schema.name = cls._schema_cluster_read.name - _schema.properties = cls._schema_cluster_read.properties - _schema.system_data = cls._schema_cluster_read.system_data - _schema.tags = cls._schema_cluster_read.tags - _schema.type = cls._schema_cluster_read.type - - -__all__ = ["Assign"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py deleted file mode 100644 index ecffd909b25..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/_remove.py +++ /dev/null @@ -1,607 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm cluster identity remove", -) -class Remove(AAZCommand): - """Remove identities - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}", "2023-03-01", "identity"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Cluster.identity" - - _args_schema = cls._args_schema - _args_schema.type = AAZStrArg( - options=["--type"], - arg_group="Cluster.identity", - help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", - enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, - ) - _args_schema.user_assigned_identities = AAZDictArg( - options=["--user-assigned-identities"], - arg_group="Cluster.identity", - help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - nullable=True, - ) - - user_assigned_identities = cls._args_schema.user_assigned_identities - user_assigned_identities.Element = AAZObjectArg( - nullable=True, - blank={}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ClustersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - self.ClustersCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.identity - - def _set(self, value): - result = self.ctx.vars.instance - result.identity = value - return - - class ClustersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_cluster_read(cls._schema_on_200) - - return cls._schema_on_200 - - class ClustersCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_cluster_read(cls._schema_on_200) - - return cls._schema_on_200 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") - - user_assigned_identities = _builder.get(".userAssignedIdentities") - if user_assigned_identities is not None: - user_assigned_identities.set_elements(AAZObjectType, ".") - - return _instance_value - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_cluster_read = None - - @classmethod - def _build_schema_cluster_read(cls, _schema): - if cls._schema_cluster_read is not None: - _schema.id = cls._schema_cluster_read.id - _schema.identity = cls._schema_cluster_read.identity - _schema.location = cls._schema_cluster_read.location - _schema.name = cls._schema_cluster_read.name - _schema.properties = cls._schema_cluster_read.properties - _schema.system_data = cls._schema_cluster_read.system_data - _schema.tags = cls._schema_cluster_read.tags - _schema.type = cls._schema_cluster_read.type - return - - cls._schema_cluster_read = _schema_cluster_read = AAZObjectType() - - cluster_read = _schema_cluster_read - cluster_read.id = AAZStrType( - flags={"read_only": True}, - ) - cluster_read.identity = AAZObjectType() - cluster_read.location = AAZStrType( - flags={"required": True}, - ) - cluster_read.name = AAZStrType( - flags={"read_only": True}, - ) - cluster_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - cluster_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - cluster_read.tags = AAZDictType() - cluster_read.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = _schema_cluster_read.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = _schema_cluster_read.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = _schema_cluster_read.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = _schema_cluster_read.properties - properties.aad_application_object_id = AAZStrType( - serialized_name="aadApplicationObjectId", - ) - properties.aad_client_id = AAZStrType( - serialized_name="aadClientId", - ) - properties.aad_service_principal_object_id = AAZStrType( - serialized_name="aadServicePrincipalObjectId", - ) - properties.aad_tenant_id = AAZStrType( - serialized_name="aadTenantId", - ) - properties.billing_model = AAZStrType( - serialized_name="billingModel", - flags={"read_only": True}, - ) - properties.cloud_id = AAZStrType( - serialized_name="cloudId", - flags={"read_only": True}, - ) - properties.cloud_management_endpoint = AAZStrType( - serialized_name="cloudManagementEndpoint", - ) - properties.desired_properties = AAZObjectType( - serialized_name="desiredProperties", - ) - properties.last_billing_timestamp = AAZStrType( - serialized_name="lastBillingTimestamp", - flags={"read_only": True}, - ) - properties.last_sync_timestamp = AAZStrType( - serialized_name="lastSyncTimestamp", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.registration_timestamp = AAZStrType( - serialized_name="registrationTimestamp", - flags={"read_only": True}, - ) - properties.reported_properties = AAZObjectType( - serialized_name="reportedProperties", - ) - properties.resource_provider_object_id = AAZStrType( - serialized_name="resourceProviderObjectId", - flags={"read_only": True}, - ) - properties.service_endpoint = AAZStrType( - serialized_name="serviceEndpoint", - flags={"read_only": True}, - ) - properties.software_assurance_properties = AAZObjectType( - serialized_name="softwareAssuranceProperties", - ) - properties.status = AAZStrType( - flags={"read_only": True}, - ) - properties.trial_days_remaining = AAZFloatType( - serialized_name="trialDaysRemaining", - flags={"read_only": True}, - ) - - desired_properties = _schema_cluster_read.properties.desired_properties - desired_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - desired_properties.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - ) - - reported_properties = _schema_cluster_read.properties.reported_properties - reported_properties.cluster_id = AAZStrType( - serialized_name="clusterId", - flags={"read_only": True}, - ) - reported_properties.cluster_name = AAZStrType( - serialized_name="clusterName", - flags={"read_only": True}, - ) - reported_properties.cluster_type = AAZStrType( - serialized_name="clusterType", - flags={"read_only": True}, - ) - reported_properties.cluster_version = AAZStrType( - serialized_name="clusterVersion", - flags={"read_only": True}, - ) - reported_properties.diagnostic_level = AAZStrType( - serialized_name="diagnosticLevel", - ) - reported_properties.imds_attestation = AAZStrType( - serialized_name="imdsAttestation", - flags={"read_only": True}, - ) - reported_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - reported_properties.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - reported_properties.nodes = AAZListType( - flags={"read_only": True}, - ) - reported_properties.supported_capabilities = AAZListType( - serialized_name="supportedCapabilities", - flags={"read_only": True}, - ) - - nodes = _schema_cluster_read.properties.reported_properties.nodes - nodes.Element = AAZObjectType() - - _element = _schema_cluster_read.properties.reported_properties.nodes.Element - _element.core_count = AAZFloatType( - serialized_name="coreCount", - flags={"read_only": True}, - ) - _element.ehc_resource_id = AAZStrType( - serialized_name="ehcResourceId", - flags={"read_only": True}, - ) - _element.id = AAZFloatType( - flags={"read_only": True}, - ) - _element.last_licensing_timestamp = AAZStrType( - serialized_name="lastLicensingTimestamp", - flags={"read_only": True}, - ) - _element.manufacturer = AAZStrType( - flags={"read_only": True}, - ) - _element.memory_in_gi_b = AAZFloatType( - serialized_name="memoryInGiB", - flags={"read_only": True}, - ) - _element.model = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.node_type = AAZStrType( - serialized_name="nodeType", - flags={"read_only": True}, - ) - _element.os_display_version = AAZStrType( - serialized_name="osDisplayVersion", - flags={"read_only": True}, - ) - _element.os_name = AAZStrType( - serialized_name="osName", - flags={"read_only": True}, - ) - _element.os_version = AAZStrType( - serialized_name="osVersion", - flags={"read_only": True}, - ) - _element.serial_number = AAZStrType( - serialized_name="serialNumber", - flags={"read_only": True}, - ) - _element.windows_server_subscription = AAZStrType( - serialized_name="windowsServerSubscription", - flags={"read_only": True}, - ) - - supported_capabilities = _schema_cluster_read.properties.reported_properties.supported_capabilities - supported_capabilities.Element = AAZStrType( - flags={"read_only": True}, - ) - - software_assurance_properties = _schema_cluster_read.properties.software_assurance_properties - software_assurance_properties.last_updated = AAZStrType( - serialized_name="lastUpdated", - flags={"read_only": True}, - ) - software_assurance_properties.software_assurance_intent = AAZStrType( - serialized_name="softwareAssuranceIntent", - ) - software_assurance_properties.software_assurance_status = AAZStrType( - serialized_name="softwareAssuranceStatus", - ) - - system_data = _schema_cluster_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = _schema_cluster_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_cluster_read.id - _schema.identity = cls._schema_cluster_read.identity - _schema.location = cls._schema_cluster_read.location - _schema.name = cls._schema_cluster_read.name - _schema.properties = cls._schema_cluster_read.properties - _schema.system_data = cls._schema_cluster_read.system_data - _schema.tags = cls._schema_cluster_read.tags - _schema.type = cls._schema_cluster_read.type - - -__all__ = ["Remove"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py deleted file mode 100644 index 3e9caa4d9c5..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "stack-hci-vm extension", -) -class __CMDGroup(AAZCommandGroup): - """Manage extension with stack hci. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py deleted file mode 100644 index 2d1a2078686..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._create import * -from ._delete import * -from ._list import * -from ._show import * -from ._wait import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py deleted file mode 100644 index fb24cbc615b..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_create.py +++ /dev/null @@ -1,389 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm extension create", -) -class Create(AAZCommand): - """Create extension for HCI cluster. - - :example: Create arc extension - az stack-hci-vm extension create --arc-setting-name "default" --cluster-name "myCluster" --type "MicrosoftMonitoringAgent" --protected-settings '{"workspaceId": "xx", "port": "6516"}' --publisher "Microsoft.Compute" --settings '{"workspaceKey": "xx"}' --type-handler-version "1.10" --name "MicrosoftMonitoringAgent" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.extension_name = AAZStrArg( - options=["-n", "--name", "--extension-name"], - help="The name of the machine extension.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "ExtensionParameters" - - _args_schema = cls._args_schema - _args_schema.auto_upgrade = AAZBoolArg( - options=["--auto-upgrade"], - arg_group="ExtensionParameters", - help="Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.", - ) - _args_schema.force_update_tag = AAZStrArg( - options=["--force-update-tag"], - arg_group="ExtensionParameters", - help="How the extension handler should be forced to update even if the extension configuration has not changed.", - ) - _args_schema.protected_settings = AAZFreeFormDictArg( - options=["--protected-settings"], - arg_group="ExtensionParameters", - help="Protected settings (may contain secrets).", - ) - _args_schema.publisher = AAZStrArg( - options=["--publisher"], - arg_group="ExtensionParameters", - help="The name of the extension handler publisher.", - ) - _args_schema.settings = AAZFreeFormDictArg( - options=["--settings"], - arg_group="ExtensionParameters", - help="Json formatted public settings for the extension.", - ) - _args_schema.type = AAZStrArg( - options=["--type"], - arg_group="ExtensionParameters", - help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", - ) - _args_schema.type_handler_version = AAZStrArg( - options=["--type-handler-version"], - arg_group="ExtensionParameters", - help="Specifies the version of the script handler. Latest version would be used if not specified.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ExtensionsCreate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ExtensionsCreate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "extensionName", self.ctx.args.extension_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("extensionParameters", AAZObjectType) - - extension_parameters = _builder.get(".properties.extensionParameters") - if extension_parameters is not None: - extension_parameters.set_prop("autoUpgradeMinorVersion", AAZBoolType, ".auto_upgrade") - extension_parameters.set_prop("forceUpdateTag", AAZStrType, ".force_update_tag") - extension_parameters.set_prop("protectedSettings", AAZFreeFormDictType, ".protected_settings", typ_kwargs={"flags": {"secret": True}}) - extension_parameters.set_prop("publisher", AAZStrType, ".publisher") - extension_parameters.set_prop("settings", AAZFreeFormDictType, ".settings") - extension_parameters.set_prop("type", AAZStrType, ".type") - extension_parameters.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") - - protected_settings = _builder.get(".properties.extensionParameters.protectedSettings") - if protected_settings is not None: - protected_settings.set_anytype_elements(".") - - settings = _builder.get(".properties.extensionParameters.settings") - if settings is not None: - settings.set_anytype_elements(".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.extension_parameters = AAZObjectType( - serialized_name="extensionParameters", - ) - properties.managed_by = AAZStrType( - serialized_name="managedBy", - flags={"read_only": True}, - ) - properties.per_node_extension_details = AAZListType( - serialized_name="perNodeExtensionDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - extension_parameters = cls._schema_on_200_201.properties.extension_parameters - extension_parameters.auto_upgrade_minor_version = AAZBoolType( - serialized_name="autoUpgradeMinorVersion", - ) - extension_parameters.enable_automatic_upgrade = AAZBoolType( - serialized_name="enableAutomaticUpgrade", - ) - extension_parameters.force_update_tag = AAZStrType( - serialized_name="forceUpdateTag", - ) - extension_parameters.protected_settings = AAZFreeFormDictType( - serialized_name="protectedSettings", - flags={"secret": True}, - ) - extension_parameters.publisher = AAZStrType() - extension_parameters.settings = AAZFreeFormDictType() - extension_parameters.type = AAZStrType() - extension_parameters.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - per_node_extension_details = cls._schema_on_200_201.properties.per_node_extension_details - per_node_extension_details.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.per_node_extension_details.Element - _element.extension = AAZStrType( - flags={"read_only": True}, - ) - _element.instance_view = AAZObjectType( - serialized_name="instanceView", - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - _element.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - flags={"read_only": True}, - ) - - instance_view = cls._schema_on_200_201.properties.per_node_extension_details.Element.instance_view - instance_view.name = AAZStrType() - instance_view.status = AAZObjectType() - instance_view.type = AAZStrType() - instance_view.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - status = cls._schema_on_200_201.properties.per_node_extension_details.Element.instance_view.status - status.code = AAZStrType() - status.display_status = AAZStrType( - serialized_name="displayStatus", - ) - status.level = AAZStrType() - status.message = AAZStrType() - status.time = AAZStrType() - - system_data = cls._schema_on_200_201.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py deleted file mode 100644 index 7c54ab021f7..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_delete.py +++ /dev/null @@ -1,183 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm extension delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete particular arc extension of HCI Cluster. - - :example: Delete arc extension - az stack-hci-vm extension delete --arc-setting-name "default" --cluster-name "myCluster" --name "MicrosoftMonitoringAgent" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.extension_name = AAZStrArg( - options=["-n", "--name", "--extension-name"], - help="The name of the machine extension.", - required=True, - id_part="child_name_2", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.ExtensionsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class ExtensionsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "extensionName", self.ctx.args.extension_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py deleted file mode 100644 index dabf72b74eb..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_list.py +++ /dev/null @@ -1,302 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm extension list", -) -class List(AAZCommand): - """List all extensions under arc setting resource. - - :example: List extensions under arc setting resource - az stack-hci-vm extension list --arc-setting-name "default" --cluster-name "myCluster" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions", "2023-03-01"], - ] - } - - AZ_SUPPORT_PAGINATION = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ExtensionsListByArcSetting(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class ExtensionsListByArcSetting(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType( - flags={"read_only": True}, - ) - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.extension_parameters = AAZObjectType( - serialized_name="extensionParameters", - ) - properties.managed_by = AAZStrType( - serialized_name="managedBy", - flags={"read_only": True}, - ) - properties.per_node_extension_details = AAZListType( - serialized_name="perNodeExtensionDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - extension_parameters = cls._schema_on_200.value.Element.properties.extension_parameters - extension_parameters.auto_upgrade_minor_version = AAZBoolType( - serialized_name="autoUpgradeMinorVersion", - ) - extension_parameters.enable_automatic_upgrade = AAZBoolType( - serialized_name="enableAutomaticUpgrade", - ) - extension_parameters.force_update_tag = AAZStrType( - serialized_name="forceUpdateTag", - ) - extension_parameters.protected_settings = AAZFreeFormDictType( - serialized_name="protectedSettings", - flags={"secret": True}, - ) - extension_parameters.publisher = AAZStrType() - extension_parameters.settings = AAZFreeFormDictType() - extension_parameters.type = AAZStrType() - extension_parameters.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - per_node_extension_details = cls._schema_on_200.value.Element.properties.per_node_extension_details - per_node_extension_details.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.per_node_extension_details.Element - _element.extension = AAZStrType( - flags={"read_only": True}, - ) - _element.instance_view = AAZObjectType( - serialized_name="instanceView", - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - _element.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - flags={"read_only": True}, - ) - - instance_view = cls._schema_on_200.value.Element.properties.per_node_extension_details.Element.instance_view - instance_view.name = AAZStrType() - instance_view.status = AAZObjectType() - instance_view.type = AAZStrType() - instance_view.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - status = cls._schema_on_200.value.Element.properties.per_node_extension_details.Element.instance_view.status - status.code = AAZStrType() - status.display_status = AAZStrType( - serialized_name="displayStatus", - ) - status.level = AAZStrType() - status.message = AAZStrType() - status.time = AAZStrType() - - system_data = cls._schema_on_200.value.Element.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py deleted file mode 100644 index 550a4e2ac6f..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_show.py +++ /dev/null @@ -1,300 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm extension show", -) -class Show(AAZCommand): - """Get particular arc extension of HCI cluster. - - :example: Get arc settings extension - az stack-hci-vm extension show --arc-setting-name "default" --cluster-name "myCluster" --name "MicrosoftMonitoringAgent" --resource-group "test-rg" - """ - - _aaz_info = { - "version": "2023-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.extension_name = AAZStrArg( - options=["-n", "--name", "--extension-name"], - help="The name of the machine extension.", - required=True, - id_part="child_name_2", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ExtensionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ExtensionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "extensionName", self.ctx.args.extension_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.extension_parameters = AAZObjectType( - serialized_name="extensionParameters", - ) - properties.managed_by = AAZStrType( - serialized_name="managedBy", - flags={"read_only": True}, - ) - properties.per_node_extension_details = AAZListType( - serialized_name="perNodeExtensionDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - extension_parameters = cls._schema_on_200.properties.extension_parameters - extension_parameters.auto_upgrade_minor_version = AAZBoolType( - serialized_name="autoUpgradeMinorVersion", - ) - extension_parameters.enable_automatic_upgrade = AAZBoolType( - serialized_name="enableAutomaticUpgrade", - ) - extension_parameters.force_update_tag = AAZStrType( - serialized_name="forceUpdateTag", - ) - extension_parameters.protected_settings = AAZFreeFormDictType( - serialized_name="protectedSettings", - flags={"secret": True}, - ) - extension_parameters.publisher = AAZStrType() - extension_parameters.settings = AAZFreeFormDictType() - extension_parameters.type = AAZStrType() - extension_parameters.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - per_node_extension_details = cls._schema_on_200.properties.per_node_extension_details - per_node_extension_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.per_node_extension_details.Element - _element.extension = AAZStrType( - flags={"read_only": True}, - ) - _element.instance_view = AAZObjectType( - serialized_name="instanceView", - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - _element.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - flags={"read_only": True}, - ) - - instance_view = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view - instance_view.name = AAZStrType() - instance_view.status = AAZObjectType() - instance_view.type = AAZStrType() - instance_view.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - status = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view.status - status.code = AAZStrType() - status.display_status = AAZStrType( - serialized_name="displayStatus", - ) - status.level = AAZStrType() - status.message = AAZStrType() - status.time = AAZStrType() - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py b/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py deleted file mode 100644 index df103b64221..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/extension/_wait.py +++ /dev/null @@ -1,296 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "stack-hci-vm extension wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.azurestackhci/clusters/{}/arcsettings/{}/extensions/{}", "2023-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.arc_setting_name = AAZStrArg( - options=["--arc-setting-name"], - help="The name of the proxy resource holding details of HCI ArcSetting information.", - required=True, - id_part="child_name_1", - ) - _args_schema.cluster_name = AAZStrArg( - options=["--cluster-name"], - help="The name of the cluster.", - required=True, - id_part="name", - ) - _args_schema.extension_name = AAZStrArg( - options=["-n", "--name", "--extension-name"], - help="The name of the machine extension.", - required=True, - id_part="child_name_2", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ExtensionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class ExtensionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "arcSettingName", self.ctx.args.arc_setting_name, - required=True, - ), - **self.serialize_url_param( - "clusterName", self.ctx.args.cluster_name, - required=True, - ), - **self.serialize_url_param( - "extensionName", self.ctx.args.extension_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.aggregate_state = AAZStrType( - serialized_name="aggregateState", - flags={"read_only": True}, - ) - properties.extension_parameters = AAZObjectType( - serialized_name="extensionParameters", - ) - properties.managed_by = AAZStrType( - serialized_name="managedBy", - flags={"read_only": True}, - ) - properties.per_node_extension_details = AAZListType( - serialized_name="perNodeExtensionDetails", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - extension_parameters = cls._schema_on_200.properties.extension_parameters - extension_parameters.auto_upgrade_minor_version = AAZBoolType( - serialized_name="autoUpgradeMinorVersion", - ) - extension_parameters.enable_automatic_upgrade = AAZBoolType( - serialized_name="enableAutomaticUpgrade", - ) - extension_parameters.force_update_tag = AAZStrType( - serialized_name="forceUpdateTag", - ) - extension_parameters.protected_settings = AAZFreeFormDictType( - serialized_name="protectedSettings", - flags={"secret": True}, - ) - extension_parameters.publisher = AAZStrType() - extension_parameters.settings = AAZFreeFormDictType() - extension_parameters.type = AAZStrType() - extension_parameters.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - per_node_extension_details = cls._schema_on_200.properties.per_node_extension_details - per_node_extension_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.per_node_extension_details.Element - _element.extension = AAZStrType( - flags={"read_only": True}, - ) - _element.instance_view = AAZObjectType( - serialized_name="instanceView", - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - _element.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - flags={"read_only": True}, - ) - - instance_view = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view - instance_view.name = AAZStrType() - instance_view.status = AAZObjectType() - instance_view.type = AAZStrType() - instance_view.type_handler_version = AAZStrType( - serialized_name="typeHandlerVersion", - ) - - status = cls._schema_on_200.properties.per_node_extension_details.Element.instance_view.status - status.code = AAZStrType() - status.display_status = AAZStrType( - serialized_name="displayStatus", - ) - status.level = AAZStrType() - status.message = AAZStrType() - status.time = AAZStrType() - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py new file mode 100644 index 00000000000..6c799d8f4c3 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_azurestackhci.generated._help import helps # pylint: disable=unused-import +try: + from azext_azurestackhci.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class AzureStackHCICommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_azurestackhci.generated._client_factory import cf_azurestackhci_cl + azurestackhci_custom = CliCommandType( + operations_tmpl='azext_azurestackhci.custom#{}', + client_factory=cf_azurestackhci_cl) + parent = super(AzureStackHCICommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=azurestackhci_custom) + + def load_command_table(self, args): + from azext_azurestackhci.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_azurestackhci.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_azurestackhci.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_azurestackhci.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = AzureStackHCICommandsLoader diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/__init__.py similarity index 100% rename from src/stack-hci-vm/azext_stack_hci_vm/tests/latest/__init__.py rename to src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/__init__.py diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py new file mode 100644 index 00000000000..25bea868024 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_azurestackhci_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_azurestackhci.vendored_sdks.azurestackhci import AzureStackHCIClient + return get_mgmt_service_client(cli_ctx, + AzureStackHCIClient) + + +def cf_galleryimage(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).galleryimages + + +def cf_networkinterface(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).networkinterfaces + + +def cf_virtualharddisk(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).virtualharddisks + + +def cf_virtualmachine(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).virtualmachines + + +def cf_virtualnetwork(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).virtualnetworks + + +def cf_storagecontainer(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).storagecontainers + + +def cf_cluster(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).clusters + +def cf_arc_vmextension(cli_ctx, *_): + return cf_azurestackhci_cl(cli_ctx).arcvmextensions \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py new file mode 100644 index 00000000000..1693cdf47c0 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py @@ -0,0 +1,794 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + +helps['azurestackhci'] = """ + type: group + short-summary: Manage azurestackhci +""" + +helps['azurestackhci image'] = """ + type: group + short-summary: Manage images with azurestackhci +""" + +helps['azurestackhci image list'] = """ + type: command + short-summary: "List all gallery images" + examples: + - name: ListGalleryImageByResourceGroup + text: |- + az azurestackhci image list --resource-group "test-rg" + - name: ListGalleryImageByResourceGroup + text: |- + az azurestackhci image list +""" + +helps['azurestackhci image create'] = """ + type: command + short-summary: "Create a gallery image" + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. + - name: --offer + short-summary: "offer for Marketplace image" + long-summary: | + Usage: --offer + - name: --publisher + short-summary: "publisher for Marketplace image" + long-summary: | + Usage: --publisher + - name: --sku + short-summary: "sku for Marketplace image" + long-summary: | + Usage: --sku + - name: --version + short-summary: "version for Marketplace image" + long-summary: | + Usage: --version + - name: --storagepath-id + short-summary: "Azure ID of the storagepath which is used to store Gallery Images." + - name: --image-path + short-summary: "Location/Path of the image the gallery image should be created from." + examples: + - name: PutGalleryImage + text: |- + az azurestackhci image create --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-27\ +2844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" \ +type="CustomLocation" --location "West US2" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers\ +/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" --image-path "C:\\\\test.vhdx" \ +--name "test-gallery-image" --resource-group "test-rg" +""" + +helps['azurestackhci image update'] = """ + type: command + short-summary: "Update an image." + examples: + - name: UpdateGalleryImage + text: |- + az azurestackhci image update --tags additionalProperties="sample" --name \ +"test-gallery-image" --resource-group "test-rg" +""" + +helps['azurestackhci image delete'] = """ + type: command + short-summary: "Delete an image." + examples: + - name: DeleteGalleryImage + text: |- + az azurestackhci image delete --name "test-gallery-image" --resource-group \ +"test-rg" +""" + +helps['azurestackhci image show'] = """ + type: command + short-summary: "Get the details of an image" + examples: + - name: GetGalleryImage + text: |- + az azurestackhci image show --name "test-gallery-image" --resource-group \ +"test-rg" +""" + +helps['azurestackhci galleryimage'] = """ + type: group + short-summary: Please use 'az azurestackhci image' instead of 'az azurestackhci galleryimage' +""" + +helps['azurestackhci galleryimage list'] = """ + type: command + short-summary: Please use 'az azurestackhci image list' instead of 'az azurestackhci galleryimage list' +""" + +helps['azurestackhci galleryimage create'] = """ + type: command + short-summary: Please use 'az azurestackhci image create' instead of 'az azurestackhci galleryimage create' + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. +""" + +helps['azurestackhci galleryimage update'] = """ + type: command + short-summary: Please use 'az azurestackhci image update' instead of 'az azurestackhci galleryimage update' +""" + +helps['azurestackhci galleryimage delete'] = """ + type: command + short-summary: Please use 'az azurestackhci image delete' instead of 'az azurestackhci galleryimage delete' +""" + +helps['azurestackhci galleryimage show'] = """ + type: command + short-summary: Please use 'az azurestackhci image show' instead of 'az azurestackhci galleryimage show' +""" + +helps['azurestackhci networkinterface'] = """ + type: group + short-summary: Manage networkinterface with azurestackhci +""" + +helps['azurestackhci networkinterface list'] = """ + type: command + short-summary: "List all network interfaces" + examples: + - name: ListNetworkInterfaceByResourceGroup + text: |- + az azurestackhci networkinterface list --resource-group "test-rg" + - name: ListNetworkInterfaceBySubscription + text: |- + az azurestackhci networkinterface list +""" + +helps['azurestackhci networkinterface create'] = """ + type: command + short-summary: "Create a network interface" + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. + - name: --subnet-id + long-summary: | + Usage: --subnet-id "test-vnet" + The subnet-id provided will be ignored if ip-configurations parameter is also provided + - name: --gateway + long-summary: | + Usage: --gateway "1.2.3.4" + - name: --ip-address + long-summary: | + Usage: --ip-address "1.2.3.4" + - name: --dns-servers + long-summary: | + Usage: --dns-servers 10.220.32.16 10.220.32.17 + examples: + - name: Without ip configurations provided + text: |- + az azurestackhci networkinterface create --resource-group "test-rg" --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4f\ +d-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" \ +type="CustomLocation" --location "West US2" --subnet-id "test-vnet" --gateway "1.2.3.4" \ +--ip-address "10.0.0.0" --name "test-nic" + # examples: + # - name: With ip configurations provided + # text: |- +# az azurestackhci networkinterface create --resource-group "test-rg" --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4f\ +# d-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" \ +# type="CustomLocation" --location "West US2" --ip-configurations "[{\"name\":\"ipconfig-test\",\"properties\":{\ +# \"subnet\":{\"id\":\"test-vnet\"},\"gateway\":\"1.2.3.4\", \"ip_address\":\"10.0.0.0\"}}]" \ +# --name "test-nic" \ +""" + +helps['azurestackhci networkinterface update'] = """ + type: command + short-summary: "Update a network interface." + examples: + - name: UpdateNetworkInterface + text: |- + az azurestackhci networkinterface update --tags additionalProperties="sample" --name \ +"test-nic" --resource-group "test-rg" +""" + +helps['azurestackhci networkinterface delete'] = """ + type: command + short-summary: "Delete a network interface" + examples: + - name: DeleteNetworkInterface + text: |- + az azurestackhci networkinterface delete --name "test-nic" --resource-group "test-rg" +""" + +helps['azurestackhci networkinterface show'] = """ + type: command + short-summary: "Get the details of a network interface" + examples: + - name: GetNetworkInterface + text: |- + az azurestackhci networkinterface show --name "test-nic" --resource-group \ +"test-rg" +""" + +helps['azurestackhci virtualharddisk'] = """ + type: group + short-summary: Manage virtualharddisk with azurestackhci +""" + +helps['azurestackhci virtualharddisk list'] = """ + type: command + short-summary: "List all virtual hard disks" + examples: + - name: ListVirtualHardDiskByResourceGroup + text: |- + az azurestackhci virtualharddisk list --resource-group "test-rg" + - name: ListVirtualHardDiskByResourceGroup + text: |- + az azurestackhci virtualharddisk list +""" + +helps['azurestackhci virtualharddisk create'] = """ + type: command + short-summary: "Create a virtual hard disk" + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. + - name: --disk-size-bytes + short-summary: "Deprecated. Please use --disk-size-gb instead. Size of the disk in GB." + - name: --disk-size-gb + short-summary: "Size of the disk in GB." + - name: --dynamic + short-summary: "Boolean for enabling dynamic sizing on the virtual hard disk. Allowed values: false, true." + - name: --block-size-bytes + short-summary: "Block size." + - name: --logical-sector-bytes + short-summary: "Logical Sector." + - name: --physical-sector-bytes + short-summary: "Physical Sector." + - name: --storagepath-id + short-summary: "Azure ID of the Storage Path which is used to store the VHD." + - name: --disk-file-format + short-summary: "disk file format of the virtual hard disk - vhd or vhdx." + long-summary: | + Usage: --disk-file-format "vhd" + examples: + - name: PutVirtualHardDisk + text: |- + az azurestackhci virtualharddisk create --resource-group "test-rg" --extended-location \ +name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio\ +n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --disk-size-bytes 32 \ +--name "test-vhd" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers\ +/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" +""" + +helps['azurestackhci virtualharddisk update'] = """ + type: command + short-summary: "Update a virtual hard disk" + examples: + - name: UpdateVirtualHardDisk + text: |- + az azurestackhci virtualharddisk update --resource-group "test-rg" --tags additionalProperties="sample" \ +--name "test-vhd" +""" + +helps['azurestackhci virtualharddisk delete'] = """ + type: command + short-summary: "Delete a virtual hard disk" + examples: + - name: DeleteVirtualHardDisk + text: |- + az azurestackhci virtualharddisk delete --resource-group "test-rg" --name "test-vhd" +""" + +helps['azurestackhci virtualharddisk show'] = """ + type: command + short-summary: "Get the details of a virtual hard disk" + examples: + - name: GetVirtualHardDisk + text: |- + az azurestackhci virtualharddisk show --resource-group "test-rg" --name "test-vhd" +""" + +helps['azurestackhci virtualmachine'] = """ + type: group + short-summary: Manage virtualmachine with azurestackhci +""" + +helps['azurestackhci virtualmachine list'] = """ + type: command + short-summary: "List all the VMs" + examples: + - name: ListVirtualMachineByResourceGroup + text: |- + az azurestackhci virtualmachine list --resource-group "test-rg" + - name: ListVirtualMachineBySubscription + text: |- + az azurestackhci virtualmachine list +""" + +helps['azurestackhci virtualmachine create'] = """ + type: command + short-summary: "Create a VM" + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. + - name: --hardware-profile + short-summary: "HardwareProfile - Specifies the hardware settings for the virtual machine." + long-summary: | + Usage: --hardware-profile vm-size=XX processors=XX memory-mb=XX maximum-memory-mb=XX minimum-memory-mb=XX target-memory-buffer=XX + + processors: number of processors for the virtual machine + memory-mb: RAM in mb for the virtual machine + maximum-memory-mb: Maximum dynamic memory in mb + minimum-memory-mb: Minimum dynamic memory in mb + target-memory-buffer: Target memory buffer + - name: --enable-tpm + short-summary: "enable tpm - Enable TPM in security settings for the VMs. If the flag is not provided, default value is False" + long-summary: | + Usage: --enable-tpm=XX + - name: --security-profile + short-summary: "SecurityProfile - Specifies the security settings for the virtual machine." + long-summary: | + Usage: --security-profile secure-boot-enabled=XX + - name: --linux-configuration + short-summary: "LinuxConfiguration - Specifies the security settings for the virtual machine." + - name: --windows-configuration + short-summary: "WindowsConfiguration - Windows Configuration for the virtual machine. " + - name: --admin-username + short-summary: "AdminUsername - Administrator Username" + - name: --admin-password + short-summary: "AdminPassword - Administrator Password" + - name: --disable-vm-management + short-summary: "To enable/disable vm Management agent. The default behaviour enables the provisioning for VM ARC agent" + - name: --computer-name + short-summary: "Name of the Computer" + - name: --ssh-public-keys + short-summary: "Path to SSH public keys" + - name: --os-disk + short-summary: "id of the VHD being used to provision the VM" + - name: --data-disk + short-summary: "names of the data disk VHD's being attached to the VM" + - name: --storagepath-id + short-summary: "Azure ID of the Storage Path pointing to the location where the VM config files are stored." + - name: --allow-password-auth + long-summary: | + Whether to enable password authentication for Linux virtual machines. + + Note: This flag has no effect on Windows virtual machines. + - name: --os-disk + short-summary: "ID of the VHD being used to provision the VM" + - name: --data-disk + short-summary: "IDs of the data disk VHD's being attached to the VM" + + examples: + - name: PutVirtualMachine + text: |- + az azurestackhci virtualmachine create --resource-group "test-rg" --extended-location \ +name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio \ +n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --hardware-profile vm-size="Default" \ +--nic-id "test-nic" --computer-name "test-machine" --admin-username xxx --admin-password xxx --ssh-public-keys /path/to/public_key.pub \ +--image-reference "test-gallery-image" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers\ +/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" --name "test-vm" --allow-password-auth true --disable-vm-management true +""" + +helps['azurestackhci virtualmachine update'] = """ + type: command + short-summary: "Update a VM" + parameters: + - name: --cpu-count + short-summary: "Number of processors" + - name: --memory-gb + short-summary: "Deprecated. Please use --memory-mb instead. Amount of RAM in gb." + - name: --memory-mb + short-summary: "Amount of RAM in mb" + - name: --vhd-names + short-summary: "List of vhd names" + - name: --vnic-names + short-summary: "List of vnic names" + examples: + - name: UpdateVirtualMachine + text: |- + az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" \ +--name "test-vm" --cpu-count XX --memory-mb XX --vhd-names vhd1 vhd2 --vnic-names vnic1 vnic2 +""" + +helps['azurestackhci virtualmachine delete'] = """ + type: command + short-summary: "Delete a VM" + examples: + - name: DeleteVirtualMachine + text: |- + az azurestackhci virtualmachine delete --resource-group "test-rg" --name "test-vm" +""" + +helps['azurestackhci virtualmachine show'] = """ + type: command + short-summary: "Get the details of a VM" + examples: + - name: GetVirtualMachine + text: |- + az azurestackhci virtualmachine show --resource-group "test-rg" --name "test-vm" +""" + +helps['azurestackhci virtualmachine start'] = """ + type: command + short-summary: "Start a stopped VM" + examples: + - name: StartVirtualMachine + text: |- + az azurestackhci virtualmachine start --resource-group "test-rg" --name "test-vm" +""" + +helps['azurestackhci virtualmachine stop'] = """ + type: command + short-summary: "Power off (stop) a running VM" + examples: + - name: StopVirtualMachine + text: |- + az azurestackhci virtualmachine stop --resource-group "test-rg" --name "test-vm" +""" + +helps['azurestackhci virtualmachine restart'] = """ + type: command + short-summary: "Restart a VM" + examples: + - name: RestartVirtualMachine + text: |- + az azurestackhci virtualmachine restart --resource-group "test-rg" --name "test-vm" +""" + +helps['azurestackhci virtualmachine vnic'] = """ + type: group + short-summary: Manage vNIC of a virtual machine with azurestackhci +""" + +helps['azurestackhci virtualmachine vnic add'] = """ + type: command + short-summary: "Add existing vNICs to a VM" + examples: + - name: AddVNIC + text: |- + az azurestackhci virtualmachine vnic add --resource-group "test-rg" --name "test-vm" --vnic-names "test-vnic" +""" + +helps['azurestackhci virtualmachine vnic remove'] = """ + type: command + short-summary: "Remove vNICs from a VM" + examples: + - name: RemoveVNIC + text: |- + az azurestackhci virtualmachine vnic remove --resource-group "test-rg" --name "test-vm" --vnic-names "test-vnic" +""" + +helps['azurestackhci virtualnetwork'] = """ + type: group + short-summary: Manage virtualnetwork with azurestackhci +""" + +helps['azurestackhci virtualnetwork list'] = """ + type: command + short-summary: "List all the virtual networks" + examples: + - name: ListVirtualNetworkByResourceGroup + text: |- + az azurestackhci virtualnetwork list --resource-group "test-rg" + - name: ListVirtualNetworkBySubscription + text: |- + az azurestackhci virtualnetwork list +""" + +helps['azurestackhci virtualnetwork create'] = """ + type: command + short-summary: "Create a virtual network" + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. + - name: --ip-allocation-method + long-summary: | + Usage: --ip-allocation-method "Static/Dynamic" + - name: --address-prefix + long-summary: | + Usage: --address-prefix "1.2.3.0/16" + - name: --ip-pool-start + long-summary: | + Usage: --ip-pool-start "1.2.3.0" + - name: --ip-pool-end + long-summary: | + Usage: --ip-pool-end "1.2.3.4" + - name: --ip-pool-type + long-summary: | + Usage: --ip-pool-type "vm" + - name: --ip-pools + long-summary: | + Usage: --ip-pools [{/"start/":/"1.2.3.0/", /"end/":/"1.2.3.4/", /"ip_pool_type/":/"vm/"}] + - name: --vlan + long-summary: | + Usage: --vlan 10 + - name: --vm-switch-name + long-summary: | + Usage: --vm-switch-name "vm-switch-01" + - name: --dns-servers + long-summary: | + Usage: --dns-servers 10.220.32.16 10.220.32.17 + - name: --routes + long-summary: | + Usage: --routes '[{/"name/":/"route1/",/"properties/":{/"address_prefix/":/"1.2.3.0/28/",/"next_hop_ip_address/":/"1.2.3.1/"}},{/"name/":/"route2/",/"properties/":{/"address_prefix/":/"1.2.6.0/24/",/"next_hop_ip_address/":/"1.2.6.1/"}}]' + Expected value: json-string/json-file/@json-file + - name: --gateway + long-summary: | + Usage: --gateway 1.2.3.4 + - name: --subnets + long-summary: | + Usage: --subnets '[{\"properties\":{\"addressPrefix\":\"1.2.3.0/24\",\"ipAllocationMethod\":\"Static\",\"ipPools\":[{\"end\":\"1.2.3.10\",\"start\":\"1.2.3.0\",\"ipPoolType\":\"vm\"},{\"end\":\"1.2.3.15\",\"start\":\"1.2.3.11\",\"ipPoolType\":\"vm\"}]}}]' + examples: + - name: PutVirtualNetwork + text: |- + az azurestackhci virtualnetwork create --resource-group "test-rg" --extended-location \ +name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio\ +n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --network-type "Transparent" \ +--name "test-vnet" --ip-allocation-method "Static" --address-prefix "10.0.0.0/28" --ip-pool-start "10.0.0.0" \ +--ip-pool-end "10.0.0.15" --vm-switch-name "test-vm-switch" --dns-servers 10.220.32.16 10.220.32.17 +""" + +helps['azurestackhci virtualnetwork update'] = """ + type: command + short-summary: "Update a virtual network" + examples: + - name: UpdateVirtualNetwork + text: |- + az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" \ +--name "test-vnet" +""" + +helps['azurestackhci virtualnetwork delete'] = """ + type: command + short-summary: "Delete a virtual network" + examples: + - name: DeleteVirtualNetwork + text: |- + az azurestackhci virtualnetwork delete --resource-group "test-rg" --name "test-vnet" +""" + +helps['azurestackhci virtualnetwork show'] = """ + type: command + short-summary: "Get the details of a virtual network" + examples: + - name: GetVirtualNetwork + text: |- + az azurestackhci virtualnetwork show --resource-group "test-rg" --name "test-vnet" +""" + +helps['azurestackhci storagepath'] = """ + type: group + short-summary: Manage storagepath with azurestackhci +""" + +helps['azurestackhci storagepath list'] = """ + type: command + short-summary: "List all the storage paths" + examples: + - name: ListStoragePathByResourceGroup + text: |- + az azurestackhci storagepath list --resource-group "test-rg" + - name: ListStoragePathByResourceGroup + text: |- + az azurestackhci storagepath list +""" + +helps['azurestackhci storagepath create'] = """ + type: command + short-summary: "Create a storage path" + parameters: + - name: --extended-location + long-summary: | + Usage: --extended-location type=XX name=XX + + type: The extended location type. + name: The extended location name. + - name: --path + short-summary: "Path on a disk to create storagepath." + examples: + - name: PutStoragePath + text: |- + az azurestackhci storagepath create --resource-group "test-rg" --extended-location \ +name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio\ +n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --path "C:\\\\path_storage" \ +--name "Default_StoragePath" +""" + +helps['azurestackhci storagepath update'] = """ + type: command + short-summary: "Update a storage path" + examples: + - name: UpdateStoragePath + text: |- + az azurestackhci storagepath update --resource-group "test-rg" --tags \ +additionalProperties="sample" --name "Default_StoragePath" +""" + +helps['azurestackhci storagepath delete'] = """ + type: command + short-summary: "Delete a storage path" + examples: + - name: DeleteStoragePath + text: |- + az azurestackhci storagepath delete --resource-group "test-rg" --name \ +"Default_StoragePath" +""" + +helps['azurestackhci storagepath show'] = """ + type: command + short-summary: "Get the details of a storage path." + examples: + - name: GetStoragePath + text: |- + az azurestackhci storagepath show --resource-group "test-rg" --name \ +"Default_StoragePath" +""" + +helps['azurestackhci virtualmachine extension'] = """ + type: group + short-summary: Manage virtualmachine extension with azurestackhci +""" + +helps['azurestackhci virtualmachine extension create'] = """ + type: command + short-summary: "Create a virtualmachine extension." + parameters: + - name: --extension-type + short-summary: "Specify the type of the virtualmachine extension; an example is CustomScriptExtension." + - name: --publisher + short-summary: "The name of the virtualmachine extension handler publisher." + - name: --settings + short-summary: "Json formatted public settings for the virtualmachine extension." + - name: --type-handler-version + short-summary: "Specify the version of the script handler." + - name: --virtualmachine-name + short-summary: "The name of the virtualmachine where the extension should be created or updated." + examples: + - name: PutExtension + text: |- + az azurestackhci virtualmachine extension create --resource-group "test-rg" --location "West US2" --name "test-extension" \ +--extension-type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{\"commandToExecute\":\"hostname\"}' \ +--type-handler-version "1.10" --virtualmachine-name "test-virtualmachine" +""" + +helps['azurestackhci virtualmachine extension update'] = """ + type: command + short-summary: "Update a virtualmachine extension." + examples: + - name: UpdateExtension + text: |- + az azurestackhci virtualmachine extension update --resource-group "test-rg" --name "test-extension" \ +--extension-type "CustomScriptExtension" --virtualmachine-name "test-virtualmachine" --publisher "Microsoft.Compute" \ +--settings '{\"commandToExecute\":\"hostname\"}' --type-handler-version "1.10" +""" + +helps['azurestackhci virtualmachine extension show'] = """ + type: command + short-summary: "Get the details of a virtualmachine extension." + examples: + - name: GetExtension + text: |- + az azurestackhci virtualmachine extension show --name "test-extension" --virtualmachine-name "test-virtualmachine" \ +--resource-group "test-rg" +""" + +helps['azurestackhci virtualmachine extension list'] = """ + type: command + short-summary: "List all the extensions for a virtualmachine." + examples: + - name: ListExtensions + text: |- + az azurestackhci virtualmachine extension list --virtualmachine-name "test-virtualmachine" --resource-group "test-rg" +""" + +helps['azurestackhci virtualmachine extension delete'] = """ + type: command + short-summary: "Delete a virtualmachine extension." + examples: + - name: DeleteExtension + text: |- + az azurestackhci virtualmachine extension delete --name "test-extension" --virtualmachine-name "test-virtualmachine" \ +--resource-group "test-rg" +""" + +helps['azurestackhci virtualmachine extension wait'] = """ + type: command + short-summary: "Place the CLI in a waiting state until a condition of the virtualmachine extension is met." + examples: + - name: Pause executing next line of CLI script until the virtualmachine extension is successfully created. + text: |- + az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" \ +--resource-group "test-rg" --created + - name: Pause executing next line of CLI script until the virtualmachine extension is successfully updated. + text: |- + az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" \ +--resource-group "test-rg" --updated + - name: Pause executing next line of CLI script until the virtualmachine extension is successfully deleted. + text: |- + az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" \ +--resource-group "test-rg" --deleted + +# helps['azurestackhci cluster'] = """ +# type: group +# short-summary: Manage cluster with azurestackhci +# """ + +# helps['azurestackhci cluster list'] = """ +# type: command +# short-summary: "List all HCI clusters in a resource group. And List all HCI clusters in a subscription." +# examples: +# - name: List clusters in a given resource group +# text: |- +# az azurestackhci cluster list --resource-group "test-rg" +# - name: List clusters in a given subscription +# text: |- +# az azurestackhci cluster list +# """ + +# helps['azurestackhci cluster show'] = """ +# type: command +# short-summary: "Get HCI cluster." +# examples: +# - name: Get cluster +# text: |- +# az azurestackhci cluster show --name "myCluster" --resource-group "test-rg" +# """ + +# helps['azurestackhci cluster create'] = """ +# type: command +# short-summary: "Create an HCI cluster." +# examples: +# - name: Create cluster +# text: |- +# az azurestackhci cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847d\ +# fc" --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --name "myCluster" --resource-group "test-rg" +# """ + +# helps['azurestackhci cluster update'] = """ +# type: command +# short-summary: "Update an HCI cluster." +# examples: +# - name: Update cluster +# text: |- +# az azurestackhci cluster update --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group \ +# "test-rg" +# """ + +# helps['azurestackhci cluster delete'] = """ +# type: command +# short-summary: "Delete an HCI cluster." +# examples: +# - name: Delete cluster +# text: |- +# az azurestackhci cluster delete --name "myCluster" --resource-group "test-rg" +# """ diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py new file mode 100644 index 00000000000..a21cdba9516 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py @@ -0,0 +1,430 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + resource_group_name_type, + get_location_type, + get_enum_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_azurestackhci.action import ( + AddGalleryimagesExtendedLocation, + AddNetworkinterfacesExtendedLocation, + AddVirtualharddisksExtendedLocation, + AddVirtualmachinesExtendedLocation, + AddHardwareProfile, + AddNetworkProfile, + AddSecurityProfile, + AddVirtualnetworksExtendedLocation, + AddLinuxConfiguration, + AddStoragecontainersExtendedLocation, + AddStatus +) + +def load_arguments(self, _): + + with self.argument_context('azurestackhci image list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci image create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddGalleryimagesExtendedLocation, nargs='+', help='') + c.argument('container_name', type=str, help='Container Name for storage container') + c.argument('image_path', type=str, help='location of the image the gallery image should be created from') + c.argument('os_type', type=str, help='OS Type [Windows, Linux]') + c.argument('offer', type=str, help='offer for Marketplace image') + c.argument('publisher', type=str, help='publisher for Marketplace image') + c.argument('sku', type=str, help='sku for Marketplace image') + c.argument('version', type=str, help='version for Marketplace image') + + with self.argument_context('azurestackhci image update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('azurestackhci image delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image', id_part='name') + + with self.argument_context('azurestackhci image show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image', id_part='name') + + with self.argument_context('azurestackhci galleryimage list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci galleryimage create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddGalleryimagesExtendedLocation, nargs='+', help='') + c.argument('storagepath_id', type=str, help='Azure ID of the Storage Path which is used to store the Gallery Images.') + c.argument('image_path', type=str, help='location of the image the gallery image should be created from') + c.argument('hyper-v-generation',type=str, help='HyperV Generation [V1, V2]') + c.argument('os_type', arg_type=get_enum_type(['Windows', 'Linux']), help='OS Type') + c.argument('offer', type=str, help='offer for Marketplace image') + c.argument('publisher', type=str, help='publisher for Marketplace image') + c.argument('sku', type=str, help='sku for Marketplace image') + c.argument('version', type=str, help='version for Marketplace image') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci galleryimage update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('azurestackhci galleryimage delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci galleryimage show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the gallery image', id_part='name') + + with self.argument_context('azurestackhci networkinterface list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci networkinterface create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the network interface') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddNetworkinterfacesExtendedLocation, nargs='+', help='') + c.argument('ip_configurations', type=validate_file_or_dict, help='IPConfigurations - A list of ' + 'IPConfigurations of the network interface. Expected value: json-string/@json-file.') + c.argument('mac_address', type=str, help='MacAddress - The MAC address of the network interface.') + c.argument('dns_servers', nargs='+', help='Space-separated list of DNS server IP addresses.') + c.argument('subnet_id', type=str, help='ID of the subnet or network to create the network interface on') + c.argument('gateway', type=str, help='Gateway for network interface') + c.argument('ip_address', type=str, help='ip_address - Private IP address of the IP configuration.') + c.argument('ip_allocation_method', type=str, help='ip_allocation_method - The private IP address allocation method. Possible values include: Static, Dynamic', deprecate_info=c.deprecate(target='--ip-allocation-method')) + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci networkinterface update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the network interface', id_part='name') + c.argument('tags', tags_type) + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci networkinterface delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the network interface', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci networkinterface show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the network interface', id_part='name') + + with self.argument_context('azurestackhci virtualharddisk list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci virtualharddisk create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual hard disk') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddVirtualharddisksExtendedLocation, nargs='+', help='') + c.argument('block_size_bytes', type=int, help='Block size') + c.argument('disk_size_bytes', type=int, help='Size of the disk in GB', deprecate_info=c.deprecate(target='--disk-size-bytes', redirect='--disk-size-gb', hide=True)) + c.argument('disk_size_gb', type=int, help='Size of the disk in GB') + c.argument('dynamic', arg_type=get_three_state_flag(), help='Boolean for enabling dynamic sizing on the ' + 'virtual hard disk') + c.argument('logical_sector_bytes', type=int, help='Logical Sector') + c.argument('physical_sector_bytes', type=int, help='Physical Sector') + c.argument('disk_file_format', type=str, help='Disk File Format [vhd, vhdx]') + c.argument('storagepath_id',type=str,help='Azure ID of the Storage Path which is used to store the VHD.') + c.argument('disk_file_format', type=str, help='Disk File Format [vhd, vhdx]') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualharddisk update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual hard disk', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('azurestackhci virtualharddisk delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual hard disk', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualharddisk show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual hard disk', id_part='name') + + with self.argument_context('azurestackhci virtualmachine list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci virtualmachine create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddVirtualmachinesExtendedLocation, nargs='+', help='') + c.argument('hardware_profile', action=AddHardwareProfile, nargs='+', help='HardwareProfile - Specifies the ' + 'hardware settings for the virtual machine.') + c.argument('image_reference', type=str, help='ImageReference - gallery image name the vm should use to provision') + c.argument('os_disk', type=str, help='Os Disk - name of the vhd the vm should use to provision') + c.argument('data_disk', type=str, nargs='+', help='List of data disk to attach to the vm') + c.argument('storagepath_id', type=str, help='Azure ID of the Storage Path pointing to the location where the VM config files are stored.') + c.argument('network_profile', action=AddNetworkProfile, nargs='+', help='NetworkProfile - describes the ' + 'network configuration the virtual machine') + c.argument('nic_id', type=str, help='nicID - Network Interface id to attach to the virtual machine.') + ## Don't change the order of the lines, because linux_configuration builds on os_profile; + ## Starting here + c.argument('os_profile', type=validate_file_or_dict, help='OsProfile - describes the configuration of the ' + 'operating system and sets login data Expected value: json-string/@json-file.') + c.argument('linux_configuration', action=AddLinuxConfiguration, nargs='*', help='Linux configuration - ' + 'specifies ssh keys for the virtual machine') + ## end here + c.argument('windows_configuration', type=validate_file_or_dict, help='Windows configuration -' + 'Windows Configuration for the virtual machine ') + c.argument('security_profile', action=AddSecurityProfile, nargs='+', help='SecurityProfile - Specifies the ' + 'security settings for the virtual machine.') + c.argument('enable_tpm', help='Enable tpm for security profile', nargs='?', const=True, default=False) + c.argument('storage_profile', type=validate_file_or_dict, help='StorageProfile - contains information about ' + 'the disks and storage information for the virtual machine Expected value: json-string/@json-file.') + c.argument('vm_size', type=str, help='VMSize - stock vm hardware configuration to use') + c.argument('admin_username', type=str, help='Admin Username') + c.argument('admin_password', type=str, help='Admin Password') + c.argument('computer_name', type=str, help='Computer Name') + c.argument('disable_vm_management', arg_type=get_three_state_flag(), help='Boolean for enabling VM arc for server agent') + c.argument('ssh_public_keys', type=str, nargs='*', help='Path to ssh public key(s) for linux vm') + c.argument('allow_password_auth', arg_type=get_three_state_flag(), help='Enable password authentication for Linux VM') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualmachine update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('tags', tags_type) + c.argument('cpu_count', type=int, help='number of processors for the virtual machine') + c.argument('memory_gb', type=int, help='RAM in gb for the virtual machine', deprecate_info=c.deprecate(target='--memory-gb', redirect='--memory-mb', hide=True)) + c.argument('memory_mb', type=int, help='RAM in mb for the virtual machine') + c.argument('vnic_names', type=str, nargs='+', help='List of vnic names') + c.argument('vhd_names', type=str, nargs='+', help='List of virtual hard disk names') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualmachine delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualmachine show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + + with self.argument_context('azurestackhci virtualmachine start') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualmachine restart') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualmachine stop') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualmachine vnic add') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('vnic_names', type=str, nargs='+', help='List of vnic names') + + with self.argument_context('azurestackhci virtualmachine vnic remove') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual machine', id_part='name') + c.argument('vnic_names', type=str, nargs='+', help='List of vnic names') + + with self.argument_context('azurestackhci virtualnetwork list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci virtualnetwork create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual network') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddVirtualnetworksExtendedLocation, nargs='+', help='') + c.argument('network_type', type=str, help='Type of the network') + c.argument('subnets', type=validate_file_or_dict, help='Subnet - list of subnets under the virtual network. ' + 'All other subnet properties in the cli parameters will be ignored if this is provided. ' + 'Expected value: json-string/@json-file.') + c.argument('address_prefix', type=str, help='Cidr for this subnet - IPv4, IPv6') + c.argument('ip_allocation_method', type=str, help='IPAllocationMethod - The IP address allocation method. Possible values include: Static, Dynamic') + c.argument('ip_pools', type=validate_file_or_dict, help='ippools') + c.argument('ip_pool_type', type=str, help='ip pool type') + c.argument('ip_pool_start', type=str, help='start of the ip address pool') + c.argument('ip_pool_end', type=str, help='end of the ip address pool') + c.argument('vlan', type=int, help='Vlan to use for the subnet') + c.argument('vm_switch_name', type=str, help='Name of the VM switch') + c.argument('dns_servers', nargs='+', help='Space-separated list of DNS server IP addresses.') + c.argument('routes', type=validate_file_or_dict, help='Collection of routes contained within a route table') + c.argument('gateway', type=str, help='Gateway') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualnetwork update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual network', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('azurestackhci virtualnetwork delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual network', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci virtualnetwork show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the virtual network', id_part='name') + + with self.argument_context('azurestackhci storagepath list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('azurestackhci storagepath create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the storage path') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('extended_location', action=AddStoragecontainersExtendedLocation, nargs='+', help='') + c.argument('path', type=str, help='Path on a disk to create storagepath', required=True) + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci storagepath update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the storage path', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('azurestackhci storagepath delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the storage path', id_part='name') + c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') + + with self.argument_context('azurestackhci storagepath show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', type=str, help='Name of the storage path', id_part='name') + + with self.argument_context('azurestackhci virtualmachine extension create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', help='The name of the extension.') + c.argument('virtualmachine_name', help='The name of the virtual machine where the extension should be created or updated.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' + 'the extension configuration has not changed.') + c.argument('publisher', type=str, help='The name of the extension handler publisher.') + c.argument('extension_type', type=str, help='Specify the type of the extension; an example ' + 'is "CustomScriptExtension".') + c.argument('type_handler_version', type=str, help='Specify the version of the script handler.') + c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' + 'should be automatically upgraded by the platform if there is a newer version available.') + c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' + 'use a newer minor version if one is available at deployment time. Once deployed, however, the ' + 'extension will not upgrade minor versions unless redeployed, even with this property set to true.') + c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' + 'Expected value: json-string/json-file/@json-file.') + c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' + 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' + 'value: json-string/json-file/@json-file.') + c.argument('instance_view_type', help='Specify the type of the extension; an example is ' + '"CustomScriptExtension".', arg_group='Instance View') + c.argument('inst_handler_version', help='Specify the version of the script handler.', + arg_group='Instance View') + c.argument('status', action=AddStatus, nargs='+', help='Instance view status.', arg_group='Instance View') + + with self.argument_context('azurestackhci virtualmachine extension update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.', id_part='name') + c.argument('name', help='The name of the extension.') + c.argument('tags', tags_type) + c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' + 'the extension configuration has not changed.') + c.argument('publisher', type=str, help='The name of the extension handler publisher.') + c.argument('extension_type', type=str, help='Specify the type of the extension; an example ' + 'is "CustomScriptExtension".') + c.argument('type_handler_version', type=str, help='Specify the version of the script handler.') + c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' + 'should be automatically upgraded by the platform if there is a newer version available.') + c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' + 'use a newer minor version if one is available at deployment time. Once deployed, however, the ' + 'extension will not upgrade minor versions unless redeployed, even with this property set to true.') + c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' + 'Expected value: json-string/json-file/@json-file.') + c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' + 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' + 'value: json-string/json-file/@json-file.') + + with self.argument_context('azurestackhci virtualmachine extension show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.', id_part='name') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') + + with self.argument_context('azurestackhci virtualmachine extension list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.') + + with self.argument_context('azurestackhci virtualmachine extension delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtualmachine_name', help='The name of the virtual machine where the extension should be deleted from.', + id_part='name') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') + + with self.argument_context('azurestackhci virtualmachine extension wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.', + id_part='name') + c.argument('name', help='The name of the machine extension.', id_part='child_name_1') + + # with self.argument_context('azurestackhci cluster list') as c: + # c.argument('resource_group_name', resource_group_name_type) + + # with self.argument_context('azurestackhci cluster show') as c: + # c.argument('resource_group_name', resource_group_name_type) + # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + # 'cluster.', id_part='name') + + # with self.argument_context('azurestackhci cluster create') as c: + # c.argument('resource_group_name', resource_group_name_type) + # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + # 'cluster.') + # c.argument('tags', tags_type) + # c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + # validator=get_default_location_from_resource_group) + # c.argument('aad_client_id', type=str, help='App id of cluster AAD identity.') + # c.argument('aad_tenant_id', type=str, help='Tenant id of cluster AAD identity.') + + # with self.argument_context('azurestackhci cluster update') as c: + # c.argument('resource_group_name', resource_group_name_type) + # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + # 'cluster.', id_part='name') + # c.argument('tags', tags_type) + + # with self.argument_context('azurestackhci cluster delete') as c: + # c.argument('resource_group_name', resource_group_name_type) + # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + # 'cluster.', id_part='name') diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py new file mode 100644 index 00000000000..6a5a6775a24 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py @@ -0,0 +1,279 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from knack.util import CLIError +from msrestazure.tools import parse_resource_id +import re +import ipaddress +from ._client_factory import cf_galleryimage, cf_virtualnetwork + +default_ip_allocation_method = "Dynamic" +all_digits_regex = "^[0-9]+$" +windows_not_allowed_chars_regex = "[\\\\`~!@#$%^&*()=+_\[\]\{\}|;:.'\",<>/?]" +linux_not_allowed_chars_regex = "[\\\\`~!@#$%^&*()=+_\[\]\{\}|;:'\",<>/?]" +windows_computername_maxlength = 15 +linux_computername_maxlength = 64 + +def vm_create_validator(cmd, namespace): + """ + Validates parameters for vm creation operation + """ + os_profile = namespace.os_profile or dict() + enable_gm_flag_set = False + if 'linuxConfiguration' in os_profile and os_profile['linuxConfiguration'] is not None: + if 'provisionVMAgent' in os_profile['linuxConfiguration']: + enable_gm_flag_set = enable_gm_flag_set or bool(os_profile['linuxConfiguration']['provisionVMAgent']) + if 'windowsConfiguration' in os_profile and os_profile['windowsConfiguration'] is not None: + if 'provisionVMAgent' in os_profile['windowsConfiguration']: + enable_gm_flag_set = enable_gm_flag_set or bool(os_profile['windowsConfiguration']['provisionVMAgent']) + + enable_gm_flag_set = enable_gm_flag_set or not bool(namespace.disable_vm_management) + + is_username_provided = bool(os_profile.get('adminUsername', None) or namespace.admin_username) + is_password_provided = bool(os_profile.get('adminPassword', None) or namespace.admin_password) + + if enable_gm_flag_set == True and not (is_username_provided and is_password_provided): + raise CLIError('Admin username and password must be provided for enabling Guest Mangement. For disabling Guest Management, use --disable-vm-management') + + osprofile_ostype = os_profile.get('osType', None) + osdisk_id = namespace.os_disk + computer_name = namespace.computer_name + ostype = osprofile_ostype + + if osdisk_id and osprofile_ostype is None: + raise CLIError("Os type must be provided if --os-disk is provided. " + "To provide os type, use this format, --os-profile '{\\\"osType\\\":\\\"Windows\\\"}'") + + if namespace.image_reference: + res = parse_resource_id(namespace.image_reference) + # Use resource_group of image if full resource id is provided; otherwise use the global one + galleryimage = _fetch_galleryimage(cmd.cli_ctx, res.get('resource_group', namespace.resource_group_name), res['name']) + galleryimage_os_type = galleryimage.properties.os_type + + if osprofile_ostype and galleryimage_os_type: + if osprofile_ostype.lower() != galleryimage_os_type.lower(): + raise CLIError("The os type provided is not the correct os type of the gallery image, " + "the os type of this virtual machine should be {}".format(galleryimage_os_type)) + + ostype = galleryimage_os_type or osprofile_ostype + if ostype: + ostype = ostype.lower() + + if enable_gm_flag_set and not namespace.allow_password_auth: + if ostype is None: + raise CLIError("Please provide osType if you are enabling VM Management. To provide osType, use this format --os-profile '{\\\"osType\\\":\\\"Windows\\\"}") + elif ostype == 'linux': + raise CLIError("Guest Management for Azure Stack HCI VMs is currently in Preview. " + "This command needs password-based authentication for the created Linux VM. Use --allow-password-auth" + "\nFor disabling Guest Management, use --disable-vm-management") + + _validate_computer_name(computer_name, ostype) + +def _fetch_galleryimage(cli_ctx, resource_group, name): + image_client = cf_galleryimage(cli_ctx=cli_ctx) + + img = image_client.retrieve(resource_group, name) + return img + +def _validate_computer_name(computer_name, ostype): + if computer_name and ostype: + ostype = ostype.lower() + if ostype == 'windows': + if len(computer_name) > windows_computername_maxlength or re.search(all_digits_regex, computer_name) or re.search(windows_not_allowed_chars_regex, computer_name): + raise CLIError("Windows computer name cannot be more than 15 characters long, be entirely numeric, or contain these characters: ` ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \\ | ; : ' . \" , < > / ?") + elif ostype == 'linux': + if len(computer_name) > linux_computername_maxlength or re.search(linux_not_allowed_chars_regex, computer_name): + raise CLIError("Linux host name cannot exceed 64 characters in length or contain these characters: ` ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , < > / ?") + + +def vnet_create_validator(cmd, namespace): + """ + Validates parameters for vnic creation operation + """ + + routes = namespace.routes or dict() + if routes: + default_gateway = _get_default_gateway_from_routes_dict(routes) + if default_gateway and namespace.gateway: + raise CLIError("Please provide either --gateway or a route with address_prefix 0.0.0.0/0, not both") + _validate_vnet_parameters(namespace) + + +def _validate_vnet_parameters(namespace): + """ + Validates conditions for Static/Dynamic allocation for virtualnetwork + """ + + + if namespace.subnets: + for subnet in namespace.subnets: + _validate_subnet(subnet) + + if namespace.ip_allocation_method == "Static": + # Validate Static-IP conditions + if not (bool(namespace.address_prefix) | bool(namespace.subnets)): + raise CLIError("Address-prefix must be provided if --ip-allocation-method is Static. Please use --address-prefix or --subnets to provide address prefix for virtualnetwork") + + if namespace.address_prefix and not any((namespace.ip_pools, namespace.ip_pool_start, namespace.ip_pool_end)): + # Validate only address-prefix when ip-pools is not provided + _validate_cidr(namespace.address_prefix) + + # Validate IP-Pools from --ip-pools parameter + _validate_ip_pools(namespace.address_prefix, namespace.ip_pools) + + # Validate IP-Pools from --ip-pool-start / --ip-pool-end parameters + if namespace.ip_pool_start and namespace.ip_pool_end: + ip_pools = [{'start' : namespace.ip_pool_start, 'end': namespace.ip_pool_end}] + _validate_ip_pools(namespace.address_prefix, ip_pools) + elif bool(namespace.ip_pool_start) ^ bool(namespace.ip_pool_end): + raise CLIError("Missing --ip-pool-start or --ip-pool-end. Both the parameters need to be provided together") + + _validate_dns_servers(namespace.dns_servers) + else: + # Validate Dynamic-IP conditions + if any((namespace.address_prefix, namespace.ip_pools, namespace.ip_pool_start, namespace.ip_pool_end, namespace.dns_servers)): + raise CLIError("Unsupported configuration. --address-prefix / --ip-pools / --ip-pool-start / --ip-pool-end / dns-servers can only be used when --ip-allocation-method is 'Static'") + + +def _validate_subnet(subnet): + """ + Validate subnet fields + """ + + subnet_properties = subnet.get('properties', {}) + address_prefix = subnet_properties.get('addressPrefix', None) + ip_allocation_method = subnet_properties.get('ipAllocationMethod', None) + ip_pools = subnet_properties.get('ipPools', None) + + if ip_allocation_method == "Static": + # Validate Static-IP conditions + if not address_prefix: + raise CLIError("Missing 'addressPrefix' field in subnets json string/file. 'addressPrefix' must be provided when 'ipAllocationMethod' is Static.") + elif address_prefix and not ip_pools: + # Validate only address-prefix when IP-Pools is not provided + _validate_cidr(address_prefix) + else: + # Validate IP-Pools + _validate_ip_pools(address_prefix, ip_pools) + else: + # Validate Dynamic-IP conditions + if any((address_prefix, ip_pools)): + raise CLIError("'addressPrefix' or 'ipPools' fields cannot be used in subnet when 'ipAllocationMethod' is Dynamic") + + +def _validate_ip_pools(address_prefix, ip_pools): + """ + Validates if the start or end IP address is within the cidr range + """ + + # Validate only if both address-prefix and ip-pools are present + if address_prefix and ip_pools: + address_prefix = _validate_cidr(address_prefix) + for ip_pool in ip_pools: + if ip_pool.get('start') and ip_pool.get('end'): + start = _validate_ip_address(ip_pool.get('start')) + end = _validate_ip_address(ip_pool.get('end')) + else: + raise CLIError("Missing start/end IP address in --ip-pools or --subnets. Please provide both start and end IP addresses.") + + # Validation for start/end IP range + if start not in address_prefix or end not in address_prefix: + raise CLIError("Invalid Input: Range {} {} is not within subnet address prefix {}".format(start, end, address_prefix)) + + +def _validate_cidr(cidr): + """ + Validates the network CIDR + """ + + try: + net_cidr = ipaddress.ip_network(cidr) + except: + raise CLIError("Invalid CIDR provided: {}".format(cidr)) + return net_cidr + + +def _validate_dns_servers(dnsservers): + """ + Validates DNS-Servers + """ + if dnsservers: + [_validate_ip_address(dnsserver) for dnsserver in dnsservers] + + +def _validate_ip_address(ip): + """ + Validates the IP address + """ + + try: + net_ip = ipaddress.ip_address(ip) + except: + raise CLIError("Invalid IP address: {}".format(ip)) + return net_ip + + +def _get_default_gateway_from_routes_dict(routes): + for route in routes: + address_prefix = route.get('properties', None).get('address_prefix', None) + next_hop_ip = route.get('properties', None).get('next_hop_ip_address', None) + if address_prefix == "0.0.0.0/0": + return next_hop_ip + + +def vnic_create_validator(cmd, namespace): + """ + Validates parameters for vnic creation operation + """ + + subnet_ip_allocation_method = default_ip_allocation_method + subnet_properties = None + + res = parse_resource_id(namespace.subnet_id) + vnet = _fetch_virtualnetwork(cmd.cli_ctx, res.get('resource_group', namespace.resource_group_name), res['name']) + + if len(vnet.properties.subnets): + # MOC supports only 1 subnet + subnet_properties = vnet.properties.subnets[0].properties + if subnet_properties: + subnet_ip_allocation_method = subnet_properties.ip_allocation_method or default_ip_allocation_method + subnet_address_prefix = subnet_properties.address_prefix + if subnet_address_prefix and namespace.ip_address: + _validate_vnic_static_ip_address(subnet_address_prefix, namespace.ip_address) + + if subnet_ip_allocation_method != "Static" and any((namespace.ip_address, namespace.gateway)): + raise CLIError("--ip-address and --gateway can be provided only if the associated virtualNetwork's --ip-allocation-method is Static") + + if subnet_ip_allocation_method == "Static" and namespace.gateway is None: + # Use the default gateway set in the vnet + if subnet_properties.route_table and subnet_properties.route_table.properties: + namespace.gateway = _get_default_gateway_from_routes_list(subnet_properties.route_table.properties.routes) + +def _get_default_gateway_from_routes_list(routes): + if routes is None: + return + for route in routes: + if route.properties and route.properties.address_prefix == "0.0.0.0/0": + return route.properties.next_hop_ip_address + + +def _fetch_virtualnetwork(cli_ctx, resource_group, name): + vnet_client = cf_virtualnetwork(cli_ctx=cli_ctx) + + vnet = vnet_client.retrieve(resource_group, name) + return vnet + +def _validate_vnic_static_ip_address(subnet_address_prefix, ip_address): + """ + Validates if the IP-Address provided by the user is within the subnet range + """ + ip = ipaddress.ip_address(ip_address) + network = ipaddress.ip_network(subnet_address_prefix) + if ip not in network: + raise CLIError("ip-address provided is not within the associated virtualnetwork's(or subnet's) address-prefix range. Please provide an IP address within the range of address-prefix.") diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py new file mode 100644 index 00000000000..412ecbd14c3 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py @@ -0,0 +1,353 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from collections import defaultdict +from knack.log import get_logger +from knack.util import CLIError +import json +from azure.cli.core.azclierror import InvalidArgumentValueError + + +logger = get_logger(__name__) + +class AddGalleryimagesExtendedLocation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.extended_location = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'name': + d['name'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' + 'type, name'.format(k)) + return d + + +class AddNetworkinterfacesExtendedLocation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.extended_location = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'name': + d['name'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' + 'type, name'.format(k)) + return d + + +class AddVirtualharddisksExtendedLocation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.extended_location = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'name': + d['name'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' + 'type, name'.format(k)) + return d + + +class AddVirtualmachinesExtendedLocation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.extended_location = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'name': + d['name'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' + 'type, name'.format(k)) + return d + + +class AddHardwareProfile(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.hardware_profile = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + dynamic_memory_config = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'vm-size': + d['vm_size'] = v[0] + elif kl == 'processors': + d['processors'] = v[0] + elif kl == 'memory-mb': + d['memory_mb'] = v[0] + elif kl == 'maximum-memory-mb': + dynamic_memory_config['maximum_memory_mb'] = int(v[0]) + elif kl == 'minimum-memory-mb': + dynamic_memory_config['minimum_memory_mb'] = int(v[0]) + elif kl == 'memory-gb': + logger.warning("'memory-gb' setting under option --hardware-profile has been deprecated and will be removed in a future release. Use 'memory-mb' instead.") + d['memory_mb'] = int(v[0]) * 1024 + elif kl == 'maximum-memory-gb': + logger.warning("'maximum-memory-gb' setting under option --hardware-profile has been deprecated and will be removed in a future release. Use 'maximum-memory-mb' instead.") + dynamic_memory_config['maximum_memory_mb'] = int(v[0]) * 1024 + elif kl == 'minimum-memory-gb': + logger.warning("'minimum-memory-gb' setting under option --hardware-profile has been deprecated and will be removed in a future release. Use 'minimum-memory-mb' instead.") + dynamic_memory_config['minimum_memory_mb'] = int(v[0]) * 1024 + elif kl == 'target-memory-buffer': + dynamic_memory_config['target_memory_buffer'] = int(v[0]) + else: + raise CLIError('Unsupported Key {} is provided for parameter hardware_profile. All possible keys are: ' + 'vm-size, processors, memory-mb, maximum-memory-mb, minimum-memory-mb, target-memory-buffer'.format(k)) + if dynamic_memory_config: + d['dynamic_memory_config'] = dynamic_memory_config + return d + + +class AddNetworkProfile(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.network_profile = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'network-interfaces': + d['network_interfaces'] = (json.loads(v[0])) + else: + raise CLIError('Unsupported Key {} is provided for parameter network_profile. All possible keys are: ' + 'network-interfaces'.format(k)) + return d + + +class AddSecurityProfile(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.security_profile = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'secure-boot-enabled': + d['uefi_settings'] = {} + d['uefi_settings']['secure_boot_enabled'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter security_profile. All possible keys are: ' + 'enable-tpm'.format(k)) + return d + + +class AddVirtualnetworksExtendedLocation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.extended_location = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'name': + d['name'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' + 'type, name'.format(k)) + return d + + +class AddStoragecontainersExtendedLocation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.extended_location = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'name': + d['name'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' + 'type, name'.format(k)) + return d + +class AddLinuxConfiguration(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + if action: + if hasattr(namespace, 'os_profile'): + if namespace.os_profile is None: + namespace.os_profile = {'linux_configuration': action} + else: + namespace.os_profile['linux_configuration'] = action + else: + namespace.os_profile = {'linux_configuration': action} + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + ssh_data = [] + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'ssh_keys': + ssh_data.extend(json.loads(i) for i in v) + else: + raise CLIError('Unsupported Key {} is provided for parameter linux_configuration. All possible keys are: ' + 'ssh_data'.format(k)) + if ssh_data: + return {'ssh': {'public_keys': ssh_data}} + return {} + +class AddStatus(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.status = action + + def get_action(self, values, option_string): + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise InvalidArgumentValueError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + + if kl == 'code': + d['code'] = v[0] + + elif kl == 'level': + d['level'] = v[0] + + elif kl == 'display-status': + d['display_status'] = v[0] + + elif kl == 'message': + d['message'] = v[0] + + elif kl == 'time': + d['time'] = v[0] + + else: + raise InvalidArgumentValueError( + 'Unsupported Key {} is provided for parameter status. All possible keys are: code, level,' + ' display-status, message, time'.format(k) + ) + + return d \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py new file mode 100644 index 00000000000..77f3490aa70 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py @@ -0,0 +1,145 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + +from ._validators import vm_create_validator, vnic_create_validator, vnet_create_validator + +def load_command_table(self, _): + + from azext_azurestackhci.generated._client_factory import cf_galleryimage + azurestackhci_galleryimage = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._galleryimages_operations#Galleryim' + 'agesOperations.{}', + client_factory=cf_galleryimage) + with self.command_group('azurestackhci image', azurestackhci_galleryimage, + client_factory=cf_galleryimage) as g: + g.custom_command('list', 'azurestackhci_galleryimage_list') + g.custom_command('create', 'azurestackhci_galleryimage_create') + g.custom_command('update', 'azurestackhci_galleryimage_update') + g.custom_command('delete', 'azurestackhci_galleryimage_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_galleryimage_show') + + from azext_azurestackhci.generated._client_factory import cf_galleryimage + azurestackhci_galleryimage = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._galleryimages_operations#Galleryim' + 'agesOperations.{}', + client_factory=cf_galleryimage) + with self.command_group('azurestackhci galleryimage', azurestackhci_galleryimage, + client_factory=cf_galleryimage) as g: + g.custom_command('list', 'azurestackhci_galleryimage_list') + g.custom_command('create', 'azurestackhci_galleryimage_create') + g.custom_command('update', 'azurestackhci_galleryimage_update') + g.custom_command('delete', 'azurestackhci_galleryimage_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_galleryimage_show') + + from azext_azurestackhci.generated._client_factory import cf_networkinterface + azurestackhci_networkinterface = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._networkinterfaces_operations#Netwo' + 'rkinterfacesOperations.{}', + client_factory=cf_networkinterface) + with self.command_group('azurestackhci networkinterface', azurestackhci_networkinterface, + client_factory=cf_networkinterface) as g: + g.custom_command('list', 'azurestackhci_networkinterface_list') + g.custom_command('create', 'azurestackhci_networkinterface_create', validator=vnic_create_validator) + g.custom_command('update', 'azurestackhci_networkinterface_update') + g.custom_command('delete', 'azurestackhci_networkinterface_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_networkinterface_show') + + from azext_azurestackhci.generated._client_factory import cf_virtualharddisk + azurestackhci_virtualharddisk = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._virtualharddisks_operations#Virtua' + 'lharddisksOperations.{}', + client_factory=cf_virtualharddisk) + with self.command_group('azurestackhci virtualharddisk', azurestackhci_virtualharddisk, + client_factory=cf_virtualharddisk) as g: + g.custom_command('list', 'azurestackhci_virtualharddisk_list') + g.custom_command('create', 'azurestackhci_virtualharddisk_create') + g.custom_command('update', 'azurestackhci_virtualharddisk_update') + g.custom_command('delete', 'azurestackhci_virtualharddisk_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_virtualharddisk_show') + + from azext_azurestackhci.generated._client_factory import cf_virtualmachine + azurestackhci_virtualmachine = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._virtualmachines_operations#Virtual' + 'machinesOperations.{}', + client_factory=cf_virtualmachine) + with self.command_group('azurestackhci virtualmachine', azurestackhci_virtualmachine, + client_factory=cf_virtualmachine) as g: + g.custom_command('list', 'azurestackhci_virtualmachine_list') + g.custom_command('create', 'azurestackhci_virtualmachine_create', validator=vm_create_validator) + g.custom_command('update', 'azurestackhci_virtualmachine_update') + g.custom_command('delete', 'azurestackhci_virtualmachine_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_virtualmachine_show') + g.custom_command('start', 'azurestackhci_virtualmachine_start') + g.custom_command('stop', 'azurestackhci_virtualmachine_stop') + g.custom_command('restart', 'azurestackhci_virtualmachine_restart') + + with self.command_group('azurestackhci virtualmachine vnic', azurestackhci_virtualmachine, + client_factory=cf_virtualmachine) as g: + g.custom_command('add', 'azurestackhci_virtualmachine_vnic_add') + g.custom_command('remove', 'azurestackhci_virtualmachine_vnic_remove', confirmation=True) + + from azext_azurestackhci.generated._client_factory import cf_virtualnetwork + azurestackhci_virtualnetwork = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._virtualnetworks_operations#Virtual' + 'networksOperations.{}', + client_factory=cf_virtualnetwork) + with self.command_group('azurestackhci virtualnetwork', azurestackhci_virtualnetwork, + client_factory=cf_virtualnetwork) as g: + g.custom_command('list', 'azurestackhci_virtualnetwork_list') + g.custom_command('create', 'azurestackhci_virtualnetwork_create', validator=vnet_create_validator) + g.custom_command('update', 'azurestackhci_virtualnetwork_update') + g.custom_command('delete', 'azurestackhci_virtualnetwork_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_virtualnetwork_show') + + from azext_azurestackhci.generated._client_factory import cf_storagecontainer + azurestackhci_storagecontainer = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._storagecontainers_operations#Stora' + 'gecontainersOperations.{}', + client_factory=cf_storagecontainer) + with self.command_group('azurestackhci storagepath', azurestackhci_storagecontainer, + client_factory=cf_storagecontainer) as g: + g.custom_command('list', 'azurestackhci_storagecontainer_list') + g.custom_command('create', 'azurestackhci_storagecontainer_create') + g.custom_command('update', 'azurestackhci_storagecontainer_update') + g.custom_command('delete', 'azurestackhci_storagecontainer_delete', confirmation=True) + g.custom_command('show', 'azurestackhci_storagecontainer_show') + + from azext_azurestackhci.generated._client_factory import cf_arc_vmextension + azurestackhci_arcvmextension = CliCommandType( + operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._arc_vmextensions_operations#ArcVmExtensions' + 'Operations.{}', + client_factory=cf_arc_vmextension) + with self.command_group('azurestackhci virtualmachine extension', azurestackhci_arcvmextension, + client_factory=cf_arc_vmextension) as g: + g.custom_command('create', 'azurestackhci_vmextension_create') + g.custom_command('show', 'azurestackhci_vmextension_show') + g.custom_command('delete', 'azurestackhci_vmextension_delete', confirmation=True) + g.custom_command('list', 'azurestackhci_vmextension_list') + g.custom_wait_command('wait', 'azurestackhci_vmextension_show') + g.custom_command('update', 'azurestackhci_vmextension_update') + + # from azext_azurestackhci.generated._client_factory import cf_cluster + # azurestackhci_cluster = CliCommandType( + # operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._clusters_operations#ClustersOperat' + # 'ions.{}', + # client_factory=cf_cluster) + # with self.command_group('azurestackhci cluster', azurestackhci_cluster, client_factory=cf_cluster) as g: + # g.custom_command('list', 'azurestackhci_cluster_list') + # g.custom_show_command('show', 'azurestackhci_cluster_show') + # g.custom_command('create', 'azurestackhci_cluster_create') + # g.custom_command('update', 'azurestackhci_cluster_update') + # g.custom_command('delete', 'azurestackhci_cluster_delete', confirmation=True) + + with self.command_group('azurestackhci', is_experimental=True): + pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py new file mode 100644 index 00000000000..a5078deb7a0 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py @@ -0,0 +1,847 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from azure.cli.core.azclierror import ArgumentUsageError, CLIError +from knack.prompting import prompt_y_n, NoTTYException +from azure.cli.core.util import sdk_no_wait +from .helpers import read_file +import json +import re + + +def azurestackhci_galleryimage_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_galleryimage_create(client, + resource_group_name, + name, + location, + tags=None, + extended_location=None, + storagepath_id=None, + image_path=None, + os_type=None, + offer=None, + publisher=None, + sku=None, + version=None, + polling_interval=None): + galleryimages = {} + galleryimages['location'] = location + galleryimages['tags'] = tags + galleryimages['extended_location'] = extended_location + galleryimages['properties'] = {} + galleryimages['properties']['storagepath_id'] = storagepath_id + galleryimages['properties']['image_path'] = image_path + galleryimages['properties']['identifier'] = None + + if (os_type is not None): + if (os_type.lower() == 'windows'): + os_type = 'Windows' + elif (os_type.lower() == 'linux'): + os_type = 'Linux' + else: + raise ArgumentUsageError("The supported os types for image creation are 'Windows' and 'Linux'.") + + galleryimages['properties']['os_type'] = os_type + + if (not re.match('[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$', name)): + raise ArgumentUsageError("The name must start and end with an alphanumeric character and must contain all alphanumeric characters or '-', '.', or '_'") + + if ((offer is not None) and (publisher is not None) and (sku is not None) and (version is not None)): + galleryimages['properties']['identifier'] = {} + galleryimages['properties']['identifier']['offer'] = offer + galleryimages['properties']['identifier']['publisher'] = publisher + galleryimages['properties']['identifier']['sku'] = sku + galleryimages['properties']['version'] = {} + galleryimages['properties']['version']['name'] = version + + if (image_path is None and not ((offer is not None) and (publisher is not None) and (sku is not None) and (version is not None))): + raise ArgumentUsageError('All required image specifications are not properly specified. Please specify --image-path which can be a local path or SAS uri , or (--offer, --publisher, --sku, and --version).') + + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.create_or_update(resource_group_name=resource_group_name, + galleryimages_name=name, + galleryimages=galleryimages) + + +def azurestackhci_galleryimage_update(client, + resource_group_name, + name, + tags=None, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.update(resource_group_name=resource_group_name, + galleryimages_name=name, + tags=tags) + + +def azurestackhci_galleryimage_delete(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.delete(resource_group_name=resource_group_name, + galleryimages_name=name) + + +def azurestackhci_galleryimage_show(client, + resource_group_name, + name): + return client.retrieve(resource_group_name=resource_group_name, + galleryimages_name=name) + + +def azurestackhci_networkinterface_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_networkinterface_create(client, + resource_group_name, + name, + location, + tags=None, + extended_location=None, + ip_configurations=None, + subnet_id=None, + gateway=None, + ip_address=None, + ip_allocation_method=None, + mac_address=None, + dns_servers=None, + polling_interval=None): + networkinterfaces = {} + networkinterfaces['location'] = location + networkinterfaces['tags'] = tags + networkinterfaces['extended_location'] = extended_location + networkinterfaces['properties'] = {} + networkinterfaces['properties']['ip_configurations'] = ip_configurations or list() + networkinterfaces['properties']['mac_address'] = mac_address + + if dns_servers: + networkinterfaces['properties']['dns_settings'] = {} + networkinterfaces['properties']['dns_settings']['dns_servers'] = dns_servers + + ipconfig = "" + if ip_configurations is None and subnet_id is None: + raise ArgumentUsageError("Network Interface should have atleast one IP Configuration. Please specify the --ip-configurations parameter and provide a IP Configuration") + if ip_configurations is not None and subnet_id is not None: + message = "Both `--ip-configurations` and `--subnet-id` are provided. This will result in ignoring subnet-id. Please refer help section for details. Do you want to continue?" + if not prompt_y_n(message, 'n'): + raise CLIError('Operation cancelled. Please use the command again with correct parameters') + if ip_configurations is not None: + if len(ip_configurations) == 0: + raise ArgumentUsageError("Empty network ip configurations are provided. Please specify the `--ip-configurations` correctly or pass the `subnet-id`") + i = 0 + while i < len(ip_configurations): + ipconfig = str(ip_configurations[i]).replace("\'","\"") + ipconfig = json.loads(ipconfig) + if ('properties' not in ipconfig or 'subnet' not in ipconfig['properties'] or 'id' not in ipconfig['properties']['subnet']): + raise ArgumentUsageError("Network Interface should have atleast one IP Configuration. \ +Please specify the --ip-configurations parameter and provide IP Configurations along with the subnet id for each ip config and the associated virtual network ID") + i = i + 1 + # IP Configurations + if ip_configurations is None and subnet_id is not None: + if len(subnet_id.strip()) == 0: + raise ArgumentUsageError("Empty network subnet-id provided. Please pass the `subnet-id` correctly or pass `ip-configurations`") + networkipconfig = {} + networkipconfig['name'] = 'ipconfig' + networkipconfig['properties'] = {} + networkipconfig['properties']['private_ip_address'] = ip_address + networkipconfig['properties']['gateway'] = gateway + networkipconfig['properties']['subnet'] = {} + networkipconfig['properties']['subnet']['id'] = subnet_id + networkinterfaces['properties']['ip_configurations'].append(networkipconfig) + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.create_or_update(resource_group_name=resource_group_name, + networkinterfaces_name=name, + networkinterfaces=networkinterfaces) + + +def azurestackhci_networkinterface_update(client, + resource_group_name, + name, + tags=None): + return client.update(resource_group_name=resource_group_name, + networkinterfaces_name=name, + tags=tags) + + +def azurestackhci_networkinterface_delete(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.delete(resource_group_name=resource_group_name, + networkinterfaces_name=name) + + +def azurestackhci_networkinterface_show(client, + resource_group_name, + name): + return client.retrieve(resource_group_name=resource_group_name, + networkinterfaces_name=name) + + +def azurestackhci_virtualharddisk_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_virtualharddisk_create(client, + resource_group_name, + name, + location, + tags=None, + extended_location=None, + block_size_bytes=None, + disk_size_bytes=None, + disk_size_gb=None, + disk_file_format=None, + dynamic=None, + logical_sector_bytes=None, + physical_sector_bytes=None, + storagepath_id=None, + polling_interval=None): + # For backward compatibility. disk_size_bytes is deprecated + if disk_size_bytes and not disk_size_gb: + disk_size_gb = disk_size_bytes + + virtualharddisks = {} + virtualharddisks['location'] = location + virtualharddisks['tags'] = tags + virtualharddisks['extended_location'] = extended_location + virtualharddisks['properties'] = {} + virtualharddisks['properties']['block_size_bytes'] = block_size_bytes + virtualharddisks['properties']['disk_size_gb'] = disk_size_gb + virtualharddisks['properties']['disk_file_format'] = disk_file_format + virtualharddisks['properties']['dynamic'] = dynamic + virtualharddisks['properties']['logical_sector_bytes'] = logical_sector_bytes + virtualharddisks['properties']['physical_sector_bytes'] = physical_sector_bytes + virtualharddisks['properties']['storagepath_id'] = storagepath_id + + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.create_or_update(resource_group_name=resource_group_name, + virtualharddisks_name=name, + virtualharddisks=virtualharddisks) + + +def azurestackhci_virtualharddisk_update(client, + resource_group_name, + name, + tags=None): + return client.update(resource_group_name=resource_group_name, + virtualharddisks_name=name, + tags=tags) + + +def azurestackhci_virtualharddisk_delete(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.delete(resource_group_name=resource_group_name, + virtualharddisks_name=name) + + +def azurestackhci_virtualharddisk_show(client, + resource_group_name, + name): + return client.retrieve(resource_group_name=resource_group_name, + virtualharddisks_name=name) + + +def azurestackhci_virtualmachine_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_virtualmachine_create(client, + resource_group_name, + name, + location, + tags=None, + extended_location=None, + hardware_profile=None, + image_reference=None, + network_profile=None, + nic_id=None, + os_profile=None, + security_profile = None, + enable_tpm=None, + storage_profile=None, + storagepath_id=None, + linux_configuration=None, + windows_configuration=None, + vm_size=None, + admin_password=None, + admin_username=None, + computer_name=None, + ssh_public_keys=None, + os_disk=None, + data_disk=None, + allow_password_auth=None, + disable_vm_management=None, + polling_interval=None): + virtualmachines = {} + virtualmachines['location'] = location + virtualmachines['tags'] = tags + virtualmachines['extended_location'] = extended_location + virtualmachines['properties'] = {} + virtualmachines['properties']['hardware_profile'] = hardware_profile or {} + virtualmachines['properties']['network_profile'] = network_profile or {} + virtualmachines['properties']['security_profile'] = security_profile or {} + virtualmachines['properties']['security_profile']['enable_tpm'] = True if enable_tpm else False + virtualmachines['properties']['storage_profile'] = storage_profile or {} + + if vm_size == "Default": + raise ArgumentUsageError("Invalid vm-size provided. 'Default' is not a supported vm-size.") + + if os_profile is None: + os_profile = {} + + if linux_configuration is None: + linux_configuration = {} + + if windows_configuration is None: + windows_configuration = {} + + # Enabling the vm arc agent by default and disabling it as per user's input + # If the user wants to disable guest management, VM Agent provisioning is disabled + if disable_vm_management == True: + windows_configuration['provision_vm_agent'] = False + linux_configuration['provision_vm_agent'] = False + # Otherwise, the provisioning will be enabled by default + else: + windows_configuration['provision_vm_agent'] = True + linux_configuration['provision_vm_agent'] = True + + # If provisioning vm agent, identity should be SystemAssigned + virtualmachines['identity'] = { 'type': 'SystemAssigned' } + + if allow_password_auth: + linux_configuration['disable_password_authentication'] = False + + # set the OS configurations for VM + if any(i is not None for i in (admin_username, admin_password)): + if admin_password is not None: + os_profile['admin_password'] = admin_password + if admin_username is not None: + os_profile['admin_username'] = admin_username + + if computer_name is not None: + os_profile['computer_name'] = computer_name + + if ssh_public_keys: + keys = [] + for key_path in ssh_public_keys: + key = read_file(key_path) + keys.append({'key_data': key}) + linux_configuration['ssh'] = {'public_keys': keys} + windows_configuration['ssh'] = {'public_keys': keys} + + # Overriden Variables + if image_reference is not None: + virtualmachines['properties']['storage_profile']['image_reference'] = {'id': image_reference} + if os_disk is not None: + virtualmachines['properties']['storage_profile']['os_disk'] = {'id': os_disk} + if storagepath_id is not None: + virtualmachines['properties']['storage_profile']['storagepath_id'] = storagepath_id + if data_disk is not None: + virtualmachines['properties']['storage_profile']['data_disks'] = [] + for disk in data_disk: + virtualmachines['properties']['storage_profile']['data_disks'].append({'id': disk}) + if nic_id is not None: + virtualmachines['properties']['network_profile']['network_interfaces'] = [{'id' : nic_id}] + if vm_size is not None: + virtualmachines['properties']['hardware_profile']['vm_size'] = vm_size + + if windows_configuration: + os_profile['windows_configuration'] = windows_configuration + if linux_configuration: + os_profile['linux_configuration'] = linux_configuration + if os_profile: + virtualmachines['properties']['os_profile'] = os_profile + + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.create_or_update(resource_group_name=resource_group_name, + virtualmachines_name=name, + virtualmachines=virtualmachines) + + +def azurestackhci_virtualmachine_update(client, + resource_group_name, + name, + tags=None, + cpu_count=None, + memory_gb=None, + memory_mb=None, + vnic_names=None, + vhd_names=None, + polling_interval=None): + # For backward compatibility. memory_gb is deprecated + if memory_gb and not memory_mb: + memory_mb = memory_gb * 1024 + + virtualmachine_properties = {} + if cpu_count is not None or memory_mb is not None: + virtualmachine_properties['hardware_profile'] = {} + if cpu_count is not None: + virtualmachine_properties['hardware_profile']['processors'] = cpu_count + if memory_mb is not None: + virtualmachine_properties['hardware_profile']['memory_mb'] = memory_mb + + if vnic_names is not None: + virtualmachine_properties['network_profile'] = { 'network_interfaces' : [] } + for vnic_name in vnic_names: + virtualmachine_properties['network_profile']['network_interfaces'].append({'id': vnic_name}) + + if vhd_names is not None: + virtualmachine_properties['storage_profile'] = {'data_disks': [] } + for vhd_name in vhd_names: + virtualmachine_properties['storage_profile']['data_disks'].append({'id': vhd_name}) + + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.update(resource_group_name=resource_group_name, + virtualmachines_name=name, + properties=virtualmachine_properties, + tags=tags) + + +def azurestackhci_virtualmachine_delete(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.delete(resource_group_name=resource_group_name, + virtualmachines_name=name) + + +def azurestackhci_virtualmachine_show(client, + resource_group_name, + name): + return client.retrieve(resource_group_name=resource_group_name, + virtualmachines_name=name) + + +def azurestackhci_virtualmachine_start(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.start(resource_group_name=resource_group_name, + virtualmachines_name=name) + + +def azurestackhci_virtualmachine_stop(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.stop(resource_group_name=resource_group_name, + virtualmachines_name=name) + +def azurestackhci_virtualmachine_restart(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.restart(resource_group_name=resource_group_name, + virtualmachines_name=name) + +def azurestackhci_virtualmachine_vnic_add(client, + resource_group_name, + name, + vnic_names): + return client.add_vnic(resource_group_name=resource_group_name, + virtualmachines_name=name, vnic_names=vnic_names) + +def azurestackhci_virtualmachine_vnic_remove(client, + resource_group_name, + name, + vnic_names): + return client.remove_vnic(resource_group_name=resource_group_name, + virtualmachines_name=name, vnic_names=vnic_names) + +def azurestackhci_virtualnetwork_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_virtualnetwork_create(client, + resource_group_name, + name, + location, + tags=None, + extended_location=None, + network_type=None, + subnets=None, + address_prefix=None, + ip_allocation_method=None, + ip_pools=None, + ip_pool_type=None, + ip_pool_start=None, + ip_pool_end=None, + vlan=0, + routes=None, + gateway=None, + vm_switch_name=None, + dns_servers=None, + polling_interval=None): + virtualnetworks = {} + virtualnetworks['location'] = location + virtualnetworks['tags'] = tags + virtualnetworks['extended_location'] = extended_location + virtualnetworks['properties'] = {} + virtualnetworks['properties']['network_type'] = network_type + virtualnetworks['properties']['subnets'] = subnets or list() + virtualnetworks['properties']['vm_switch_name'] = vm_switch_name + + if dns_servers: + virtualnetworks['properties']['dhcp_options'] = {} + virtualnetworks['properties']['dhcp_options']['dns_servers'] = dns_servers + + if subnets is None and any([param for param in (address_prefix, ip_pool_start, ip_pool_end, ip_pool_type, ip_allocation_method, ip_pools, vlan, routes, gateway)]): + + # Subnets + subnet = {} + subnet['name'] = name + subnet['properties'] = {} + subnet['properties']['address_prefix'] = address_prefix + subnet['properties']['ip_allocation_method'] = ip_allocation_method + subnet['properties']['ip_pools'] = ip_pools or list() + subnet['properties']['vlan'] = vlan + + # IPPools + if any([param for param in (ip_pool_type, ip_pool_start, ip_pool_end)]): + ippool = {} + ippool['ip_pool_type'] = ip_pool_type + ippool['start'] = ip_pool_start + ippool['end'] = ip_pool_end + + subnet['properties']['ip_pools'].append(ippool) + + if routes: + # Route table + subnet['properties']['route_table'] = {} + routeTable = {} + routeTable['name'] = name + "-RT" + routeTable['properties'] = {} + routeTable['properties']['routes'] = routes or list() + subnet['properties']['route_table'] = routeTable + + if gateway: + # Add default route + default_route = {} + default_route['name'] = name + "-default-route" + default_route['properties'] = {} + default_route['properties']['address_prefix'] = "0.0.0.0/0" + default_route['properties']['next_hop_ip_address'] = gateway + + if 'route_table' in subnet['properties']: + subnet['properties']['route_table']['properties']['routes'].append(default_route) + else: + routeTable = {} + routeTable['name'] = name + "-RT" + routeTable['properties'] = {} + routeTable['properties']['routes'] = list() + routeTable['properties']['routes'].append(default_route) + subnet['properties']['route_table'] = routeTable + + virtualnetworks['properties']['subnets'].append(subnet) + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.create_or_update(resource_group_name=resource_group_name, + virtualnetworks_name=name, + virtualnetworks=virtualnetworks) + + +def azurestackhci_virtualnetwork_update(client, + resource_group_name, + name, + tags=None, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.update(resource_group_name=resource_group_name, + virtualnetworks_name=name, + tags=tags) + + +def azurestackhci_virtualnetwork_delete(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.delete(resource_group_name=resource_group_name, + virtualnetworks_name=name) + + +def azurestackhci_virtualnetwork_show(client, + resource_group_name, + name): + return client.retrieve(resource_group_name=resource_group_name, + virtualnetworks_name=name) + + +def azurestackhci_storagecontainer_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_storagecontainer_create(client, + resource_group_name, + name, + location, + tags=None, + extended_location=None, + path=None, + polling_interval=None): + storagecontainers = {} + storagecontainers['location'] = location + storagecontainers['tags'] = tags + storagecontainers['extended_location'] = extended_location + storagecontainers['properties'] = {} + storagecontainers['properties']['path'] = path + + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.create_or_update(resource_group_name=resource_group_name, + storagecontainers_name=name, + storagecontainers=storagecontainers) + + +def azurestackhci_storagecontainer_update(client, + resource_group_name, + name, + tags=None): + return client.update(resource_group_name=resource_group_name, + storagecontainers_name=name, + tags=tags) + + +def azurestackhci_storagecontainer_delete(client, + resource_group_name, + name, + polling_interval=None): + if polling_interval: + client.config.long_running_operation_timeout=polling_interval + return client.delete(resource_group_name=resource_group_name, + storagecontainers_name=name) + + +def azurestackhci_storagecontainer_show(client, + resource_group_name, + name): + return client.retrieve(resource_group_name=resource_group_name, + storagecontainers_name=name) + + +def azurestackhci_cluster_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def azurestackhci_cluster_show(client, + resource_group_name, + name): + return client.get(resource_group_name=resource_group_name, + cluster_name=name) + + +def azurestackhci_cluster_create(client, + resource_group_name, + name, + location, + tags=None, + aad_client_id=None, + aad_tenant_id=None): + cluster = {} + cluster['tags'] = tags + cluster['location'] = location + cluster['aad_client_id'] = aad_client_id + cluster['aad_tenant_id'] = aad_tenant_id + return client.create(resource_group_name=resource_group_name, + cluster_name=name, + cluster=cluster) + + +def azurestackhci_cluster_update(client, + resource_group_name, + name, + tags=None): + cluster = {} + cluster['tags'] = tags + return client.update(resource_group_name=resource_group_name, + cluster_name=name, + cluster=cluster) + + +def azurestackhci_cluster_delete(client, + resource_group_name, + name): + return client.delete(resource_group_name=resource_group_name, + cluster_name=name) + +def azurestackhci_vmextension_create(client, + resource_group_name, + virtualmachine_name, + name, + location, + tags=None, + force_update_tag=None, + publisher=None, + extension_type=None, + type_handler_version=None, + enable_auto_upgrade=None, + auto_upgrade_minor=None, + settings=None, + protected_settings=None, + instance_view_type=None, + inst_handler_version=None, + status=None, + no_wait=False): + extensionParameters = {} + extensionParameters['tags'] = tags + extensionParameters['location'] = location + extensionParameters['properties'] = {} + extensionParameters['properties']['location'] = location + if force_update_tag is not None: + extensionParameters['properties']['force_update_tag'] = force_update_tag + if publisher is not None: + extensionParameters['properties']['publisher'] = publisher + if extension_type is not None: + extensionParameters['properties']['extension_type'] = extension_type + if type_handler_version is not None: + extensionParameters['properties']['type_handler_version'] = type_handler_version + if enable_auto_upgrade is not None: + extensionParameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade + if auto_upgrade_minor is not None: + extensionParameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor + if settings is not None: + extensionParameters['properties']['settings'] = settings + if protected_settings is not None: + extensionParameters['properties']['protected_settings'] = protected_settings + extensionParameters['properties']['instance_view'] = {} + extensionParameters['properties']['instance_view']['name'] = name + if instance_view_type is not None: + extensionParameters['properties']['instance_view']['type'] = instance_view_type + if inst_handler_version is not None: + extensionParameters['properties']['instance_view']['type_handler_version'] = inst_handler_version + if status is not None: + extensionParameters['properties']['instance_view']['status'] = status + if len(extensionParameters['properties']['instance_view']) == 0: + del extensionParameters['properties']['instance_view'] + return sdk_no_wait(no_wait, + client.create, + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name, + extensionParameters=extensionParameters) + +def azurestackhci_vmextension_update(client, + resource_group_name, + virtualmachine_name, + name, + tags=None, + force_update_tag=None, + publisher=None, + extension_type=None, + type_handler_version=None, + enable_auto_upgrade=None, + auto_upgrade_minor=None, + settings=None, + protected_settings=None, + no_wait=False): + extension_parameters = {} + if tags is not None: + extension_parameters['tags'] = tags + extension_parameters['properties'] = {} + if force_update_tag is not None: + extension_parameters['properties']['force_update_tag'] = force_update_tag + if publisher is not None: + extension_parameters['properties']['publisher'] = publisher + if extension_type is not None: + extension_parameters['properties']['extension_type'] = extension_type + if type_handler_version is not None: + extension_parameters['properties']['type_handler_version'] = type_handler_version + if enable_auto_upgrade is not None: + extension_parameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade + if auto_upgrade_minor is not None: + extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor + if settings is not None: + extension_parameters['properties']['settings'] = settings + if protected_settings is not None: + extension_parameters['properties']['protected_settings'] = protected_settings + if len(extension_parameters['properties']) == 0: + del extension_parameters['properties'] + return sdk_no_wait(no_wait, + client.update, + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name, + extension_parameters=extension_parameters) + +def azurestackhci_vmextension_show(client, + resource_group_name, + virtualmachine_name, + name): + return client.get(resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name) + +def azurestackhci_vmextension_list(client, + resource_group_name, + virtualmachine_name): + return client.list_by_virtualmachine_name(resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name) + +def azurestackhci_vmextension_delete(client, + resource_group_name, + virtualmachine_name, + name, + no_wait=False): + return sdk_no_wait(no_wait, + client.delete, + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py new file mode 100644 index 00000000000..bea0a0e5b19 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from knack.util import CLIError +from azure.cli.core.util import read_file_content + +def read_file(file_path): + path = os.path.expanduser(file_path) + if os.path.exists(path): + return read_file_content(path) + else: + raise CLIError('File not found: {}'.format(file_path)) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/__init__.py similarity index 100% rename from src/stack-hci-vm/azext_stack_hci_vm/tests/__init__.py rename to src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/__init__.py diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py new file mode 100644 index 00000000000..0cd3543ebd2 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py @@ -0,0 +1,503 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +from .. import try_manual + + +# EXAMPLE: /Clusters/put/Create cluster +@try_manual +def step_cluster_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci cluster create ' + '--location "East US" ' + '--aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" ' + '--aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Clusters/get/Get cluster +@try_manual +def step_cluster_show(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci cluster show ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Clusters/get/List clusters in a given resource group +@try_manual +def step_cluster_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci cluster list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Clusters/get/List clusters in a given subscription +@try_manual +def step_cluster_list2(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci cluster list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /Clusters/patch/Update cluster +@try_manual +def step_cluster_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci cluster update ' + '--tags tag1="value1" tag2="value2" ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Clusters/delete/Delete cluster +@try_manual +def step_cluster_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci cluster delete -y ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /galleryimages/put/PutGalleryImage +@try_manual +def step_galleryimage_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci galleryimage create ' + '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' + 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' + '--location "West US2" ' + '--container-name "Default_Container" ' + '--image-path "C:\\\\test.vhdx" ' + '--galleryimages-name "test-gallery-image" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /galleryimages/get/GetGalleryImage +@try_manual +def step_galleryimage_retrieve(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci galleryimage retrieve ' + '--galleryimages-name "test-gallery-image" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /galleryimages/get/ListGalleryImageByResourceGroup +@try_manual +def step_galleryimage_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci galleryimage list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /galleryimages/patch/UpdateGalleryImage +@try_manual +def step_galleryimage_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci galleryimage update ' + '--tags additionalProperties="sample" ' + '--galleryimages-name "test-gallery-image" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /galleryimages/delete/DeleteGalleryImage +@try_manual +def step_galleryimage_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci galleryimage delete -y ' + '--galleryimages-name "test-gallery-image" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /networkinterfaces/put/PutNetworkInterface +@try_manual +def step_networkinterface_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci networkinterface create ' + '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' + 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' + '--location "West US2" ' + '--name "test-nic" ' + '--subnet_id "test-vnet" ' + '--gateway "sample_gateway" ' + '--prefix_length "16" ' + '--ip_address "1.2.3.4" ' + '--ip_allocation_method "Static" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /networkinterfaces/get/GetNetworkInterface +@try_manual +def step_networkinterface_retrieve(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci networkinterface retrieve ' + '--networkinterfaces-name "test-nic" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /networkinterfaces/get/ListNetworkInterfaceByResourceGroup +@try_manual +def step_networkinterface_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci networkinterface list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /networkinterfaces/get/ListNetworkInterfaceBySubscription +@try_manual +def step_networkinterface_list2(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci networkinterface list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /networkinterfaces/patch/UpdateNetworkInterface +@try_manual +def step_networkinterface_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci networkinterface update ' + '--tags additionalProperties="sample" ' + '--networkinterfaces-name "test-nic" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /networkinterfaces/delete/DeleteNetworkInterface +@try_manual +def step_networkinterface_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci networkinterface delete -y ' + '--networkinterfaces-name "test-nic" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /storagecontainers/put/PutStorageContainer +@try_manual +def step_storagecontainer_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci storagecontainer create ' + '--resource-group "{rg}" ' + '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' + 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' + '--location "West US2" ' + '--path "C:\\\\container_storage" ' + '--storagecontainers-name "Default_Container"', + checks=checks) + + +# EXAMPLE: /storagecontainers/get/GetStorageContainer +@try_manual +def step_storagecontainer_retrieve(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci storagecontainer retrieve ' + '--resource-group "{rg}" ' + '--storagecontainers-name "Default_Container"', + checks=checks) + + +# EXAMPLE: /storagecontainers/get/ListStorageContainerByResourceGroup +@try_manual +def step_storagecontainer_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci storagecontainer list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /storagecontainers/patch/UpdateStorageContainer +@try_manual +def step_storagecontainer_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci storagecontainer update ' + '--resource-group "{rg}" ' + '--tags additionalProperties="sample" ' + '--storagecontainers-name "Default_Container"', + checks=checks) + + +# EXAMPLE: /storagecontainers/delete/DeleteStorageContainer +@try_manual +def step_storagecontainer_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci storagecontainer delete -y ' + '--resource-group "{rg}" ' + '--storagecontainers-name "Default_Container"', + checks=checks) + + +# EXAMPLE: /virtualharddisks/put/PutVirtualHardDisk +@try_manual +def step_virtualharddisk_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualharddisk create ' + '--resource-group "{rg}" ' + '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' + 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' + '--location "West US2" ' + '--disk-size-gb 32 ' + '--virtualharddisks-name "test-vhd"', + checks=checks) + + +# EXAMPLE: /virtualharddisks/get/GetVirtualHardDisk +@try_manual +def step_virtualharddisk_retrieve(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualharddisk retrieve ' + '--resource-group "{rg}" ' + '--virtualharddisks-name "test-vhd"', + checks=checks) + + +# EXAMPLE: /virtualharddisks/get/ListVirtualHardDiskByResourceGroup +@try_manual +def step_virtualharddisk_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualharddisk list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /virtualharddisks/patch/UpdateVirtualHardDisk +@try_manual +def step_virtualharddisk_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualharddisk update ' + '--resource-group "{rg}" ' + '--tags additionalProperties="sample" ' + '--virtualharddisks-name "test-vhd"', + checks=checks) + + +# EXAMPLE: /virtualharddisks/delete/DeleteVirtualHardDisk +@try_manual +def step_virtualharddisk_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualharddisk delete -y ' + '--resource-group "{rg}" ' + '--virtualharddisks-name "test-vhd"', + checks=checks) + + +# EXAMPLE: /virtualmachines/put/PutVirtualMachine +@try_manual +def step_virtualmachine_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine create ' + '--resource-group "{rg}" ' + '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' + 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' + '--location "West US2" ' + '--hardware-profile vm-size="Default" ' + '--network-profile network-interfaces={{"id":"test-nic"}} ' + '--os-profile "{{\\"adminPassword\\":\\"password\\",\\"adminUsername\\":\\"localadmin\\",\\"computerName\\' + '":\\"luamaster\\"}}" ' + '--storage-profile "{{\\"imageReference\\":{{\\"id\\":\\"test-gallery-image\\"}}}}" ' + '--virtualmachines-name "test-vm"', + checks=checks) + + +# EXAMPLE: /virtualmachines/get/GetVirtualMachine +@try_manual +def step_virtualmachine_retrieve(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine retrieve ' + '--resource-group "{rg}" ' + '--virtualmachines-name "test-vm"', + checks=checks) + + +# EXAMPLE: /virtualmachines/get/ListVirtualMachineByResourceGroup +@try_manual +def step_virtualmachine_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /virtualmachines/get/ListVirtualMachineBySubscription +@try_manual +def step_virtualmachine_list2(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /virtualmachines/patch/UpdateVirtualMachine +@try_manual +def step_virtualmachine_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine update ' + '--resource-group "{rg}" ' + '--tags additionalProperties="sample" ' + '--virtualmachines-name "test-vm"', + checks=checks) + + +# EXAMPLE: /virtualmachines/post/StartVirtualMachine +@try_manual +def step_virtualmachine_start(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine start ' + '--resource-group "{rg}" ' + '--virtualmachines-name "test-vm"', + checks=checks) + + +# EXAMPLE: /virtualmachines/post/StopVirtualMachine +@try_manual +def step_virtualmachine_stop(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine stop ' + '--resource-group "{rg}" ' + '--virtualmachines-name "test-vm"', + checks=checks) + + +# EXAMPLE: /virtualmachines/delete/DeleteVirtualMachine +@try_manual +def step_virtualmachine_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualmachine delete -y ' + '--resource-group "{rg}" ' + '--virtualmachines-name "test-vm"', + checks=checks) + + +# EXAMPLE: /virtualnetworks/put/PutVirtualNetwork +@try_manual +def step_virtualnetwork_create(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualnetwork create ' + '--resource-group "{rg}" ' + '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' + 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' + '--location "West US2" ' + '--network-type "Transparent" ' + '--name "test-vnet" ', + '--address-prefix "10.0.0.0/16" ', + '--ip-allocation-method "Static" ', + '--ip-pool-type "vm" ', + '--ip-pool-start "10.0.0.0" ', + '--ip-pool-end "10.0.0.16" ' + '--vlan 10', + '--vm-switch-name "test-vm-switch', + checks=checks) + + +# EXAMPLE: /virtualnetworks/get/GetVirtualNetwork +@try_manual +def step_virtualnetwork_retrieve(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualnetwork retrieve ' + '--resource-group "{rg}" ' + '--virtualnetworks-name "test-vnet"', + checks=checks) + + +# EXAMPLE: /virtualnetworks/get/ListVirtualNetworkByResourceGroup +@try_manual +def step_virtualnetwork_list(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualnetwork list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /virtualnetworks/get/ListVirtualNetworkBySubscription +@try_manual +def step_virtualnetwork_list2(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualnetwork list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /virtualnetworks/patch/UpdateVirtualNetwork +@try_manual +def step_virtualnetwork_update(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualnetwork update ' + '--resource-group "{rg}" ' + '--tags additionalProperties="sample" ' + '--virtualnetworks-name "test-vnet"', + checks=checks) + + +# EXAMPLE: /virtualnetworks/delete/DeleteVirtualNetwork +@try_manual +def step_virtualnetwork_delete(test, rg_2, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az azurestackhci virtualnetwork delete -y ' + '--resource-group "{rg}" ' + '--virtualnetworks-name "test-vnet"', + checks=checks) + diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py new file mode 100644 index 00000000000..4684d382b7a --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py @@ -0,0 +1,169 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_cluster_create +from .example_steps import step_cluster_show +from .example_steps import step_cluster_list +from .example_steps import step_cluster_list2 +from .example_steps import step_cluster_update +from .example_steps import step_cluster_delete +from .example_steps import step_galleryimage_create +from .example_steps import step_galleryimage_retrieve +from .example_steps import step_galleryimage_list +from .example_steps import step_galleryimage_update +from .example_steps import step_galleryimage_delete +from .example_steps import step_networkinterface_create +from .example_steps import step_networkinterface_retrieve +from .example_steps import step_networkinterface_list +from .example_steps import step_networkinterface_list2 +from .example_steps import step_networkinterface_update +from .example_steps import step_networkinterface_delete +from .example_steps import step_storagecontainer_create +from .example_steps import step_storagecontainer_retrieve +from .example_steps import step_storagecontainer_list +from .example_steps import step_storagecontainer_update +from .example_steps import step_storagecontainer_delete +from .example_steps import step_virtualharddisk_create +from .example_steps import step_virtualharddisk_retrieve +from .example_steps import step_virtualharddisk_list +from .example_steps import step_virtualharddisk_update +from .example_steps import step_virtualharddisk_delete +from .example_steps import step_virtualmachine_create +from .example_steps import step_virtualmachine_retrieve +from .example_steps import step_virtualmachine_list +from .example_steps import step_virtualmachine_list2 +from .example_steps import step_virtualmachine_update +from .example_steps import step_virtualmachine_start +from .example_steps import step_virtualmachine_stop +from .example_steps import step_virtualmachine_delete +from .example_steps import step_virtualnetwork_create +from .example_steps import step_virtualnetwork_retrieve +from .example_steps import step_virtualnetwork_list +from .example_steps import step_virtualnetwork_list2 +from .example_steps import step_virtualnetwork_update +from .example_steps import step_virtualnetwork_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg_2, rg): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg_2, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg_2, rg): + setup_scenario(test, rg_2, rg) + step_cluster_create(test, rg_2, rg, checks=[ + test.check("location", "East US", case_sensitive=False), + test.check("aadClientId", "24a6e53d-04e5-44d2-b7cc-1b732a847dfc", case_sensitive=False), + test.check("aadTenantId", "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94", case_sensitive=False), + test.check("name", "{myCluster}", case_sensitive=False), + ]) + step_cluster_show(test, rg_2, rg, checks=[ + test.check("location", "East US", case_sensitive=False), + test.check("aadClientId", "24a6e53d-04e5-44d2-b7cc-1b732a847dfc", case_sensitive=False), + test.check("aadTenantId", "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94", case_sensitive=False), + test.check("name", "{myCluster}", case_sensitive=False), + ]) + step_cluster_list(test, rg_2, rg, checks=[ + test.check('length(@)', 1), + ]) + step_cluster_list2(test, rg_2, rg, checks=[ + test.check('length(@)', 1), + ]) + step_cluster_update(test, rg_2, rg, checks=[ + test.check("location", "East US", case_sensitive=False), + test.check("aadTenantId", "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94", case_sensitive=False), + test.check("name", "{myCluster}", case_sensitive=False), + test.check("tags.tag1", "value1", case_sensitive=False), + test.check("tags.tag2", "value2", case_sensitive=False), + ]) + step_cluster_delete(test, rg_2, rg, checks=[]) + step_galleryimage_create(test, rg_2, rg, checks=[]) + step_galleryimage_retrieve(test, rg_2, rg, checks=[]) + step_galleryimage_list(test, rg_2, rg, checks=[]) + step_galleryimage_list(test, rg_2, rg, checks=[]) + step_galleryimage_update(test, rg_2, rg, checks=[]) + step_galleryimage_delete(test, rg_2, rg, checks=[]) + step_networkinterface_create(test, rg_2, rg, checks=[]) + step_networkinterface_retrieve(test, rg_2, rg, checks=[]) + step_networkinterface_list(test, rg_2, rg, checks=[]) + step_networkinterface_list2(test, rg_2, rg, checks=[]) + step_networkinterface_update(test, rg_2, rg, checks=[]) + step_networkinterface_delete(test, rg_2, rg, checks=[]) + step_storagecontainer_create(test, rg_2, rg, checks=[]) + step_storagecontainer_retrieve(test, rg_2, rg, checks=[]) + step_storagecontainer_list(test, rg_2, rg, checks=[]) + step_storagecontainer_list(test, rg_2, rg, checks=[]) + step_storagecontainer_update(test, rg_2, rg, checks=[]) + step_storagecontainer_delete(test, rg_2, rg, checks=[]) + step_virtualharddisk_create(test, rg_2, rg, checks=[]) + step_virtualharddisk_retrieve(test, rg_2, rg, checks=[]) + step_virtualharddisk_list(test, rg_2, rg, checks=[]) + step_virtualharddisk_list(test, rg_2, rg, checks=[]) + step_virtualharddisk_update(test, rg_2, rg, checks=[]) + step_virtualharddisk_delete(test, rg_2, rg, checks=[]) + step_virtualmachine_create(test, rg_2, rg, checks=[]) + step_virtualmachine_retrieve(test, rg_2, rg, checks=[]) + step_virtualmachine_list(test, rg_2, rg, checks=[]) + step_virtualmachine_list2(test, rg_2, rg, checks=[]) + step_virtualmachine_update(test, rg_2, rg, checks=[]) + step_virtualmachine_start(test, rg_2, rg, checks=[]) + step_virtualmachine_stop(test, rg_2, rg, checks=[]) + step_virtualmachine_delete(test, rg_2, rg, checks=[]) + step_virtualnetwork_create(test, rg_2, rg, checks=[]) + step_virtualnetwork_retrieve(test, rg_2, rg, checks=[]) + step_virtualnetwork_list(test, rg_2, rg, checks=[]) + step_virtualnetwork_list2(test, rg_2, rg, checks=[]) + step_virtualnetwork_update(test, rg_2, rg, checks=[]) + step_virtualnetwork_delete(test, rg_2, rg, checks=[]) + cleanup_scenario(test, rg_2, rg) + + +# Test class for Scenario +@try_manual +class AzurestackhciScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(AzurestackhciScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myCluster': 'myCluster', + }) + + + @ResourceGroupPreparer(name_prefix='clitestazurestackhci_dogfoodarc'[:7], key='rg_2', parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestazurestackhci_test-rg'[:7], key='rg', parameter_name='rg') + def test_azurestackhci_Scenario(self, rg_2, rg): + call_scenario(self, rg_2, rg) + calc_coverage(__file__) + raise_if() + diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py new file mode 100644 index 00000000000..67630aacb5a --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import AzureStackHCIClientConfiguration +from ._azure_stack_hci_client import AzureStackHCIClient +__all__ = ['AzureStackHCIClient', 'AzureStackHCIClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py new file mode 100644 index 00000000000..553d9e13358 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import AzureStackHCIConfiguration +from .operations import GalleryimagesOperations +from .operations import NetworkinterfacesOperations +from .operations import Operations +from .operations import VirtualharddisksOperations +from .operations import VirtualmachinesOperations +from .operations import VirtualnetworksOperations +from .operations import StoragecontainersOperations +from .operations import ClustersOperations +from .operations import ArcVmExtensionsOperations +from . import models + + +class AzureStackHCI(object): + """The Microsoft.AzureStackHCI Rest API spec. + + :ivar galleryimages: GalleryimagesOperations operations + :vartype galleryimages: azure_stack_hci.operations.GalleryimagesOperations + :ivar networkinterfaces: NetworkinterfacesOperations operations + :vartype networkinterfaces: azure_stack_hci.operations.NetworkinterfacesOperations + :ivar operations: Operations operations + :vartype operations: azure_stack_hci.operations.Operations + :ivar virtualharddisks: VirtualharddisksOperations operations + :vartype virtualharddisks: azure_stack_hci.operations.VirtualharddisksOperations + :ivar virtualmachines: VirtualmachinesOperations operations + :vartype virtualmachines: azure_stack_hci.operations.VirtualmachinesOperations + :ivar virtualnetworks: VirtualnetworksOperations operations + :vartype virtualnetworks: azure_stack_hci.operations.VirtualnetworksOperations + :ivar storagecontainers: StoragecontainersOperations operations + :vartype storagecontainers: azure_stack_hci.operations.StoragecontainersOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure_stack_hci.operations.ClustersOperations + :ivar arcvmextensions: ArcVmExtensions operations + :vartype arcvmextensions: azure_stack_hci.operations.ArcVmExtensions + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureStackHCIConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.galleryimages = GalleryimagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.networkinterfaces = NetworkinterfacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.virtualharddisks = VirtualharddisksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtualmachines = VirtualmachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtualnetworks = VirtualnetworksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storagecontainers = StoragecontainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.clusters = ClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.arcvmextensions = ArcVmExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureStackHCI + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py new file mode 100644 index 00000000000..9be9b6d2fbd --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import AzureStackHCIClientConfiguration +from .operations import GalleryimagesOperations +from .operations import NetworkinterfacesOperations +from .operations import Operations +from .operations import VirtualharddisksOperations +from .operations import VirtualmachinesOperations +from .operations import VirtualnetworksOperations +from .operations import StoragecontainersOperations +from .operations import ClustersOperations +from .operations import ArcVmExtensionsOperations +from . import models + + +class AzureStackHCIClient(SDKClient): + """Azure Stack HCI management service + + :ivar config: Configuration for client. + :vartype config: AzureStackHCIClientConfiguration + + :ivar galleryimages: Galleryimages operations + :vartype galleryimages: azure.mgmt.azurestackhci.operations.GalleryimagesOperations + :ivar networkinterfaces: Networkinterfaces operations + :vartype networkinterfaces: azure.mgmt.azurestackhci.operations.NetworkinterfacesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azurestackhci.operations.Operations + :ivar virtualharddisks: Virtualharddisks operations + :vartype virtualharddisks: azure.mgmt.azurestackhci.operations.VirtualharddisksOperations + :ivar virtualmachines: Virtualmachines operations + :vartype virtualmachines: azure.mgmt.azurestackhci.operations.VirtualmachinesOperations + :ivar virtualnetworks: Virtualnetworks operations + :vartype virtualnetworks: azure.mgmt.azurestackhci.operations.VirtualnetworksOperations + :ivar storagecontainers: Storagecontainers operations + :vartype storagecontainers: azure.mgmt.azurestackhci.operations.StoragecontainersOperations + :ivar clusters: Clusters operations + :vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations + :ivar arcvmextensions: ArcVmExtensions operations + :vartype arcvmextensions: azure.mgmt.azurestackhci.operations.ArcVmExtensionsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AzureStackHCIClientConfiguration(credentials, subscription_id, base_url) + super(AzureStackHCIClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.galleryimages = GalleryimagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.networkinterfaces = NetworkinterfacesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.virtualharddisks = VirtualharddisksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtualmachines = VirtualmachinesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtualnetworks = VirtualnetworksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storagecontainers = StoragecontainersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.clusters = ClustersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.arcvmextensions = ArcVmExtensionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py new file mode 100644 index 00000000000..7808947548b --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class AzureStackHCIClientConfiguration(AzureConfiguration): + """Configuration for AzureStackHCIClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AzureStackHCIClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-azurestackhci/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py similarity index 52% rename from src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py rename to src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py index 5a9d61963d6..90b0258800b 100644 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/__init__.py +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py @@ -1,11 +1,10 @@ -# -------------------------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * +from ._azure_stack_hci import AzureStackHCI +__all__ = ['AzureStackHCI'] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py new file mode 100644 index 00000000000..17453629a04 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureStackHCIConfiguration +from .operations import GalleryimagesOperations +from .operations import NetworkinterfacesOperations +from .operations import Operations +from .operations import VirtualharddisksOperations +from .operations import VirtualmachinesOperations +from .operations import VirtualnetworksOperations +from .operations import StoragecontainersOperations +from .operations import ClustersOperations +from .operations import ArcVmExtensionsOperations +from .. import models + + +class AzureStackHCI(object): + """The Microsoft.AzureStackHCI Rest API spec. + + :ivar galleryimages: GalleryimagesOperations operations + :vartype galleryimages: azure_stack_hci.aio.operations.GalleryimagesOperations + :ivar networkinterfaces: NetworkinterfacesOperations operations + :vartype networkinterfaces: azure_stack_hci.aio.operations.NetworkinterfacesOperations + :ivar operations: Operations operations + :vartype operations: azure_stack_hci.aio.operations.Operations + :ivar virtualharddisks: VirtualharddisksOperations operations + :vartype virtualharddisks: azure_stack_hci.aio.operations.VirtualharddisksOperations + :ivar virtualmachines: VirtualmachinesOperations operations + :vartype virtualmachines: azure_stack_hci.aio.operations.VirtualmachinesOperations + :ivar virtualnetworks: VirtualnetworksOperations operations + :vartype virtualnetworks: azure_stack_hci.aio.operations.VirtualnetworksOperations + :ivar storagecontainers: StoragecontainersOperations operations + :vartype storagecontainers: azure_stack_hci.aio.operations.StoragecontainersOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure_stack_hci.aio.operations.ClustersOperations + :ivar arcvmextensions: ArcVmExtensionsOperations operations + :vartype arcvmextensions: azure_stack_hci.aio.operations.ArcVmExtensionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureStackHCIConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.galleryimages = GalleryimagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.networkinterfaces = NetworkinterfacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.virtualharddisks = VirtualharddisksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtualmachines = VirtualmachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtualnetworks = VirtualnetworksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storagecontainers = StoragecontainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.clusters = ClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.arcvmextensions = ArcVmExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureStackHCI": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py new file mode 100644 index 00000000000..f6e7a40d157 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class AzureStackHCIConfiguration(Configuration): + """Configuration for AzureStackHCI. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureStackHCIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'azurestackhci/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py new file mode 100644 index 00000000000..c3d1854e783 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._galleryimages_operations import GalleryimagesOperations +from ._networkinterfaces_operations import NetworkinterfacesOperations +from ._operations import Operations +from ._virtualharddisks_operations import VirtualharddisksOperations +from ._virtualmachines_operations import VirtualmachinesOperations +from ._virtualnetworks_operations import VirtualnetworksOperations +from ._storagecontainers_operations import StoragecontainersOperations +from ._clusters_operations import ClustersOperations +from ._arc_vmextensions_operations import ArcVmExtensionsOperations + +__all__ = [ + 'GalleryimagesOperations', + 'NetworkinterfacesOperations', + 'Operations', + 'VirtualharddisksOperations', + 'VirtualmachinesOperations', + 'VirtualnetworksOperations', + 'StoragecontainersOperations', + 'ClustersOperations', + 'ArcVmExtensionsOperations', +] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py new file mode 100644 index 00000000000..92076fb887c --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py @@ -0,0 +1,537 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ArcVmExtensionsOperations: + """ArcVmExtensionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.hybridcompute.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: models.ArcVmExtensions, **kwargs) -> "models.ArcVmExtensions": + cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map',{})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str'), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_parameters, 'ArcVmExtensionsUpdate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + async def create( + self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: "models.ArcVmExtensionsUpdate", **kwargs) -> AsyncLROPoller["models.ArcVmExtensions"]: + """create. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :param extension_parameters: Parameters supplied to the Create ArcVmExtension operation. + :type extension_parameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ArcVmExtensions or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.ArcVmExtensions] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] + lro_delay = kwargs.pop('polling_interval', self._config.polling_interval) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name, + extension_parameters=extension_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + async def _update_initial( + self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: "models.ArcVmExtensionsUpdate", **kwargs) -> Optional["models.ArcVmExtensions"]: + cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map',{})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str'), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_parameters, 'ArcVmExtensions') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client.pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + async def update( + self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: "models.ArcVmExtensionsUpdate", **kwargs) -> AsyncLROPoller["models.ArcVmExtensions"]: + """The operation to update the vm extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :type extension_parameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ArcVmExtensions or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.ArcVmExtensions] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name, + extension_parameters=extension_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + async def get( + self, resource_group_name: str, virtualmachine_name: str, name: str, **kwargs) -> "models.ArcVmExtensions": + """The operation to get the vm extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArcVmExtensions, or the result of cls(response) + :rtype: ~azure_stack_hci.models.ArcVmExtensions + :raises: ~azure.core.exceptions.HttpResponseError + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArcVmExtensions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + async def delete( + self, resource_group_name: str, virtualmachine_name: str, name: str, **kwargs) -> None: + """delete + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine where the extension should be deleted. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + def list_by_virtualmachine_name( + self, resource_group_name: str, virtualmachine_name: str, **kwargs) -> AsyncIterable["models.ArcVmExtensionListResult"]: + """list_by_machine_name + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArcVmExtensionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.ArcVmExtensionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_virtualmachine_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ArcVmExtensionsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_virtualmachine_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions'} + + def _checkIfProvisionVmAgentEnabled( + self, resource_group_name, virtualmachine_name): + vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) + if vmObject.properties.os_profile.windows_configuration and vmObject.properties.os_profile.windows_configuration.provision_vm_agent == True: + return + else: + if vmObject.properties.os_profile.linux_configuration and vmObject.properties.os_profile.linux_configuration.provision_vm_agent == True: + return + raise Exception("Guest Management is not enabled for this virtual machine.") + + def _checkIfGuestVmAgentConnected( + self, resource_group_name, virtualmachine_name): + vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) + if vmObject.properties.guest_agent_profile: + if vmObject.properties.guest_agent_profile.status == models.Status.connected: + return + elif vmObject.properties.guest_agent_profile.status == models.Status.disconnected: + raise Exception("Guest Agent is currently disconnected.") + else: + error_detail = vmObject.properties.guest_agent_profile.error_details[-1] + error_code_and_message = error_detail.code + error_detail.message + raise Exception(error_code_and_message) + else: + raise Exception("Guest Agent is currently disconnected.") \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py new file mode 100644 index 00000000000..85f3621ae40 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py @@ -0,0 +1,429 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ClustersOperations: + """ClustersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.ClusterList"]: + """List all HCI clusters in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.ClusterList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.ClusterList"]: + """List all HCI clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.ClusterList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters'} # type: ignore + + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.Cluster": + """Get HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: "models.Cluster", + **kwargs + ) -> "models.Cluster": + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param cluster: Details of the HCI cluster. + :type cluster: ~azure_stack_hci.models.Cluster + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cluster, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: "models.ClusterUpdate", + **kwargs + ) -> "models.Cluster": + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param cluster: Details of the HCI cluster. + :type cluster: ~azure_stack_hci.models.ClusterUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cluster, 'ClusterUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + """Delete an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py new file mode 100644 index 00000000000..ae9f8cef6b8 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py @@ -0,0 +1,497 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GalleryimagesOperations: + """GalleryimagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def retrieve( + self, + resource_group_name: str, + galleryimages_name: str, + **kwargs + ) -> "models.Galleryimages": + """retrieve. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Galleryimages, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Galleryimages + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.retrieve.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Galleryimages', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + galleryimages_name: str, + galleryimages: "models.Galleryimages", + **kwargs + ) -> "models.Galleryimages": + cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(galleryimages, 'Galleryimages') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Galleryimages', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Galleryimages', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + galleryimages_name: str, + galleryimages: "models.Galleryimages", + **kwargs + ) -> AsyncLROPoller["models.Galleryimages"]: + """create_or_update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :param galleryimages: + :type galleryimages: ~azure_stack_hci.models.Galleryimages + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Galleryimages or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Galleryimages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + galleryimages_name=galleryimages_name, + galleryimages=galleryimages, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Galleryimages', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + galleryimages_name: str, + **kwargs + ) -> None: + """delete. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + galleryimages_name: str, + galleryimages: "models.GalleryimagesPatch", + **kwargs + ) -> "models.Galleryimages": + """update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :param galleryimages: + :type galleryimages: ~azure_stack_hci.models.GalleryimagesPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Galleryimages, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Galleryimages + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(galleryimages, 'GalleryimagesPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Galleryimages', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Galleryimages', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.GalleryimagesListResult"]: + """list_by_resource_group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryimagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.GalleryimagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryimagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GalleryimagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.GalleryimagesListResult"]: + """list_by_subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryimagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.GalleryimagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryimagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GalleryimagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryimages'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py new file mode 100644 index 00000000000..417791458cc --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py @@ -0,0 +1,497 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkinterfacesOperations: + """NetworkinterfacesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def retrieve( + self, + resource_group_name: str, + networkinterfaces_name: str, + **kwargs + ) -> "models.Networkinterfaces": + """retrieve. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Networkinterfaces, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Networkinterfaces + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.retrieve.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Networkinterfaces', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + networkinterfaces_name: str, + networkinterfaces: "models.Networkinterfaces", + **kwargs + ) -> "models.Networkinterfaces": + cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(networkinterfaces, 'Networkinterfaces') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Networkinterfaces', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Networkinterfaces', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + networkinterfaces_name: str, + networkinterfaces: "models.Networkinterfaces", + **kwargs + ) -> AsyncLROPoller["models.Networkinterfaces"]: + """create_or_update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :param networkinterfaces: + :type networkinterfaces: ~azure_stack_hci.models.Networkinterfaces + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Networkinterfaces or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Networkinterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + networkinterfaces_name=networkinterfaces_name, + networkinterfaces=networkinterfaces, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Networkinterfaces', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + networkinterfaces_name: str, + **kwargs + ) -> None: + """delete. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + networkinterfaces_name: str, + networkinterfaces: "models.NetworkinterfacesPatch", + **kwargs + ) -> "models.Networkinterfaces": + """update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :param networkinterfaces: + :type networkinterfaces: ~azure_stack_hci.models.NetworkinterfacesPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Networkinterfaces, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Networkinterfaces + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(networkinterfaces, 'NetworkinterfacesPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Networkinterfaces', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Networkinterfaces', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.NetworkinterfacesListResult"]: + """list_by_resource_group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkinterfacesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.NetworkinterfacesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkinterfacesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkinterfacesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.NetworkinterfacesListResult"]: + """list_by_subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkinterfacesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.NetworkinterfacesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkinterfacesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkinterfacesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkinterfaces'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py new file mode 100644 index 00000000000..dc4ff259aae --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + **kwargs + ) -> "models.AvailableOperations": + """List all available Microsoft.AzureStackHCI provider operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailableOperations, or the result of cls(response) + :rtype: ~azure_stack_hci.models.AvailableOperations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableOperations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailableOperations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AzureStackHCI/operations'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py new file mode 100644 index 00000000000..79b957255e7 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py @@ -0,0 +1,497 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StoragecontainersOperations: + """StoragecontainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def retrieve( + self, + resource_group_name: str, + storagecontainers_name: str, + **kwargs + ) -> "models.Storagecontainers": + """retrieve. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Storagecontainers, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Storagecontainers + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.retrieve.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Storagecontainers', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + storagecontainers_name: str, + storagecontainers: "models.Storagecontainers", + **kwargs + ) -> "models.Storagecontainers": + cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storagecontainers, 'Storagecontainers') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Storagecontainers', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Storagecontainers', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + storagecontainers_name: str, + storagecontainers: "models.Storagecontainers", + **kwargs + ) -> AsyncLROPoller["models.Storagecontainers"]: + """create_or_update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :param storagecontainers: + :type storagecontainers: ~azure_stack_hci.models.Storagecontainers + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Storagecontainers or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Storagecontainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + storagecontainers_name=storagecontainers_name, + storagecontainers=storagecontainers, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Storagecontainers', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + storagecontainers_name: str, + **kwargs + ) -> None: + """delete. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + storagecontainers_name: str, + storagecontainers: "models.StoragecontainersPatch", + **kwargs + ) -> "models.Storagecontainers": + """update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :param storagecontainers: + :type storagecontainers: ~azure_stack_hci.models.StoragecontainersPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Storagecontainers, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Storagecontainers + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storagecontainers, 'StoragecontainersPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Storagecontainers', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Storagecontainers', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.StoragecontainersListResult"]: + """list_by_resource_group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StoragecontainersListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.StoragecontainersListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StoragecontainersListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StoragecontainersListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.StoragecontainersListResult"]: + """list_by_subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StoragecontainersListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.StoragecontainersListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StoragecontainersListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StoragecontainersListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storagecontainers'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py new file mode 100644 index 00000000000..0d2b24992e7 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py @@ -0,0 +1,497 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualharddisksOperations: + """VirtualharddisksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def retrieve( + self, + resource_group_name: str, + virtualharddisks_name: str, + **kwargs + ) -> "models.Virtualharddisks": + """retrieve. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Virtualharddisks, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Virtualharddisks + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.retrieve.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Virtualharddisks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtualharddisks_name: str, + virtualharddisks: "models.Virtualharddisks", + **kwargs + ) -> "models.Virtualharddisks": + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtualharddisks, 'Virtualharddisks') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Virtualharddisks', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Virtualharddisks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtualharddisks_name: str, + virtualharddisks: "models.Virtualharddisks", + **kwargs + ) -> AsyncLROPoller["models.Virtualharddisks"]: + """create_or_update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :param virtualharddisks: + :type virtualharddisks: ~azure_stack_hci.models.Virtualharddisks + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Virtualharddisks or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Virtualharddisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtualharddisks_name=virtualharddisks_name, + virtualharddisks=virtualharddisks, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Virtualharddisks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + virtualharddisks_name: str, + **kwargs + ) -> None: + """delete. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + virtualharddisks_name: str, + virtualharddisks: "models.VirtualharddisksPatch", + **kwargs + ) -> "models.Virtualharddisks": + """update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :param virtualharddisks: + :type virtualharddisks: ~azure_stack_hci.models.VirtualharddisksPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Virtualharddisks, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Virtualharddisks + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtualharddisks, 'VirtualharddisksPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Virtualharddisks', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Virtualharddisks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualharddisksListResult"]: + """list_by_resource_group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualharddisksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualharddisksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualharddisksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualharddisksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.VirtualharddisksListResult"]: + """list_by_subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualharddisksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualharddisksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualharddisksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualharddisksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualharddisks'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py new file mode 100644 index 00000000000..df9cac66094 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py @@ -0,0 +1,609 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualmachinesOperations: + """VirtualmachinesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def retrieve( + self, + resource_group_name: str, + virtualmachines_name: str, + **kwargs + ) -> "models.Virtualmachines": + """retrieve. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Virtualmachines, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Virtualmachines + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.retrieve.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Virtualmachines', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtualmachines_name: str, + virtualmachines: "models.Virtualmachines", + **kwargs + ) -> "models.Virtualmachines": + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtualmachines, 'Virtualmachines') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Virtualmachines', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Virtualmachines', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtualmachines_name: str, + virtualmachines: "models.Virtualmachines", + **kwargs + ) -> AsyncLROPoller["models.Virtualmachines"]: + """create_or_update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param virtualmachines: + :type virtualmachines: ~azure_stack_hci.models.Virtualmachines + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Virtualmachines or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Virtualmachines] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtualmachines_name=virtualmachines_name, + virtualmachines=virtualmachines, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Virtualmachines', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + virtualmachines_name: str, + **kwargs + ) -> None: + """delete. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + virtualmachines_name: str, + virtualmachines: "models.VirtualmachinesPatch", + **kwargs + ) -> "models.Virtualmachines": + """update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param virtualmachines: + :type virtualmachines: ~azure_stack_hci.models.VirtualmachinesPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Virtualmachines, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Virtualmachines + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtualmachines, 'VirtualmachinesPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Virtualmachines', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Virtualmachines', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore + + async def start( + self, + resource_group_name: str, + virtualmachines_name: str, + **kwargs + ) -> None: + """start. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/start'} # type: ignore + + async def stop( + self, + resource_group_name: str, + virtualmachines_name: str, + **kwargs + ) -> None: + """stop. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/stop'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualmachinesListResult"]: + """list_by_resource_group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualmachinesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualmachinesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualmachinesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualmachinesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.VirtualmachinesListResult"]: + """list_by_subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualmachinesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualmachinesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualmachinesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualmachinesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualmachines'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py new file mode 100644 index 00000000000..ceb55b4a00d --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py @@ -0,0 +1,497 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualnetworksOperations: + """VirtualnetworksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def retrieve( + self, + resource_group_name: str, + virtualnetworks_name: str, + **kwargs + ) -> "models.Virtualnetworks": + """retrieve. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Virtualnetworks, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Virtualnetworks + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.retrieve.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Virtualnetworks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtualnetworks_name: str, + virtualnetworks: "models.Virtualnetworks", + **kwargs + ) -> "models.Virtualnetworks": + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtualnetworks, 'Virtualnetworks') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Virtualnetworks', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Virtualnetworks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtualnetworks_name: str, + virtualnetworks: "models.Virtualnetworks", + **kwargs + ) -> AsyncLROPoller["models.Virtualnetworks"]: + """create_or_update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :param virtualnetworks: + :type virtualnetworks: ~azure_stack_hci.models.Virtualnetworks + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Virtualnetworks or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Virtualnetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtualnetworks_name=virtualnetworks_name, + virtualnetworks=virtualnetworks, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Virtualnetworks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + virtualnetworks_name: str, + **kwargs + ) -> None: + """delete. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + virtualnetworks_name: str, + virtualnetworks: "models.VirtualnetworksPatch", + **kwargs + ) -> "models.Virtualnetworks": + """update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :param virtualnetworks: + :type virtualnetworks: ~azure_stack_hci.models.VirtualnetworksPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Virtualnetworks, or the result of cls(response) + :rtype: ~azure_stack_hci.models.Virtualnetworks + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtualnetworks, 'VirtualnetworksPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Virtualnetworks', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Virtualnetworks', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.VirtualnetworksListResult"]: + """list_by_resource_group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualnetworksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualnetworksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualnetworksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualnetworksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.VirtualnetworksListResult"]: + """list_by_subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualnetworksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualnetworksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualnetworksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualnetworksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualnetworks'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py new file mode 100644 index 00000000000..d9c7402cab5 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py @@ -0,0 +1,307 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AvailableOperations + from ._models_py3 import AzureEntityResource + from ._models_py3 import Cluster + from ._models_py3 import ClusterNode + from ._models_py3 import ClusterReportedProperties + from ._models_py3 import ClusterUpdate + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import Galleryimages + from ._models_py3 import GalleryimagesExtendedLocation + from ._models_py3 import GalleryimagesPatch + from ._models_py3 import GalleryimagesProperties + from ._models_py3 import GalleryimagesPropertiesIdentifier + from ._models_py3 import GalleryimagesPropertiesVersion + from ._models_py3 import HardwareProfileUpdate + from ._models_py3 import Networkinterfaces + from ._models_py3 import NetworkinterfacesExtendedLocation + from ._models_py3 import NetworkinterfacesPatch + from ._models_py3 import NetworkinterfacesProperties + from ._models_py3 import NetworkinterfacesPropertiesInterfaceDNSSettings + from ._models_py3 import NetworkinterfacesPropertiesIpConfigurationsItem + from ._models_py3 import NetworkinterfacesPropertiesIpConfigurationsItemProperties + from ._models_py3 import NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet + from ._models_py3 import NetworkProfileUpdate + from ._models_py3 import NetworkProfileUpdateNetworkInterfacesItem + from ._models_py3 import OperationDetail + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Storagecontainers + from ._models_py3 import StoragecontainersExtendedLocation + from ._models_py3 import StoragecontainersPatch + from ._models_py3 import StoragecontainersProperties + from ._models_py3 import StorageProfileUpdate + from ._models_py3 import StorageProfileUpdateDataDisksItem + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource + from ._models_py3 import Virtualharddisks + from ._models_py3 import VirtualharddisksExtendedLocation + from ._models_py3 import VirtualharddisksPatch + from ._models_py3 import VirtualharddisksProperties + from ._models_py3 import Virtualmachines + from ._models_py3 import VirtualmachinesExtendedLocation + from ._models_py3 import VirtualmachinesPatch + from ._models_py3 import VirtualmachinesProperties + from ._models_py3 import VirtualmachinesPropertiesHardwareProfile + from ._models_py3 import VirtualmachinesPropertiesNetworkProfile + from ._models_py3 import VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem + from ._models_py3 import VirtualmachinesPropertiesOsProfile + from ._models_py3 import VirtualmachinesPropertiesOsProfileLinuxConfiguration + from ._models_py3 import VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh + from ._models_py3 import VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem + from ._models_py3 import VirtualmachinesPropertiesOsProfileWindowsConfiguration + from ._models_py3 import VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh + from ._models_py3 import VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem + from ._models_py3 import VirtualmachinesPropertiesSecurityProfile + from ._models_py3 import VirtualmachinesPropertiesSecurityProfileUefiSettings + from ._models_py3 import VirtualmachinesPropertiesStorageProfile + from ._models_py3 import VirtualmachinesPropertiesStorageProfileDataDisksItem + from ._models_py3 import VirtualmachinesPropertiesStorageProfileImageReference + from ._models_py3 import VirtualmachinesPropertiesStorageProfileOsDisk + from ._models_py3 import VirtualMachineUpdateProperties + from ._models_py3 import VirtualMachineGuestAgentProfile + from ._models_py3 import VirtualMachineGuestAgentProfileErrorDetail + from ._models_py3 import VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo + from ._models_py3 import Virtualnetworks + from ._models_py3 import VirtualnetworksExtendedLocation + from ._models_py3 import VirtualnetworksPatch + from ._models_py3 import VirtualnetworksProperties + from ._models_py3 import VirtualnetworksPropertiesDHCPOptions + from ._models_py3 import VirtualnetworksPropertiesSubnetsItem + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemProperties + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesIPPool + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem + from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties + from ._models_py3 import VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig + from ._models_py3 import VirtualmachinesIdentity + from ._models_py3 import ArcVmExtensions + from ._models_py3 import ArcVmExtensionsProperties + from ._models_py3 import ArcVmExtensionsInstanceView + from ._models_py3 import ArcVmExtensionsInstanceViewStatus + from ._models_py3 import ArcVmExtensionsPatch + from ._models_py3 import ResourceUpdate + from ._models_py3 import ArcVmExtensionsUpdate + from ._models_py3 import ArcVmExtensionsProperties + from ._models_py3 import ArcVmExtensionsListResult +except (SyntaxError, ImportError): + from ._models import AvailableOperations + from ._models import AzureEntityResource + from ._models import Cluster + from ._models import ClusterNode + from ._models import ClusterReportedProperties + from ._models import ClusterUpdate + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException + from ._models import Galleryimages + from ._models import GalleryimagesExtendedLocation + from ._models import GalleryimagesPatch + from ._models import GalleryimagesProperties + from ._models import GalleryimagesPropertiesIdentifier + from ._models import GalleryimagesPropertiesVersion + from ._models import HardwareProfileUpdate + from ._models import Networkinterfaces + from ._models import NetworkinterfacesExtendedLocation + from ._models import NetworkinterfacesPatch + from ._models import NetworkinterfacesProperties + from ._models import NetworkinterfacesPropertiesInterfaceDNSSettings + from ._models import NetworkinterfacesPropertiesIpConfigurationsItem + from ._models import NetworkinterfacesPropertiesIpConfigurationsItemProperties + from ._models import NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet + from ._models import NetworkProfileUpdate + from ._models import NetworkProfileUpdateNetworkInterfacesItem + from ._models import OperationDetail + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Storagecontainers + from ._models import StoragecontainersExtendedLocation + from ._models import StoragecontainersPatch + from ._models import StoragecontainersProperties + from ._models import StorageProfileUpdate + from ._models import StorageProfileUpdateDataDisksItem + from ._models import SystemData + from ._models import TrackedResource + from ._models import Virtualharddisks + from ._models import VirtualharddisksExtendedLocation + from ._models import VirtualharddisksPatch + from ._models import VirtualharddisksProperties + from ._models import Virtualmachines + from ._models import VirtualmachinesExtendedLocation + from ._models import VirtualmachinesPatch + from ._models import VirtualmachinesProperties + from ._models import VirtualmachinesPropertiesHardwareProfile + from ._models import VirtualmachinesPropertiesNetworkProfile + from ._models import VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem + from ._models import VirtualmachinesPropertiesOsProfile + from ._models import VirtualmachinesPropertiesOsProfileLinuxConfiguration + from ._models import VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh + from ._models import VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem + from ._models import VirtualmachinesPropertiesOsProfileWindowsConfiguration + from ._models import VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh + from ._models import VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem + from ._models import VirtualmachinesPropertiesSecurityProfile + from ._models import VirtualmachinesPropertiesSecurityProfileUefiSettings + from ._models import VirtualmachinesPropertiesStorageProfile + from ._models import VirtualmachinesPropertiesStorageProfileDataDisksItem + from ._models import VirtualmachinesPropertiesStorageProfileImageReference + from ._models import VirtualmachinesPropertiesStorageProfileOsDisk + from ._models import VirtualMachineUpdateProperties + from ._models import VirtualMachineGuestAgentProfile + from ._models import VirtualMachineGuestAgentProfileErrorDetail + from ._models import VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo + from ._models import Virtualnetworks + from ._models import VirtualnetworksExtendedLocation + from ._models import VirtualnetworksPatch + from ._models import VirtualnetworksProperties + from ._models import VirtualnetworksPropertiesDHCPOptions + from ._models import VirtualnetworksPropertiesSubnetsItem + from ._models import VirtualnetworksPropertiesSubnetsItemProperties + from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem + from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesIPPool + from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable + from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties + from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem + from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties + from ._models import VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig + from ._models import VirtualmachinesIdentity + from ._models import ArcVmExtensions + from ._models import ArcVmExtensionsProperties + from ._models import ArcVmExtensionsInstanceView + from ._models import ArcVmExtensionsInstanceViewStatus + from ._models import ArcVmExtensionsPatch + from ._models import ResourceUpdate + from ._models import ArcVmExtensionsUpdate + from ._models import ArcVmExtensionsUpdateProperties + from ._models import ArcVmExtensionsListResult +from ._paged_models import ClusterPaged +from ._paged_models import GalleryimagesPaged +from ._paged_models import NetworkinterfacesPaged +from ._paged_models import StoragecontainersPaged +from ._paged_models import VirtualharddisksPaged +from ._paged_models import VirtualmachinesPaged +from ._paged_models import VirtualnetworksPaged +from ._paged_models import ArcVmExtensionsPaged +from ._azure_stack_hci_client_enums import ( + CreatedByType, + ProvisioningState, + Status, +) + +__all__ = [ + 'AvailableOperations', + 'AzureEntityResource', + 'Cluster', + 'ClusterNode', + 'ClusterReportedProperties', + 'ClusterUpdate', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', + 'Galleryimages', + 'GalleryimagesExtendedLocation', + 'GalleryimagesPatch', + 'GalleryimagesProperties', + 'GalleryimagesPropertiesIdentifier', + 'GalleryimagesPropertiesVersion', + 'HardwareProfileUpdate', + 'Networkinterfaces', + 'NetworkinterfacesExtendedLocation', + 'NetworkinterfacesPatch', + 'NetworkinterfacesProperties', + 'NetworkinterfacesPropertiesInterfaceDNSSettings', + 'NetworkinterfacesPropertiesIpConfigurationsItem', + 'NetworkinterfacesPropertiesIpConfigurationsItemProperties', + 'NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet', + 'NetworkProfileUpdate', + 'NetworkProfileUpdateNetworkInterfacesItem', + 'OperationDetail', + 'OperationDisplay', + 'ProxyResource', + 'Resource', + 'Storagecontainers', + 'StoragecontainersExtendedLocation', + 'StoragecontainersPatch', + 'StoragecontainersProperties', + 'StorageProfileUpdate', + 'StorageProfileUpdateDataDisksItem', + 'SystemData', + 'TrackedResource', + 'Virtualharddisks', + 'VirtualharddisksExtendedLocation', + 'VirtualharddisksPatch', + 'VirtualharddisksProperties', + 'Virtualmachines', + 'VirtualmachinesExtendedLocation', + 'VirtualmachinesPatch', + 'VirtualmachinesProperties', + 'VirtualmachinesPropertiesHardwareProfile', + 'VirtualmachinesPropertiesNetworkProfile', + 'VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem', + 'VirtualmachinesPropertiesOsProfile', + 'VirtualmachinesPropertiesOsProfileLinuxConfiguration', + 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh', + 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem', + 'VirtualmachinesPropertiesOsProfileWindowsConfiguration', + 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh', + 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem', + 'VirtualmachinesPropertiesSecurityProfile', + 'VirtualmachinesPropertiesStorageProfile', + 'VirtualmachinesPropertiesStorageProfileDataDisksItem', + 'VirtualmachinesPropertiesStorageProfileImageReference', + 'VirtualMachineUpdateProperties', + 'VirtualMachineGuestAgentProfile', + 'VirtualMachineGuestAgentProfileErrorDetail', + 'VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo', + 'Virtualnetworks', + 'VirtualnetworksExtendedLocation', + 'VirtualnetworksPatch', + 'VirtualnetworksProperties', + 'VirtualnetworksPropertiesDHCPOptions', + 'VirtualnetworksPropertiesSubnetsItem', + 'VirtualnetworksPropertiesSubnetsItemProperties', + 'VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem', + 'VirtualnetworksPropertiesSubnetsItemPropertiesIPPool', + 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable', + 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties', + 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem', + 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties', + 'GalleryimagesPaged', + 'NetworkinterfacesPaged', + 'VirtualharddisksPaged', + 'VirtualmachinesPaged', + 'VirtualnetworksPaged', + 'StoragecontainersPaged', + 'ClusterPaged', + 'CreatedByType', + 'ProvisioningState', + 'Status', + 'VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig', + 'VirtualmachinesIdentity', + 'ArcVmExtensions', + 'ArcVmExtensionsProperties', + 'ArcVmExtensionsInstanceView', + 'ArcVmExtensionsInstanceViewStatus', + 'ArcVmExtensionsPatch', + 'ResourceUpdate', + 'ArcVmExtensionsUpdate', + 'ArcVmExtensionsUpdateProperties', + 'ArcVmExtensionsListResult' +] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py new file mode 100644 index 00000000000..b094a0de43d --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + accepted = "Accepted" + provisioning = "Provisioning" + + +class Status(str, Enum): + + connected = "Connected" + disconnected = "Disconnected" + error = "Error" diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py new file mode 100644 index 00000000000..2ae785e6379 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + ACCEPTED = "Accepted" + PROVISIONING = "Provisioning" + +class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the cluster agent. + """ + + NOT_YET_REGISTERED = "NotYetRegistered" + CONNECTED_RECENTLY = "ConnectedRecently" + NOT_CONNECTED_RECENTLY = "NotConnectedRecently" + DISCONNECTED = "Disconnected" + ERROR = "Error" diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py new file mode 100644 index 00000000000..5466aea22b0 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py @@ -0,0 +1,2678 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ast import Mod +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AvailableOperations(Model): + """Available operations of the service. + + :param value: Collection of available operation details + :type value: list[~azure.mgmt.azurestackhci.models.OperationDetail] + :param next_link: URL client should use to fetch the next page (per server + side paging). + It's null for now, added for future use. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailableOperations, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Resource(Model): + """Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top + level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class Cluster(TrackedResource): + """Cluster details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar provisioning_state: Provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' + :vartype provisioning_state: str or + ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar status: Status of the cluster agent. Possible values include: + 'Connected', 'Disconnected', 'Error' + :vartype status: str or ~azure.mgmt.azurestackhci.models.Status + :ivar cloud_id: Unique, immutable resource id. + :vartype cloud_id: str + :param aad_client_id: Required. App id of cluster AAD identity. + :type aad_client_id: str + :param aad_tenant_id: Required. Tenant id of cluster AAD identity. + :type aad_tenant_id: str + :param reported_properties: Properties reported by cluster agent. + :type reported_properties: + ~azure.mgmt.azurestackhci.models.ClusterReportedProperties + :ivar trial_days_remaining: Number of days remaining in the trial period. + :vartype trial_days_remaining: float + :ivar billing_model: Type of billing applied to the resource. + :vartype billing_model: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'cloud_id': {'readonly': True}, + 'aad_client_id': {'required': True}, + 'aad_tenant_id': {'required': True}, + 'trial_days_remaining': {'readonly': True}, + 'billing_model': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'cloud_id': {'key': 'properties.cloudId', 'type': 'str'}, + 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, + 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, + 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, + 'trial_days_remaining': {'key': 'properties.trialDaysRemaining', 'type': 'float'}, + 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Cluster, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.provisioning_state = None + self.status = None + self.cloud_id = None + self.aad_client_id = kwargs.get('aad_client_id', None) + self.aad_tenant_id = kwargs.get('aad_tenant_id', None) + self.reported_properties = kwargs.get('reported_properties', None) + self.trial_days_remaining = None + self.billing_model = None + + +class ClusterNode(Model): + """Cluster node details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the cluster node. + :vartype name: str + :ivar id: Id of the node in the cluster. + :vartype id: float + :ivar manufacturer: Manufacturer of the cluster node hardware. + :vartype manufacturer: str + :ivar model: Model name of the cluster node hardware. + :vartype model: str + :ivar os_name: Operating system running on the cluster node. + :vartype os_name: str + :ivar os_version: Version of the operating system running on the cluster + node. + :vartype os_version: str + :ivar serial_number: Immutable id of the cluster node. + :vartype serial_number: str + :ivar core_count: Number of physical cores on the cluster node. + :vartype core_count: float + :ivar memory_in_gi_b: Total available memory on the cluster node (in GiB). + :vartype memory_in_gi_b: float + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'manufacturer': {'readonly': True}, + 'model': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'core_count': {'readonly': True}, + 'memory_in_gi_b': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'float'}, + 'manufacturer': {'key': 'manufacturer', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'core_count': {'key': 'coreCount', 'type': 'float'}, + 'memory_in_gi_b': {'key': 'memoryInGiB', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ClusterNode, self).__init__(**kwargs) + self.name = None + self.id = None + self.manufacturer = None + self.model = None + self.os_name = None + self.os_version = None + self.serial_number = None + self.core_count = None + self.memory_in_gi_b = None + + +class ClusterReportedProperties(Model): + """Properties reported by cluster agent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar cluster_name: Name of the on-prem cluster connected to this + resource. + :vartype cluster_name: str + :ivar cluster_id: Unique id generated by the on-prem cluster. + :vartype cluster_id: str + :ivar cluster_version: Version of the cluster software. + :vartype cluster_version: str + :ivar nodes: List of nodes reported by the cluster. + :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] + :ivar last_updated: Last time the cluster reported the data. + :vartype last_updated: datetime + """ + + _validation = { + 'cluster_name': {'readonly': True}, + 'cluster_id': {'readonly': True}, + 'cluster_version': {'readonly': True}, + 'nodes': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'cluster_version': {'key': 'clusterVersion', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[ClusterNode]'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ClusterReportedProperties, self).__init__(**kwargs) + self.cluster_name = None + self.cluster_id = None + self.cluster_version = None + self.nodes = None + self.last_updated = None + + +class ClusterUpdate(Model): + """Cluster details to update. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ClusterUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.azurestackhci.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class Galleryimages(Model): + """The galleryimages resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: ~azure.mgmt.azurestackhci.models.GalleryimagesProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.GalleryimagesExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'GalleryimagesProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'GalleryimagesExtendedLocation'}, + } + + def __init__(self, **kwargs): + super(Galleryimages, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + self.extended_location = kwargs.get('extended_location', None) + + +class GalleryimagesExtendedLocation(Model): + """GalleryimagesExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryimagesExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class GalleryimagesPatch(Model): + """The galleryimages resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(GalleryimagesPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class GalleryimagesProperties(Model): + """GalleryimagesProperties. + + :param storagepath_id: Azure ID of the storagepath which is used to store the Gallery Images. + :type storagepath_id: str + :param image_path: location of the image the gallery image should be + created from + :type image_path: str + :param os_type: operating system type that the gallery image uses. + Expected to be linux or windows + :type os_type: str + :param provisioning_state: + :type provisioning_state: str + :param status: MOCGalleryImageStatus defines the observed state of + MOCGalleryImage + :type status: object + :param identifier: galleryImageIdentifier defines the identity of the gallery image + :type identifier: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesIdentifier + :param version: version of the gallery image. + :type version: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesVersion + """ + + _attribute_map = { + 'storagepath_id': {'key': 'containerName', 'type': 'str'}, + 'image_path': {'key': 'imagePath', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'identifier': {'key': 'identifier', 'type': 'GalleryimagesPropertiesIdentifier'}, + 'version': {'key': 'version', 'type': 'GalleryimagesPropertiesVersion'}, + } + + def __init__(self, **kwargs): + super(GalleryimagesProperties, self).__init__(**kwargs) + self.storagepath_id = kwargs.get('storagepath_id', None) + self.image_path = kwargs.get('image_path', None) + self.os_type = kwargs.get('os_type', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.status = kwargs.get('status', None) + self.identifier = kwargs.get('identifier', None) + self.version = kwargs.get('version', None) + +class GalleryimagesPropertiesIdentifier(Model): + """GalleryimagesPropertiesIdentifier. + + :param offer: The name of the gallery image definition offer + :type offer: str + :param pubilsher: The name of the gallery image definition publisher + :type publisher: str + :param sku: The name of the gallery image definition SKU + :type sku: str + """ + + _attribute_map = { + 'offer': {'key': 'offer', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryimagesPropertiesIdentifier, self).__init__(**kwargs) + self.offer = kwargs.get('offer', None) + self.publisher = kwargs.get('publisher', None) + self.sku = kwargs.get('sku', None) + +class GalleryimagesPropertiesVersion(Model): + """GalleryimagesPropertiesIdentifier. + + :param name: The name of the gallery image version + :type name: str + + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryimagesPropertiesVersion, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + + +class HardwareProfileUpdate(Model): + """HardwareProfile - Specifies the hardware settings for the virtual machine. + + :param vm_size: + :type vm_size: str + :param processors: number of processors for the virtual machine + :type processors: int + :param memory_mb: RAM in mb for the virtual machine + :type memory_mb: int + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'processors': {'key': 'processors', 'type': 'int'}, + 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(HardwareProfileUpdate, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.processors = kwargs.get('processors', None) + self.memory_mb = kwargs.get('memory_mb', None) + + +class Networkinterfaces(Model): + """The networkinterfaces resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'NetworkinterfacesProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'NetworkinterfacesExtendedLocation'}, + } + + def __init__(self, **kwargs): + super(Networkinterfaces, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + self.extended_location = kwargs.get('extended_location', None) + + +class NetworkinterfacesExtendedLocation(Model): + """NetworkinterfacesExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class NetworkinterfacesPatch(Model): + """The networkinterfaces resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class NetworkinterfacesProperties(Model): + """MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface. + + :param ip_configurations: IPConfigurations - A list of IPConfigurations of + the network interface. + :type ip_configurations: + list[~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItem] + :param mac_address: MacAddress - The MAC address of the network interface. + :type mac_address: str + :param dns_settings: DNS Settings for the interface + :type dns_settings: ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesInterfaceDNSSettings + :param provisioning_state: + :type provisioning_state: str + :param status: MOCNetworkInterfaceStatus defines the observed state of + MOCNetworkInterface + :type status: object + :param resource_name: name of the object to be used in moc + :type resource_name: str + """ + + _attribute_map = { + 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NetworkinterfacesPropertiesIpConfigurationsItem]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'dns_settings': {'key': 'dnsSettings', 'type': 'NetworkinterfacesPropertiesInterfaceDNSSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'resource_name' : {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesProperties, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.mac_address = kwargs.get('mac_address', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.status = kwargs.get('status', None) + self.resource_name = kwargs.get('resource_name', None) + + +class NetworkinterfacesPropertiesIpConfigurationsItem(Model): + """InterfaceIPConfiguration iPConfiguration in a network interface. + + :param name: Name - The name of the resource that is unique within a + resource group. This name can be used to access the resource. + :type name: str + :param properties: InterfaceIPConfigurationPropertiesFormat properties of + IP configuration. + :type properties: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemProperties'}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesPropertiesIpConfigurationsItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + + +class NetworkinterfacesPropertiesIpConfigurationsItemProperties(Model): + """InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + + :param gateway: Gateway for network interface + :type gateway: str + :param prefix_length: prefixLength for network interface + :type prefix_length: str + :param private_ip_address: PrivateIPAddress - Private IP address of the IP + configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIPAllocationMethod - The + private IP address allocation method. Possible values include: 'Static', + 'Dynamic' + :type private_ip_allocation_method: str + :param subnet: Subnet - Name of Subnet bound to the IP configuration. + :type subnet: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet + """ + + _attribute_map = { + 'gateway': {'key': 'gateway', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet'}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesPropertiesIpConfigurationsItemProperties, self).__init__(**kwargs) + self.gateway = kwargs.get('gateway', None) + self.prefix_length = kwargs.get('prefix_length', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + + +class NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet(Model): + """Subnet - Name of Subnet bound to the IP configuration. + + :param id: ID - The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class NetworkinterfacesPropertiesInterfaceDNSSettings(Model): + """NetworkinterfacesPropertiesInterfaceDNSSettings. + + :param dns_servers: List of DNS server IP Addresses for the interface. + :type dns_servers: list[str] + """ + + _attribute_map = { + "dns_servers": {"key": "dnsServers", "type": "[str]"}, + } + + def __init__(self, **kwargs): + super(NetworkinterfacesPropertiesInterfaceDNSSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + + +class NetworkProfileUpdate(Model): + """NetworkProfile - describes the network update configuration the virtual + machine. + + :param network_interfaces: NetworkInterfaces - list of network interfaces + to be attached to the virtual machine + :type network_interfaces: + list[~azure.mgmt.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkProfileUpdateNetworkInterfacesItem]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileUpdate, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + + +class NetworkProfileUpdateNetworkInterfacesItem(Model): + """NetworkProfileUpdateNetworkInterfacesItem. + + :param id: ID - Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileUpdateNetworkInterfacesItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class OperationDetail(Model): + """Operation detail payload. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: ~azure.mgmt.azurestackhci.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationDetail, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class OperationDisplay(Model): + """Operation display payload. + + :param provider: Resource provider of the operation + :type provider: str + :param resource: Resource of the operation + :type resource: str + :param operation: Localized friendly name for the operation + :type operation: str + :param description: Localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. + It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class Storagecontainers(Model): + """The storagecontainers resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.StoragecontainersProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.StoragecontainersExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'StoragecontainersProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'StoragecontainersExtendedLocation'}, + } + + def __init__(self, **kwargs): + super(Storagecontainers, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + self.extended_location = kwargs.get('extended_location', None) + + +class StoragecontainersExtendedLocation(Model): + """StoragecontainersExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StoragecontainersExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class StoragecontainersPatch(Model): + """The storagecontainers resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(StoragecontainersPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class StoragecontainersProperties(Model): + """StoragecontainersProperties. + + :param path: location of the image the gallery image should be created + from + :type path: str + :param provisioning_state: + :type provisioning_state: str + :param status: MOCStorageContainerStatus defines the observed state of + MOCStorageContainer + :type status: object + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(StoragecontainersProperties, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.status = kwargs.get('status', None) + + +class StorageProfileUpdate(Model): + """StorageProfileUpdate. + + :param data_disks: adds data disks to the virtual machine for the update + call + :type data_disks: + list[~azure.mgmt.azurestackhci.models.StorageProfileUpdateDataDisksItem] + """ + + _attribute_map = { + 'data_disks': {'key': 'dataDisks', 'type': '[StorageProfileUpdateDataDisksItem]'}, + } + + def __init__(self, **kwargs): + super(StorageProfileUpdate, self).__init__(**kwargs) + self.data_disks = kwargs.get('data_disks', None) + + +class StorageProfileUpdateDataDisksItem(Model): + """StorageProfileUpdateDataDisksItem. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageProfileUpdateDataDisksItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.azurestackhci.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.azurestackhci.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class Virtualharddisks(Model): + """The virtualharddisks resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualharddisksProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.VirtualharddisksExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualharddisksProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualharddisksExtendedLocation'}, + } + + def __init__(self, **kwargs): + super(Virtualharddisks, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + self.extended_location = kwargs.get('extended_location', None) + + +class VirtualharddisksExtendedLocation(Model): + """VirtualharddisksExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualharddisksExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class VirtualharddisksPatch(Model): + """The virtualharddisks resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(VirtualharddisksPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class VirtualharddisksProperties(Model): + """MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk. + + :param block_size_bytes: + :type block_size_bytes: int + :param disk_size_gb: diskSizeGB - size of the disk in GB + :type disk_size_gb: long + :param dynamic: Boolean for enabling dynamic sizing on the virtual hard + disk + :type dynamic: bool + :param logical_sector_bytes: + :type logical_sector_bytes: int + :param physical_sector_bytes: + :type physical_sector_bytes: int + :param storagepath_id: + :type storagepath_id: str + :param provisioning_state: + :type provisioning_state: str + :param status: MOCVirtualHardDiskStatus defines the observed state of + MOCVirtualHardDisk + :type status: object + :param disk_file_format: file format of the hard disk. + Expected to be vhd or vhdx + :type disk_file_format: str + """ + + _attribute_map = { + 'block_size_bytes': {'key': 'blockSizeBytes', 'type': 'int'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'long'}, + 'dynamic': {'key': 'dynamic', 'type': 'bool'}, + 'logical_sector_bytes': {'key': 'logicalSectorBytes', 'type': 'int'}, + 'physical_sector_bytes': {'key': 'physicalSectorBytes', 'type': 'int'}, + 'storagepath_id': {'key': 'containerId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'disk_file_format': {'key': 'diskFileFormat', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualharddisksProperties, self).__init__(**kwargs) + self.block_size_bytes = kwargs.get('block_size_bytes', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.dynamic = kwargs.get('dynamic', None) + self.logical_sector_bytes = kwargs.get('logical_sector_bytes', None) + self.physical_sector_bytes = kwargs.get('physical_sector_bytes', None) + self.storagepath_id = kwargs.get('storagepath_id', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.status = kwargs.get('status', None) + self.disk_file_format = kwargs.get('disk_file_format', None) + + +class Virtualmachines(Model): + """The virtualmachines resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualmachinesProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.VirtualmachinesExtendedLocation + :param identity: + :type identity: + ~azure.mgmt.azurestackhci.models.VirtualmachinesIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualmachinesProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualmachinesExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'VirtualmachinesIdentity'}, + } + + def __init__(self, **kwargs): + super(Virtualmachines, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + self.extended_location = kwargs.get('extended_location', None) + self.identity = kwargs.get('identity', None) + + +class VirtualmachinesExtendedLocation(Model): + """VirtualmachinesExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class VirtualmachinesIdentity(Model): + """VirtualmachinesIdentity + + :param type: The identity type. + :type type: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class VirtualmachinesPatch(Model): + """The virtualmachines resource patch definition. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualMachineUpdateProperties + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualMachineUpdateProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPatch, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class VirtualmachinesProperties(Model): + """MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine. + + :param hardware_profile: HardwareProfile - Specifies the hardware settings + for the virtual machine. + :type hardware_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile + :param network_profile: NetworkProfile - describes the network + configuration the virtual machine + :type network_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile + :param os_profile: OsProfile - describes the configuration of the + operating system and sets login data + :type os_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfile + :param security_profile: SecurityProfile - Specifies the security settings + for the virtual machine. + :type security_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile + :param storage_profile: StorageProfile - contains information about the + disks and storage information for the virtual machine + :type storage_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfile + :param provisioning_state: + :type provisioning_state: str + :param status: MOCVirtualMachineStatus defines the observed state of + MOCVirtualMachine + :type status: object + :param guest_agent_profile: GuestAgentProfile - Contains information related + to guest agent. + :type guest_agent_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfile + """ + + _attribute_map = { + 'hardware_profile': {'key': 'hardwareProfile', 'type': 'VirtualmachinesPropertiesHardwareProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualmachinesPropertiesNetworkProfile'}, + 'os_profile': {'key': 'osProfile', 'type': 'VirtualmachinesPropertiesOsProfile'}, + 'security_profile': {'key': 'securityProfile', 'type': 'VirtualmachinesPropertiesSecurityProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualmachinesPropertiesStorageProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'guest_agent_profile': {'key': 'guestAgentProfile', 'type': 'VirtualMachineGuestAgentProfile'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesProperties, self).__init__(**kwargs) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.security_profile = kwargs.get('security_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.status = kwargs.get('status', None) + + +class VirtualmachinesPropertiesHardwareProfile(Model): + """HardwareProfile - Specifies the hardware settings for the virtual machine. + + :param vm_size: + :type vm_size: str + :param processors: number of processors for the virtual machine + :type processors: int + :param memory_mb: RAM in mb for the virtual machine. + :type memory_mb: int + :param dynamic_memory_config: + :type dynamic_memory_config: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'processors': {'key': 'processors', 'type': 'int'}, + 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, + 'dynamic_memory_config': {'key': 'dynamicMemoryConfig', 'type': 'VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesHardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.processors = kwargs.get('processors', None) + self.memory_mb = kwargs.get('memory_mb', None) + self.dynamic_memory_config = kwargs.get('dynamic_memory_config', None) + +class VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig(Model): + """VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig. + + :param maximum_memory_mb: + :type maximum_memory_mb: long + :param minimum_memory_mb: + :type minimum_memory_mb: long + :param target_memory_buffer: + :type target_memory_buffer: int + """ + + _attribute_map = { + 'maximum_memory_mb': {'key': 'maximumMemoryMB', 'type': 'long'}, + 'minimum_memory_mb': {'key': 'minimumMemoryMB', 'type': 'long'}, + 'target_memory_buffer': {'key': 'targetMemoryBuffer', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig, self).__init__(**kwargs) + self.maximum_memory_mb = kwargs.get('maximum_memory_mb', None) + self.minimum_memory_mb = kwargs.get('minimum_memory_mb', None) + self.target_memory_buffer = kwargs.get('target_memory_buffer', None) + +class VirtualmachinesPropertiesNetworkProfile(Model): + """NetworkProfile - describes the network configuration the virtual machine. + + :param network_interfaces: NetworkInterfaces - list of network interfaces + to be attached to the virtual machine + :type network_interfaces: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem]'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesNetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + + +class VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem(Model): + """VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem. + + :param id: ID - Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class VirtualmachinesPropertiesOsProfile(Model): + """OsProfile - describes the configuration of the operating system and sets + login data. + + :param admin_password: AdminPassword - admin password + :type admin_password: str + :param admin_username: AdminUsername - admin username + :type admin_username: str + :param computer_name: ComputerName - name of the compute + :type computer_name: str + :param linux_configuration: LinuxConfiguration - linux specific + configuration values for the virtual machine + :type linux_configuration: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfiguration + :param os_type: OsType - string specifying whether the OS is Linux or + Windows + :type os_type: str + :param windows_configuration: Windows Configuration for the virtual + machine + :type windows_configuration: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfiguration + """ + + _attribute_map = { + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfiguration'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfiguration'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfile, self).__init__(**kwargs) + self.admin_password = kwargs.get('admin_password', None) + self.admin_username = kwargs.get('admin_username', None) + self.computer_name = kwargs.get('computer_name', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.os_type = kwargs.get('os_type', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + + +class VirtualmachinesPropertiesOsProfileLinuxConfiguration(Model): + """LinuxConfiguration - linux specific configuration values for the virtual + machine. + + :param disable_password_authentication: DisablePasswordAuthentication - + whether password authentication should be disabled + :type disable_password_authentication: bool + :param ssh: SSH - contains settings related to ssh configuration + :type ssh: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh + :param provision_vm_agent: Whether to provision guest management agent + :type provision_vm_agent: bool + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfileLinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + + +class VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh(Model): + """SSH - contains settings related to ssh configuration. + + :param public_keys: PublicKeys - The list of SSH public keys used to + authenticate with linux based VMs. + :type public_keys: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem]'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) + + +class VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem(Model): + """VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem. + + :param key_data: KeyData - SSH public key certificate used to authenticate + with the VM through ssh. The key needs to be at least 2048-bit and in + ssh-rsa format.

For creating ssh keys, see [Create SSH keys on + Linux and Mac for Li nux VMs in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + :param path: Path - Specifies the full path on the created VM where ssh + public key is stored. If the file already exists, the specified key is + appended to the file. Example: /home/user/.ssh/authorized_keys + :type path: str + """ + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem, self).__init__(**kwargs) + self.key_data = kwargs.get('key_data', None) + self.path = kwargs.get('path', None) + + +class VirtualmachinesPropertiesOsProfileWindowsConfiguration(Model): + """Windows Configuration for the virtual machine . + + :param enable_automatic_updates: Whether to EnableAutomaticUpdates on the + machine + :type enable_automatic_updates: bool + :param provision_vm_agent: Whether to provision guest management agent + :type provision_vm_agent: bool + :param ssh: AdditionalUnattendContent AdditionalUnattendContent + *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + SSH + :type ssh: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh + :param time_zone: TimeZone for the virtual machine + :type time_zone: str + """ + + _attribute_map = { + 'enable_automatic_updates': {'key': 'enableAutomaticUpdates', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfileWindowsConfiguration, self).__init__(**kwargs) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.ssh = kwargs.get('ssh', None) + self.time_zone = kwargs.get('time_zone', None) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + + +class VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh(Model): + """AdditionalUnattendContent AdditionalUnattendContent + *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + SSH. + + :param public_keys: PublicKeys - The list of SSH public keys used to + authenticate with linux based VMs. + :type public_keys: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem]'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) + + +class VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem(Model): + """VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem. + + :param key_data: KeyData - SSH public key certificate used to authenticate + with the VM through ssh. The key needs to be at least 2048-bit and in + ssh-rsa format.

For creating ssh keys, see [Create SSH keys on + Linux and Mac for Li nux VMs in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + :param path: Path - Specifies the full path on the created VM where ssh + public key is stored. If the file already exists, the specified key is + appended to the file. Example: /home/user/.ssh/authorized_keys + :type path: str + """ + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem, self).__init__(**kwargs) + self.key_data = kwargs.get('key_data', None) + self.path = kwargs.get('path', None) + + +class VirtualmachinesPropertiesSecurityProfile(Model): + """SecurityProfile - Specifies the security settings for the virtual machine. + + :param enable_tpm: + :type enable_tpm: bool + :param uefi_settings: + :type uefi_settings: ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfileUefiSettings + """ + + _attribute_map = { + 'enable_tpm': {'key': 'enableTPM', 'type': 'bool'}, + 'uefi_settings': {'key': 'uefiSettings', 'type': 'VirtualmachinesPropertiesSecurityProfileUefiSettings'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesSecurityProfile, self).__init__(**kwargs) + self.enable_tpm = kwargs.get('enable_tpm', None) + self.uefi_settings = kwargs.get('uefi_settings', None) + +class VirtualmachinesPropertiesSecurityProfileUefiSettings(Model): + """SecurityProfile - Specifies the security settings for the virtual machine. + + :param secure_boot_enabled: + :type secure_boot_enabled: bool + """ + + _attribute_map = { + 'secure_boot_enabled': {'key': 'secureBootEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesSecurityProfileUefiSettings, self).__init__(**kwargs) + self.secure_boot_enabled = kwargs.get('secure_boot_enabled', None) + +class VirtualmachinesPropertiesStorageProfile(Model): + """StorageProfile - contains information about the disks and storage + information for the virtual machine. + + :param data_disks: adds data disks to the virtual machine + :type data_disks: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileDataDisksItem] + :param image_reference: Which Image to use for the virtual machine + :type image_reference: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileImageReference + :param storagepath_id: Azure ID of the storagepath which is used to store Virtual Machine configuration file. + :type storagepath_id: str + """ + + _attribute_map = { + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualmachinesPropertiesStorageProfileDataDisksItem]'}, + 'image_reference': {'key': 'imageReference', 'type': 'VirtualmachinesPropertiesStorageProfileImageReference'}, + 'os_disk': {'key':'osDisk', 'type': 'VirtualmachinesPropertiesStorageProfileOsDisk'}, + 'storagepath_id': {'key': 'vmConfigStoragePathId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesStorageProfile, self).__init__(**kwargs) + self.data_disks = kwargs.get('data_disks', None) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.storagepath_id = kwargs.get('storagepath_id', None) + + +class VirtualmachinesPropertiesStorageProfileDataDisksItem(Model): + """VirtualmachinesPropertiesStorageProfileDataDisksItem. + + :param id: + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesStorageProfileDataDisksItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class VirtualmachinesPropertiesStorageProfileImageReference(Model): + """Which Image to use for the virtual machine. + + :param id: id - ID of the image + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesStorageProfileImageReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + +class VirtualmachinesPropertiesStorageProfileOsDisk(Model): + """Which Image to use for the virtual machine. + + :param id: Id - Id of the os disk + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesStorageProfileOsDisk, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class VirtualMachineUpdateProperties(Model): + """Defines the resource properties for the update. + + :param hardware_profile: + :type hardware_profile: + ~azure.mgmt.azurestackhci.models.HardwareProfileUpdate + :param storage_profile: + :type storage_profile: + ~azure.mgmt.azurestackhci.models.StorageProfileUpdate + :param network_profile: + :type network_profile: + ~azure.mgmt.azurestackhci.models.NetworkProfileUpdate + """ + + _attribute_map = { + 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfileUpdate'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfileUpdate'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfileUpdate'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineUpdateProperties, self).__init__(**kwargs) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + +class VirtualMachineGuestAgentProfile(Model): + """VirtualMachineGuestAgentProfile - Contains information related + to guest agent. + + :param status: + :type status: str + :param vmuuid: + :type vmuuid: str + :param agent_version: + :type agent_version: str + :type last_status_change: + :type last_status_change: ~datetime.datetime + :param error_details: + :type error_details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'vmuuid': {'key': 'vmUuid', 'type': 'str'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineGuestAgentProfile, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.vmuuid = kwargs.get('vmuuid', None) + self.agent_version = kwargs.get('agent_version', None) + self.last_status_change = kwargs.get('last_status_change', None) + self.error_details = kwargs.get('error_details', None) + +class VirtualMachineGuestAgentProfileErrorDetail(Model): + """The error detail. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] + :param additional_info: + :type additional_info: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, + 'additional_info': {'key': 'additional_info', 'type': '[VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineGuestAgentProfileErrorDetail, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.additional_info = kwargs.get('additional_info', None) + +class VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo(Model): + """Error additional info. + + :param type: + :type type: str + :param info: + :type info: object + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs): + super(VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.info = kwargs.get('info', None) + +class Virtualnetworks(Model): + """The virtualnetworks resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.VirtualnetworksExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualnetworksProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualnetworksExtendedLocation'}, + } + + def __init__(self, **kwargs): + super(Virtualnetworks, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + self.extended_location = kwargs.get('extended_location', None) + + +class VirtualnetworksExtendedLocation(Model): + """VirtualnetworksExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class VirtualnetworksPatch(Model): + """The virtualnetworks resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class VirtualnetworksProperties(Model): + """MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork. + + :param network_type: Type of the network + :type network_type: str + :param dhcp_options: DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network + :type dhcp_options: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesDHCPOptions + :param subnets: Subnet - list of subnets under the virtual network + :type subnets: + list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem] + :param provisioning_state: + :type provisioning_state: str + :param status: MOCVirtualNetworkStatus defines the observed state of + MOCVirtualNetwork + :type status: object + :param vm_switch_name: name of the network switch to be used for VMs + :type vm_switch_name: str + """ + + _attribute_map = { + 'network_type': {'key': 'networkType', 'type': 'str'}, + 'dhcp_options': {'key': 'dhcpOptions', 'type': 'VirtualnetworksPropertiesDHCPOptions'}, + 'subnets': {'key': 'subnets', 'type': '[VirtualnetworksPropertiesSubnetsItem]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'vm_switch_name': {'key': 'vmSwitchName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksProperties, self).__init__(**kwargs) + self.network_type = kwargs.get('network_type', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.status = kwargs.get('status', None) + self.vm_switch_name = kwargs.get('vm_switch_name', None) + +class VirtualnetworksPropertiesDHCPOptions(Model): + """ + :param dns_servers: The list of DNS servers IP addresses + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualnetworksPropertiesDHCPOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + +class VirtualnetworksPropertiesSubnetsItem(Model): + """Subnet subnet in a virtual network resource. + + :param name: Name - The name of the resource that is unique within a + resource group. This name can be used to access the resource. + :type name: str + :param properties: SubnetProperties - Properties of the subnet. + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemProperties'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + + +class VirtualnetworksPropertiesSubnetsItemProperties(Model): + """SubnetProperties - Properties of the subnet. + + :param address_prefix: Cidr for this subnet - IPv4, IPv6 + :type address_prefix: str + :param address_prefixes: AddressPrefixes - List of address prefixes for + the subnet. + :type address_prefixes: list[str] + :param ip_allocation_method: IPAllocationMethod - The IP address + allocation method. Possible values include: 'Static', 'Dynamic' + :type ip_allocation_method: str + :param ip_pools: List of IPs having start, end IP range along with their types + :type ip_pools: list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIPPool] + :param ip_configuration_references: IPConfigurationReferences - list of + IPConfigurationReferences + :type ip_configuration_references: + list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem] + :param route_table: RouteTable for the subnet + :type route_table: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable + :param vlan: Vlan to use for the subnet + :type vlan: int + """ + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'ip_allocation_method': {'key': 'ipAllocationMethod', 'type': 'str'}, + 'ip_pools' : {'key': 'ipPools', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIPPool]'}, + 'ip_configuration_references': {'key': 'ipConfigurationReferences', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem]'}, + 'route_table': {'key': 'routeTable', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable'}, + 'vlan': {'key': 'vlan', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemProperties, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.address_prefixes = kwargs.get('address_prefixes', None) + self.ip_allocation_method = kwargs.get('ip_allocation_method', None) + self.ip_pools = kwargs.get('ip_pools', None) + self.ip_configuration_references = kwargs.get('ip_configuration_references', None) + self.route_table = kwargs.get('route_table', None) + self.vlan = kwargs.get('vlan', None) + + +class VirtualnetworksPropertiesSubnetsItemPropertiesIPPool(Model): + """IPPool - Describe IPPool parameters + + :param ip_pool_type: IPPoolType + :type ip_pool_type: str + :param start: starting range of IP Address + :type start: str + :param end: ending range of IP Address + :type end: str + """ + _attribute_map = { + 'ip_pool_type': {'key': 'ipPoolType', 'type': 'str'}, + 'start': {'key': 'start', 'type': 'str'}, + 'end': {'key': 'end', 'type':'str'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemPropertiesIPPool, self).__init__(**kwargs) + self.ip_pool_type = kwargs.get('ip_pool_type', None) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) + + +class VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem(Model): + """IPConfigurationReference - Describes a IPConfiguration under the virtual + network. + + :param id: IPConfigurationID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'ID', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable(Model): + """RouteTable for the subnet. + + :param id: Etag - Gets a unique read-only string that changes whenever the + resource is updated. + :type id: str + :param name: Name - READ-ONLY; Resource name. + :type name: str + :param properties: RouteTablePropertiesFormat route Table resource. + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties + :param type: Type - READ-ONLY; Resource type. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.type = kwargs.get('type', None) + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties(Model): + """RouteTablePropertiesFormat route Table resource. + + :param routes: Routes - Collection of routes contained within a route + table. + :type routes: + list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem]'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem(Model): + """Route is associated with a subnet. + + :param name: Name - name of the subnet + :type name: str + :param properties: RoutePropertiesFormat - Properties of the route. + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties(Model): + """RoutePropertiesFormat - Properties of the route. + + :param address_prefix: AddressPrefix - The destination CIDR to which the + route applies. + :type address_prefix: str + :param next_hop_ip_address: NextHopIPAddress - The IP address packets + should be forwarded to. Next hop values are only allowed in routes where + the next hop type is VirtualAppliance. + :type next_hop_ip_address: str + """ + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + +class ArcVmExtensions(Model): + """Describes a Arc VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar system_data: + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensions, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + +class ArcVmExtensionsProperties(Model): + """ArcVmExtensionsProperties describes the properties of an Arc VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_automatic_upgrade: bool + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param instance_view: The machine extension instance view. + :type instance_view: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceView + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'extension_type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'instanceView', 'type': 'ArcVmExtensionsInstanceView'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsProperties, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.extension_type = kwargs.get('extension_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.instance_view = kwargs.get('instance_view', None) + +class ArcVmExtensionsInstanceView(Model): + """ArcVmExtensionsInstanceView describes the ArcVmExtension Instance View. + + :param name: The extension name. + :type name: str + :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: Instance view status. + :type status: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceViewStatus + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'extension_type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'ArcVmExtensionsInstanceViewStatus'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.extension_type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) + +class ArcVmExtensionsInstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: "Info", "Warning", "Error". + :type level: str + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and error messages. + :type message: str + :param time: The time of the status. + :type time: ~datetime.datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsInstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + +class ArcVmExtensionsPatch(Model): + """The ArcVmExtensions patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + +class ResourceUpdate(Model): + """The Update Resource model definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + +class ArcVmExtensionsUpdate(ResourceUpdate): + """Describes a Arc Extension update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param properties: Describes Arc VM Extension Update Properties. + :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdateProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsUpdateProperties'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsUpdate, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + +class ArcVmExtensionsUpdateProperties(Model): + """ArcVmExtensionsUpdateProperties describes the properties of an Arc VM Extension Update. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_automatic_upgrade: bool + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'extension_type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsUpdateProperties, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.extension_type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + +class ArcVmExtensionsListResult(Model): + """Describes the ArcVmExtensions List Result. + + :param value: The list of extensions. + :type value: list[~azure.mgmt.azurestackhci.models.ArcVmExtensions] + :param next_link: The uri to fetch the next page of arcvmextensions. Call ListNext() with + this to fetch the next page of extensions. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArcVmExtensions]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ArcVmExtensionsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py new file mode 100644 index 00000000000..da8ed8904e7 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py @@ -0,0 +1,2691 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from datetime import datetime +from tkinter.messagebox import NO +from typing import Dict, List +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AvailableOperations(Model): + """Available operations of the service. + + :param value: Collection of available operation details + :type value: list[~azure.mgmt.azurestackhci.models.OperationDetail] + :param next_link: URL client should use to fetch the next page (per server + side paging). + It's null for now, added for future use. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(AvailableOperations, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Resource(Model): + """Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top + level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class Cluster(TrackedResource): + """Cluster details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar provisioning_state: Provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' + :vartype provisioning_state: str or + ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar status: Status of the cluster agent. Possible values include: + 'Connected', 'Disconnected', 'Error' + :vartype status: str or ~azure.mgmt.azurestackhci.models.Status + :ivar cloud_id: Unique, immutable resource id. + :vartype cloud_id: str + :param aad_client_id: Required. App id of cluster AAD identity. + :type aad_client_id: str + :param aad_tenant_id: Required. Tenant id of cluster AAD identity. + :type aad_tenant_id: str + :param reported_properties: Properties reported by cluster agent. + :type reported_properties: + ~azure.mgmt.azurestackhci.models.ClusterReportedProperties + :ivar trial_days_remaining: Number of days remaining in the trial period. + :vartype trial_days_remaining: float + :ivar billing_model: Type of billing applied to the resource. + :vartype billing_model: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'cloud_id': {'readonly': True}, + 'aad_client_id': {'required': True}, + 'aad_tenant_id': {'required': True}, + 'trial_days_remaining': {'readonly': True}, + 'billing_model': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'cloud_id': {'key': 'properties.cloudId', 'type': 'str'}, + 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, + 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, + 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, + 'trial_days_remaining': {'key': 'properties.trialDaysRemaining', 'type': 'float'}, + 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, + } + + def __init__(self, *, location: str, aad_client_id: str, aad_tenant_id: str, tags=None, system_data=None, reported_properties=None, **kwargs) -> None: + super(Cluster, self).__init__(tags=tags, location=location, **kwargs) + self.system_data = system_data + self.provisioning_state = None + self.status = None + self.cloud_id = None + self.aad_client_id = aad_client_id + self.aad_tenant_id = aad_tenant_id + self.reported_properties = reported_properties + self.trial_days_remaining = None + self.billing_model = None + + +class ClusterNode(Model): + """Cluster node details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the cluster node. + :vartype name: str + :ivar id: Id of the node in the cluster. + :vartype id: float + :ivar manufacturer: Manufacturer of the cluster node hardware. + :vartype manufacturer: str + :ivar model: Model name of the cluster node hardware. + :vartype model: str + :ivar os_name: Operating system running on the cluster node. + :vartype os_name: str + :ivar os_version: Version of the operating system running on the cluster + node. + :vartype os_version: str + :ivar serial_number: Immutable id of the cluster node. + :vartype serial_number: str + :ivar core_count: Number of physical cores on the cluster node. + :vartype core_count: float + :ivar memory_in_gi_b: Total available memory on the cluster node (in GiB). + :vartype memory_in_gi_b: float + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'manufacturer': {'readonly': True}, + 'model': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'core_count': {'readonly': True}, + 'memory_in_gi_b': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'float'}, + 'manufacturer': {'key': 'manufacturer', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'core_count': {'key': 'coreCount', 'type': 'float'}, + 'memory_in_gi_b': {'key': 'memoryInGiB', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ClusterNode, self).__init__(**kwargs) + self.name = None + self.id = None + self.manufacturer = None + self.model = None + self.os_name = None + self.os_version = None + self.serial_number = None + self.core_count = None + self.memory_in_gi_b = None + + +class ClusterReportedProperties(Model): + """Properties reported by cluster agent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar cluster_name: Name of the on-prem cluster connected to this + resource. + :vartype cluster_name: str + :ivar cluster_id: Unique id generated by the on-prem cluster. + :vartype cluster_id: str + :ivar cluster_version: Version of the cluster software. + :vartype cluster_version: str + :ivar nodes: List of nodes reported by the cluster. + :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] + :ivar last_updated: Last time the cluster reported the data. + :vartype last_updated: datetime + """ + + _validation = { + 'cluster_name': {'readonly': True}, + 'cluster_id': {'readonly': True}, + 'cluster_version': {'readonly': True}, + 'nodes': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'cluster_version': {'key': 'clusterVersion', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[ClusterNode]'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(ClusterReportedProperties, self).__init__(**kwargs) + self.cluster_name = None + self.cluster_id = None + self.cluster_version = None + self.nodes = None + self.last_updated = None + + +class ClusterUpdate(Model): + """Cluster details to update. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ClusterUpdate, self).__init__(**kwargs) + self.tags = tags + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.azurestackhci.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class Galleryimages(Model): + """The galleryimages resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: ~azure.mgmt.azurestackhci.models.GalleryimagesProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.GalleryimagesExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'GalleryimagesProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'GalleryimagesExtendedLocation'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: + super(Galleryimages, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + self.extended_location = extended_location + + +class GalleryimagesExtendedLocation(Model): + """GalleryimagesExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(GalleryimagesExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class GalleryimagesPatch(Model): + """The galleryimages resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(GalleryimagesPatch, self).__init__(**kwargs) + self.tags = tags + + +class GalleryimagesProperties(Model): + """GalleryimagesProperties. + + :param storagepath_id: Azure ID of the storagepath which is used to store the Gallery Images. + :type storagepath_id: str + :param image_path: location of the image the gallery image should be + created from + :type image_path: str + :param os_type: operating system type that the gallery image uses. + Expected to be linux or windows + :type os_type: str + :param provisioning_state: + :type provisioning_state: str + :param status: MOCGalleryImageStatus defines the observed state of + MOCGalleryImage + :type status: object + :param identifier: galleryImageIdentifier defines the identity of the gallery image + :type identifier: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesIdentifier + :param version: version of the gallery image. + :type version: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesVersion + """ + + _attribute_map = { + 'storagepath_id': {'key': 'containerName', 'type': 'str'}, + 'image_path': {'key': 'imagePath', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'identifier': {'key': 'identifier', 'type': 'GalleryimagesPropertiesIdentifier'}, + 'version': {'key': 'version', 'type': 'GalleryimagesPropertiesVersion'}, + } + + def __init__(self, *, storagepath_id: str=None, image_path: str=None, os_type: str=None, provisioning_state: str=None, status=None,hyper_v_generation: str=None, identifier=None, version=None, **kwargs) -> None: + super(GalleryimagesProperties, self).__init__(**kwargs) + self.storagepath_id = storagepath_id + self.image_path = image_path + self.os_type = os_type + self.provisioning_state = provisioning_state + self.status = status + self.os_type = os_type + self.identifier = identifier + self.version = version + +class GalleryimagesPropertiesIdentifier(Model): + """GalleryimagesPropertiesIdentifier. + + :param offer: The name of the gallery image definition offer + :type offer: str + :param pubilsher: The name of the gallery image definition publisher + :type publisher: str + :param sku: The name of the gallery image definition SKU + :type sku: str + """ + + _attribute_map = { + 'offer': {'key': 'offer', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__(self, *, offer: str=None, publisher: str=None, sku: str=None,**kwargs) -> None: + super(GalleryimagesPropertiesIdentifier, self).__init__(**kwargs) + self.offer = offer + self.publisher = publisher + self.sku = sku + +class GalleryimagesPropertiesVersion(Model): + """GalleryimagesPropertiesIdentifier. + + :param name: The name of the gallery image version + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None,**kwargs) -> None: + super(GalleryimagesPropertiesVersion, self).__init__(**kwargs) + self.name = name + + +class HardwareProfileUpdate(Model): + """HardwareProfile - Specifies the hardware settings for the virtual machine. + + :param vm_size: + :type vm_size: str + :param processors: number of processors for the virtual machine + :type processors: int + :param memory_mb: RAM in mb for the virtual machine + :type memory_mb: int + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'processors': {'key': 'processors', 'type': 'int'}, + 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, + } + + def __init__(self, *, vm_size: str=None, processors: int=None, memory_mb: int=None, **kwargs) -> None: + super(HardwareProfileUpdate, self).__init__(**kwargs) + self.vm_size = vm_size + self.processors = processors + self.memory_mb = memory_mb + + +class Networkinterfaces(Model): + """The networkinterfaces resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'NetworkinterfacesProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'NetworkinterfacesExtendedLocation'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: + super(Networkinterfaces, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + self.extended_location = extended_location + + +class NetworkinterfacesExtendedLocation(Model): + """NetworkinterfacesExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(NetworkinterfacesExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class NetworkinterfacesPatch(Model): + """The networkinterfaces resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(NetworkinterfacesPatch, self).__init__(**kwargs) + self.tags = tags + + +class NetworkinterfacesProperties(Model): + """MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface. + + :param ip_configurations: IPConfigurations - A list of IPConfigurations of + the network interface. + :type ip_configurations: + list[~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItem] + :param mac_address: MacAddress - The MAC address of the network interface. + :type mac_address: str + :param dns_settings: DNS Settings for the interface + :type dns_settings: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesInterfaceDNSSettings + :param provisioning_state: + :type provisioning_state: str + :param status: MOCNetworkInterfaceStatus defines the observed state of + MOCNetworkInterface + :type status: object + :param resource_name: name of the object to be used in moc + :type resource_name: str + """ + + _attribute_map = { + 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NetworkinterfacesPropertiesIpConfigurationsItem]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'dns_settings': {'key': 'dnsSettings', 'type': 'NetworkinterfacesPropertiesInterfaceDNSSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'resource_name' : {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, ip_configurations=None, mac_address: str=None, dns_settings=None, provisioning_state: str=None, status=None, **kwargs) -> None: + super(NetworkinterfacesProperties, self).__init__(**kwargs) + self.ip_configurations = ip_configurations + self.mac_address = mac_address + self.dns_settings = dns_settings + self.provisioning_state = provisioning_state + self.status = status + self.resource_name = kwargs.get('resource_name', None) + + +class NetworkinterfacesPropertiesIpConfigurationsItem(Model): + """InterfaceIPConfiguration iPConfiguration in a network interface. + + :param name: Name - The name of the resource that is unique within a + resource group. This name can be used to access the resource. + :type name: str + :param properties: InterfaceIPConfigurationPropertiesFormat properties of + IP configuration. + :type properties: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemProperties'}, + } + + def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: + super(NetworkinterfacesPropertiesIpConfigurationsItem, self).__init__(**kwargs) + self.name = name + self.properties = properties + + +class NetworkinterfacesPropertiesIpConfigurationsItemProperties(Model): + """InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + + :param gateway: Gateway for network interface + :type gateway: str + :param prefix_length: prefixLength for network interface + :type prefix_length: str + :param private_ip_address: PrivateIPAddress - Private IP address of the IP + configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIPAllocationMethod - The + private IP address allocation method. Possible values include: 'Static', + 'Dynamic' + :type private_ip_allocation_method: str + :param subnet: Subnet - Name of Subnet bound to the IP configuration. + :type subnet: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet + """ + + _attribute_map = { + 'gateway': {'key': 'gateway', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet'}, + } + + def __init__(self, *, gateway: str=None, prefix_length: str=None, private_ip_address: str=None, private_ip_allocation_method: str=None, subnet=None, **kwargs) -> None: + super(NetworkinterfacesPropertiesIpConfigurationsItemProperties, self).__init__(**kwargs) + self.gateway = gateway + self.prefix_length = prefix_length + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + + +class NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet(Model): + """Subnet - Name of Subnet bound to the IP configuration. + + :param id: ID - The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet, self).__init__(**kwargs) + self.id = id + + +class NetworkinterfacesPropertiesInterfaceDNSSettings(Model): + """ + :param dns_servers: List of DNS server IP Addresses for the interface + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(NetworkinterfacesPropertiesInterfaceDNSSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + + +class NetworkProfileUpdate(Model): + """NetworkProfile - describes the network update configuration the virtual + machine. + + :param network_interfaces: NetworkInterfaces - list of network interfaces + to be attached to the virtual machine + :type network_interfaces: + list[~azure.mgmt.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkProfileUpdateNetworkInterfacesItem]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfileUpdate, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class NetworkProfileUpdateNetworkInterfacesItem(Model): + """NetworkProfileUpdateNetworkInterfacesItem. + + :param id: ID - Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(NetworkProfileUpdateNetworkInterfacesItem, self).__init__(**kwargs) + self.id = id + + +class OperationDetail(Model): + """Operation detail payload. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: ~azure.mgmt.azurestackhci.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationDetail, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.properties = properties + + +class OperationDisplay(Model): + """Operation display payload. + + :param provider: Resource provider of the operation + :type provider: str + :param resource: Resource of the operation + :type resource: str + :param operation: Localized friendly name for the operation + :type operation: str + :param description: Localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. + It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class Storagecontainers(Model): + """The storagecontainers resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.StoragecontainersProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.StoragecontainersExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'StoragecontainersProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'StoragecontainersExtendedLocation'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: + super(Storagecontainers, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + self.extended_location = extended_location + + +class StoragecontainersExtendedLocation(Model): + """StoragecontainersExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(StoragecontainersExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class StoragecontainersPatch(Model): + """The storagecontainers resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(StoragecontainersPatch, self).__init__(**kwargs) + self.tags = tags + + +class StoragecontainersProperties(Model): + """StoragecontainersProperties. + + :param path: location of the image the gallery image should be created + from + :type path: str + :param provisioning_state: + :type provisioning_state: str + :param status: MOCStorageContainerStatus defines the observed state of + MOCStorageContainer + :type status: object + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + } + + def __init__(self, *, path: str=None, provisioning_state: str=None, status=None, **kwargs) -> None: + super(StoragecontainersProperties, self).__init__(**kwargs) + self.path = path + self.provisioning_state = provisioning_state + self.status = status + + +class StorageProfileUpdate(Model): + """StorageProfileUpdate. + + :param data_disks: adds data disks to the virtual machine for the update + call + :type data_disks: + list[~azure.mgmt.azurestackhci.models.StorageProfileUpdateDataDisksItem] + """ + + _attribute_map = { + 'data_disks': {'key': 'dataDisks', 'type': '[StorageProfileUpdateDataDisksItem]'}, + } + + def __init__(self, *, data_disks=None, **kwargs) -> None: + super(StorageProfileUpdate, self).__init__(**kwargs) + self.data_disks = data_disks + + +class StorageProfileUpdateDataDisksItem(Model): + """StorageProfileUpdateDataDisksItem. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(StorageProfileUpdateDataDisksItem, self).__init__(**kwargs) + self.name = name + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.azurestackhci.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.azurestackhci.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class Virtualharddisks(Model): + """The virtualharddisks resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualharddisksProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.VirtualharddisksExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualharddisksProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualharddisksExtendedLocation'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: + super(Virtualharddisks, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + self.extended_location = extended_location + + +class VirtualharddisksExtendedLocation(Model): + """VirtualharddisksExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(VirtualharddisksExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class VirtualharddisksPatch(Model): + """The virtualharddisks resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(VirtualharddisksPatch, self).__init__(**kwargs) + self.tags = tags + + +class VirtualharddisksProperties(Model): + """MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk. + + :param block_size_bytes: + :type block_size_bytes: int + :param disk_size_gb: diskSizeGB - size of the disk in GB + :type disk_size_gb: long + :param dynamic: Boolean for enabling dynamic sizing on the virtual hard + disk + :type dynamic: bool + :param logical_sector_bytes: + :type logical_sector_bytes: int + :param physical_sector_bytes: + :type physical_sector_bytes: int + :param storagepath_id: + :type storagepath_id: str + :param provisioning_state: + :type provisioning_state: str + :param status: MOCVirtualHardDiskStatus defines the observed state of + MOCVirtualHardDisk + :type status: object + :param disk_file_format: file format of the hard disk. + Expected to be vhd or vhdx + :type disk_file_format: str + """ + + _attribute_map = { + 'block_size_bytes': {'key': 'blockSizeBytes', 'type': 'int'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'long'}, + 'dynamic': {'key': 'dynamic', 'type': 'bool'}, + 'logical_sector_bytes': {'key': 'logicalSectorBytes', 'type': 'int'}, + 'physical_sector_bytes': {'key': 'physicalSectorBytes', 'type': 'int'}, + 'storagepath_id': {'key': 'containerId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'disk_file_format': {'key': 'diskFileFormat', 'type': 'str'}, + } + + def __init__(self, *, block_size_bytes: int=None, disk_size_gb: int=None, dynamic: bool=None, logical_sector_bytes: int=None, physical_sector_bytes: int=None, storagepath_id: str=None, provisioning_state: str=None, status=None, hyper_v_generation: str=None, disk_file_format: str=None,**kwargs) -> None: + super(VirtualharddisksProperties, self).__init__(**kwargs) + self.block_size_bytes = block_size_bytes + self.disk_size_gb = disk_size_gb + self.dynamic = dynamic + self.logical_sector_bytes = logical_sector_bytes + self.physical_sector_bytes = physical_sector_bytes + self.storagepath_id = storagepath_id + self.provisioning_state = provisioning_state + self.status = status + self.disk_file_format = disk_file_format + + +class Virtualmachines(Model): + """The virtualmachines resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualmachinesProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.VirtualmachinesExtendedLocation + :param identity: + :type identity: + ~azure.mgmt.azurestackhci.models.VirtualmachinesIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualmachinesProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualmachinesExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'VirtualmachinesIdentity'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, identity=None, **kwargs) -> None: + super(Virtualmachines, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + self.extended_location = extended_location + self.identity = identity + + +class VirtualmachinesExtendedLocation(Model): + """VirtualmachinesExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(VirtualmachinesExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + +class VirtualmachinesIdentity(Model): + """VirtualmachinesIdentity + + :param type: The identity type. + :type type: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, **kwargs) -> None: + super(VirtualmachinesIdentity, self).__init__(**kwargs) + self.type = type + +class VirtualmachinesPatch(Model): + """The virtualmachines resource patch definition. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualMachineUpdateProperties + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualMachineUpdateProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties=None, tags=None, **kwargs) -> None: + super(VirtualmachinesPatch, self).__init__(**kwargs) + self.properties = properties + self.tags = tags + + +class VirtualmachinesProperties(Model): + """MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine. + + :param hardware_profile: HardwareProfile - Specifies the hardware settings + for the virtual machine. + :type hardware_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile + :param network_profile: NetworkProfile - describes the network + configuration the virtual machine + :type network_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile + :param os_profile: OsProfile - describes the configuration of the + operating system and sets login data + :type os_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfile + :param security_profile: SecurityProfile - Specifies the security settings + for the virtual machine. + :type security_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile + :param storage_profile: StorageProfile - contains information about the + disks and storage information for the virtual machine + :type storage_profile: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfile + :param provisioning_state: + :type provisioning_state: str + :param status: MOCVirtualMachineStatus defines the observed state of + MOCVirtualMachine + :type status: object + :param guest_agent_profile: GuestAgentProfile - Contains information related + to guest agent. + :type guest_agent_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfile + """ + + _attribute_map = { + 'hardware_profile': {'key': 'hardwareProfile', 'type': 'VirtualmachinesPropertiesHardwareProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualmachinesPropertiesNetworkProfile'}, + 'os_profile': {'key': 'osProfile', 'type': 'VirtualmachinesPropertiesOsProfile'}, + 'security_profile': {'key': 'securityProfile', 'type': 'VirtualmachinesPropertiesSecurityProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualmachinesPropertiesStorageProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'guest_agent_profile': {'key': 'guestAgentProfile', 'type': 'VirtualMachineGuestAgentProfile'}, + } + + def __init__(self, *, hardware_profile=None, network_profile=None, os_profile=None, security_profile=None, storage_profile=None, provisioning_state: str=None, status=None, guest_agent_profile=None, **kwargs) -> None: + super(VirtualmachinesProperties, self).__init__(**kwargs) + self.hardware_profile = hardware_profile + self.network_profile = network_profile + self.os_profile = os_profile + self.security_profile = security_profile + self.storage_profile = storage_profile + self.provisioning_state = provisioning_state + self.status = status + self.guest_agent_profile = guest_agent_profile + +class VirtualmachinesPropertiesHardwareProfile(Model): + """HardwareProfile - Specifies the hardware settings for the virtual machine. + + :param vm_size: + :type vm_size: str + :param processors: number of processors for the virtual machine + :type processors: int + :param memory_mb: RAM in mb for the virtual machine. + :type memory_mb: int + :param dynamic_memory_config: + :type dynamic_memory_config: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'processors': {'key': 'processors', 'type': 'int'}, + 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, + 'dynamic_memory_config': {'key': 'dynamicMemoryConfig', 'type': 'VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig'}, + } + + def __init__( + self, + *, + vm_size = None, + processors = None, + memory_mb = None, + dynamic_memory_config = None, + **kwargs + ): + super(VirtualmachinesPropertiesHardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size + self.processors = processors + self.memory_mb = memory_mb + self.dynamic_memory_config = dynamic_memory_config + + +class VirtualmachinesPropertiesNetworkProfile(Model): + """NetworkProfile - describes the network configuration the virtual machine. + + :param network_interfaces: NetworkInterfaces - list of network interfaces + to be attached to the virtual machine + :type network_interfaces: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(VirtualmachinesPropertiesNetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem(Model): + """VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem. + + :param id: ID - Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem, self).__init__(**kwargs) + self.id = id + + +class VirtualmachinesPropertiesOsProfile(Model): + """OsProfile - describes the configuration of the operating system and sets + login data. + + :param admin_password: AdminPassword - admin password + :type admin_password: str + :param admin_username: AdminUsername - admin username + :type admin_username: str + :param computer_name: ComputerName - name of the compute + :type computer_name: str + :param linux_configuration: LinuxConfiguration - linux specific + configuration values for the virtual machine + :type linux_configuration: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfiguration + :param os_type: OsType - string specifying whether the OS is Linux or + Windows + :type os_type: str + :param windows_configuration: Windows Configuration for the virtual + machine + :type windows_configuration: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfiguration + """ + + _attribute_map = { + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfiguration'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfiguration'}, + } + + def __init__(self, *, admin_password: str=None, admin_username: str=None, computer_name: str=None, linux_configuration=None, os_type: str=None, windows_configuration=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfile, self).__init__(**kwargs) + self.admin_password = admin_password + self.admin_username = admin_username + self.computer_name = computer_name + self.linux_configuration = linux_configuration + self.os_type = os_type + self.windows_configuration = windows_configuration + + +class VirtualmachinesPropertiesOsProfileLinuxConfiguration(Model): + """LinuxConfiguration - linux specific configuration values for the virtual + machine. + + :param disable_password_authentication: DisablePasswordAuthentication - + whether password authentication should be disabled + :type disable_password_authentication: bool + :param ssh: SSH - contains settings related to ssh configuration + :type ssh: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh + :param provision_vm_agent: Whether to provision guest management agent + :type provision_vm_agent: bool + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + } + + def __init__(self, *, disable_password_authentication: bool=None, ssh=None, provision_vm_agent=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfileLinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh + self.provision_vm_agent = provision_vm_agent + + +class VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh(Model): + """SSH - contains settings related to ssh configuration. + + :param public_keys: PublicKeys - The list of SSH public keys used to + authenticate with linux based VMs. + :type public_keys: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh, self).__init__(**kwargs) + self.public_keys = public_keys + + +class VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem(Model): + """VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem. + + :param key_data: KeyData - SSH public key certificate used to authenticate + with the VM through ssh. The key needs to be at least 2048-bit and in + ssh-rsa format.

For creating ssh keys, see [Create SSH keys on + Linux and Mac for Li nux VMs in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + :param path: Path - Specifies the full path on the created VM where ssh + public key is stored. If the file already exists, the specified key is + appended to the file. Example: /home/user/.ssh/authorized_keys + :type path: str + """ + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, key_data: str=None, path: str=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem, self).__init__(**kwargs) + self.key_data = key_data + self.path = path + + +class VirtualmachinesPropertiesOsProfileWindowsConfiguration(Model): + """Windows Configuration for the virtual machine . + + :param enable_automatic_updates: Whether to EnableAutomaticUpdates on the + machine + :type enable_automatic_updates: bool + :param provision_vm_agent: Whether to provision guest management agent + :type provision_vm_agent: bool + :param ssh: AdditionalUnattendContent AdditionalUnattendContent + *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + SSH + :type ssh: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh + :param time_zone: TimeZone for the virtual machine + :type time_zone: str + """ + + _attribute_map = { + 'enable_automatic_updates': {'key': 'enableAutomaticUpdates', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + } + + def __init__(self, *, enable_automatic_updates: bool=None, ssh=None, time_zone: str=None, provision_vm_agent: bool=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfileWindowsConfiguration, self).__init__(**kwargs) + self.enable_automatic_updates = enable_automatic_updates + self.ssh = ssh + self.time_zone = time_zone + self.provision_vm_agent = provision_vm_agent + + +class VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh(Model): + """AdditionalUnattendContent AdditionalUnattendContent + *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + SSH. + + :param public_keys: PublicKeys - The list of SSH public keys used to + authenticate with linux based VMs. + :type public_keys: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh, self).__init__(**kwargs) + self.public_keys = public_keys + + +class VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem(Model): + """VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem. + + :param key_data: KeyData - SSH public key certificate used to authenticate + with the VM through ssh. The key needs to be at least 2048-bit and in + ssh-rsa format.

For creating ssh keys, see [Create SSH keys on + Linux and Mac for Li nux VMs in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + :param path: Path - Specifies the full path on the created VM where ssh + public key is stored. If the file already exists, the specified key is + appended to the file. Example: /home/user/.ssh/authorized_keys + :type path: str + """ + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, key_data: str=None, path: str=None, **kwargs) -> None: + super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem, self).__init__(**kwargs) + self.key_data = key_data + self.path = path + + +class VirtualmachinesPropertiesSecurityProfile(Model): + """SecurityProfile - Specifies the security settings for the virtual machine. + + :param enable_tpm: + :type enable_tpm: bool + :param uefi_settings: + :type uefi_settings: ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfileUefiSettings + """ + + _attribute_map = { + 'enable_tpm': {'key': 'enableTPM', 'type': 'bool'}, + 'uefi_settings': {'key': 'uefiSettings', 'type': 'VirtualmachinesPropertiesSecurityProfileUefiSettings'}, + } + + def __init__(self, *, enable_tpm: bool=None,uefi_settings = None, **kwargs) -> None: + super(VirtualmachinesPropertiesSecurityProfile, self).__init__(**kwargs) + self.enable_tpm = enable_tpm + self.uefi_settings = uefi_settings + +class VirtualmachinesPropertiesSecurityProfileUefiSettings(Model): + """SecurityProfile - Specifies the security settings for the virtual machine. + + :param secure_boot_enabled: + :type secure_boot_enabled: bool + """ + + _attribute_map = { + 'secure_boot_enabled': {'key': 'secureBootEnabled', 'type': 'bool'}, + } + + def __init__(self, *, secure_boot_enabled: bool=None, **kwargs) -> None: + super(VirtualmachinesPropertiesSecurityProfileUefiSettings, self).__init__(**kwargs) + self.secure_boot_enabled = kwargs.get('secure_boot_enabled', None) + +class VirtualmachinesPropertiesStorageProfile(Model): + """StorageProfile - contains information about the disks and storage + information for the virtual machine. + + :param data_disks: adds data disks to the virtual machine + :type data_disks: + list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileDataDisksItem] + :param image_reference: Which Image to use for the virtual machine + :type image_reference: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileImageReference + :param storagepath_id: Azure ID of the storagepath which is used to store Virtual Machine configuration file. + :type storagepath_id: str + """ + + _attribute_map = { + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualmachinesPropertiesStorageProfileDataDisksItem]'}, + 'image_reference': {'key': 'imageReference', 'type': 'VirtualmachinesPropertiesStorageProfileImageReference'}, + 'os_disk': {'key':'osDisk', 'type': 'VirtualmachinesPropertiesStorageProfileOsDisk'}, + 'storagepath_id': {'key': 'vmConfigStoragePathId', 'type': 'str'}, + } + + def __init__(self, *, data_disks=None, os_disk=None, image_reference=None, storagepath_id=None, **kwargs) -> None: + super(VirtualmachinesPropertiesStorageProfile, self).__init__(**kwargs) + self.data_disks = data_disks + self.image_reference = image_reference + self.os_disk = os_disk + self.storagepath_id = storagepath_id + + +class VirtualmachinesPropertiesStorageProfileDataDisksItem(Model): + """VirtualmachinesPropertiesStorageProfileDataDisksItem. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(VirtualmachinesPropertiesStorageProfileDataDisksItem, self).__init__(**kwargs) + self.name = name + + +class VirtualmachinesPropertiesStorageProfileImageReference(Model): + """Which Image to use for the virtual machine. + + :param name: Name - Name of the image + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(VirtualmachinesPropertiesStorageProfileImageReference, self).__init__(**kwargs) + self.name = name + +class VirtualmachinesPropertiesStorageProfileOsDisk(Model): + """Which Image to use for the virtual machine. + + :param id: Id - Id of the os disk + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualmachinesPropertiesStorageProfileOsDisk, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class VirtualMachineUpdateProperties(Model): + """Defines the resource properties for the update. + + :param hardware_profile: + :type hardware_profile: + ~azure.mgmt.azurestackhci.models.HardwareProfileUpdate + :param storage_profile: + :type storage_profile: + ~azure.mgmt.azurestackhci.models.StorageProfileUpdate + :param network_profile: + :type network_profile: + ~azure.mgmt.azurestackhci.models.NetworkProfileUpdate + """ + + _attribute_map = { + 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfileUpdate'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfileUpdate'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfileUpdate'}, + } + + def __init__(self, *, hardware_profile=None, storage_profile=None, network_profile=None, **kwargs) -> None: + super(VirtualMachineUpdateProperties, self).__init__(**kwargs) + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + +class VirtualMachineGuestAgentProfile(Model): + """VirtualMachineGuestAgentProfile - Contains information related + to guest agent. + + :param status: + :type status: str + :param vmuuid: + :type vmuuid: str + :param agent_version: + :type agent_version: str + :type last_status_change: + :type last_status_change: ~datetime.datetime + :param error_details: + :type error_details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'vmuuid': {'key': 'vmUuid', 'type': 'str'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, + } + + def __init__(self, *, status: str=None, vmuuid: str=None, agent_version: str=None, last_status_change: str=None, error_details=None, **kwargs) -> None: + super(VirtualMachineGuestAgentProfile, self).__init__(**kwargs) + self.status = status + self.vmuuid = vmuuid + self.agent_version = agent_version + self.last_status_change = last_status_change + self.error_details = error_details + +class VirtualMachineGuestAgentProfileErrorDetail(Model): + """The error detail. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] + :param additional_info: + :type additional_info: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, + 'additional_info': {'key': 'additional_info', 'type': '[VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, additional_info=None, **kwargs) -> None: + super(VirtualMachineGuestAgentProfileErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.additional_info = additional_info + +class VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo(Model): + """Error additional info. + + :param type: + :type type: str + :param info: + :type info: object + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, *, type: str=None, info=None, **kwargs) -> None: + super(VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo, self).__init__(**kwargs) + self.type = type + self.info = info + +class Virtualnetworks(Model): + """The virtualnetworks resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param system_data: + :type system_data: ~azure.mgmt.azurestackhci.models.SystemData + :param extended_location: + :type extended_location: + ~azure.mgmt.azurestackhci.models.VirtualnetworksExtendedLocation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'VirtualnetworksProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualnetworksExtendedLocation'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: + super(Virtualnetworks, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + self.extended_location = extended_location + + +class VirtualnetworksExtendedLocation(Model): + """VirtualnetworksExtendedLocation. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(VirtualnetworksExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class VirtualnetworksPatch(Model): + """The virtualnetworks resource patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(VirtualnetworksPatch, self).__init__(**kwargs) + self.tags = tags + + +class VirtualnetworksProperties(Model): + """MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork. + + :param network_type: Type of the network + :type network_type: str + :param dhcp_options: DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network + :type dhcp_options: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesDHCPOptions + :param subnets: Subnet - list of subnets under the virtual network + :type subnets: + list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem] + :param provisioning_state: + :type provisioning_state: str + :param status: MOCVirtualNetworkStatus defines the observed state of + MOCVirtualNetwork + :type status: object + :param vm_switch_name: name of the network switch to be used for VMs + :type vm_switch_name: str + """ + + _attribute_map = { + 'network_type': {'key': 'networkType', 'type': 'str'}, + 'dhcp_options': {'key': 'dhcpOptions', 'type': 'VirtualnetworksPropertiesDHCPOptions'}, + 'subnets': {'key': 'subnets', 'type': '[VirtualnetworksPropertiesSubnetsItem]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'vm_switch_name': {'key': 'vmSwitchName', 'type': 'str'}, + } + + def __init__(self, *, network_type: str=None, subnets=None, provisioning_state: str=None, status=None, vm_switch_name=None, dhcp_options=None, **kwargs) -> None: + super(VirtualnetworksProperties, self).__init__(**kwargs) + self.network_type = network_type + self.dhcp_options = dhcp_options + self.subnets = subnets + self.provisioning_state = provisioning_state + self.status = status + self.vm_switch_name = vm_switch_name + + +class VirtualnetworksPropertiesDHCPOptions(Model): + """ + :param dns_servers: The list of DNS servers IP addresses + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(VirtualnetworksPropertiesDHCPOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers + + +class VirtualnetworksPropertiesSubnetsItem(Model): + """Subnet subnet in a virtual network resource. + + :param name: Name - The name of the resource that is unique within a + resource group. This name can be used to access the resource. + :type name: str + :param properties: SubnetProperties - Properties of the subnet. + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemProperties'}, + } + + def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItem, self).__init__(**kwargs) + self.name = name + self.properties = properties + + +class VirtualnetworksPropertiesSubnetsItemProperties(Model): + """SubnetProperties - Properties of the subnet. + + :param address_prefix: Cidr for this subnet - IPv4, IPv6 + :type address_prefix: str + :param address_prefixes: AddressPrefixes - List of address prefixes for + the subnet. + :type address_prefixes: list[str] + :param ip_allocation_method: IPAllocationMethod - The IP address + allocation method. Possible values include: 'Static', 'Dynamic' + :type ip_allocation_method: str + :param ip_pools: List of IPs having start, end IP range along with their types + :type ip_pools: list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIPPool] + :param ip_configuration_references: IPConfigurationReferences - list of + IPConfigurationReferences + :type ip_configuration_references: + list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem] + :param route_table: RouteTable for the subnet + :type route_table: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable + :param vlan: Vlan to use for the subnet + :type vlan: int + """ + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'ip_allocation_method': {'key': 'ipAllocationMethod', 'type': 'str'}, + 'ip_pools' : {'key': 'ipPools', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIPPool]'}, + 'ip_configuration_references': {'key': 'ipConfigurationReferences', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem]'}, + 'route_table': {'key': 'routeTable', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable'}, + 'vlan': {'key': 'vlan', 'type': 'int'}, + } + + def __init__(self, *, address_prefix: str=None, address_prefixes=None, ip_allocation_method: str=None, ip_configuration_references=None, route_table=None, vlan: int=None, ip_pools=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemProperties, self).__init__(**kwargs) + self.address_prefix = address_prefix + self.address_prefixes = address_prefixes + self.ip_allocation_method = ip_allocation_method + self.ip_pools = ip_pools + self.ip_configuration_references = ip_configuration_references + self.route_table = route_table + self.vlan = vlan + +class VirtualnetworksPropertiesSubnetsItemPropertiesIPPool(Model): + """IPPool - Describe IPPool parameters + + :param ip_pool_type: IPPoolType + :type ip_pool_type: str + :param start: starting range of IP Address + :type start: str + :param end: ending range of IP Address + :type end: str + """ + _attribute_map = { + 'ip_pool_type': {'key': 'ipPoolType', 'type': 'str'}, + 'start': {'key': 'start', 'type': 'str'}, + 'end': {'key': 'end', 'type':'str'}, + } + + def __init__(self, *, ip_pool_type: str=None, start: str=None, end=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemPropertiesIPPool, self).__init__(**kwargs) + self.ip_pool_type = ip_pool_type + self.start = start + self.end = end + +class VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem(Model): + """IPConfigurationReference - Describes a IPConfiguration under the virtual + network. + + :param id: IPConfigurationID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'ID', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem, self).__init__(**kwargs) + self.id = id + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable(Model): + """RouteTable for the subnet. + + :param id: Etag - Gets a unique read-only string that changes whenever the + resource is updated. + :type id: str + :param name: Name - READ-ONLY; Resource name. + :type name: str + :param properties: RouteTablePropertiesFormat route Table resource. + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties + :param type: Type - READ-ONLY; Resource type. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, properties=None, type: str=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable, self).__init__(**kwargs) + self.id = id + self.name = name + self.properties = properties + self.type = type + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties(Model): + """RouteTablePropertiesFormat route Table resource. + + :param routes: Routes - Collection of routes contained within a route + table. + :type routes: + list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem]'}, + } + + def __init__(self, *, routes=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties, self).__init__(**kwargs) + self.routes = routes + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem(Model): + """Route is associated with a subnet. + + :param name: Name - name of the subnet + :type name: str + :param properties: RoutePropertiesFormat - Properties of the route. + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties'}, + } + + def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem, self).__init__(**kwargs) + self.name = name + self.properties = properties + + +class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties(Model): + """RoutePropertiesFormat - Properties of the route. + + :param address_prefix: AddressPrefix - The destination CIDR to which the + route applies. + :type address_prefix: str + :param next_hop_ip_address: NextHopIPAddress - The IP address packets + should be forwarded to. Next hop values are only allowed in routes where + the next hop type is VirtualAppliance. + :type next_hop_ip_address: str + """ + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + } + + def __init__(self, *, address_prefix: str=None, next_hop_ip_address: str=None, **kwargs) -> None: + super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties, self).__init__(**kwargs) + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address +class VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig(Model): + """VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig. + + :param maximum_memory_mb: + :type maximum_memory_mb: long + :param minimum_memory_mb: + :type minimum_memory_mb: long + :param target_memory_buffer: + :type target_memory_buffer: int + """ + + _attribute_map = { + 'maximum_memory_mb': {'key': 'maximumMemoryMB', 'type': 'long'}, + 'minimum_memory_mb': {'key': 'minimumMemoryMB', 'type': 'long'}, + 'target_memory_buffer': {'key': 'targetMemoryBuffer', 'type': 'int'}, + } + + def __init__( + self, + *, + maximum_memory_mb = None, + minimum_memory_mb = None, + target_memory_buffer = None, + **kwargs + ): + super(VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig, self).__init__(**kwargs) + self.maximum_memory_mb = maximum_memory_mb + self.minimum_memory_mb = minimum_memory_mb + self.target_memory_buffer = target_memory_buffer + +class ArcVmExtensions(Model): + """Describes a Arc VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param properties: + :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsProperties + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource Name + :vartype name: str + :ivar type: Resource Type + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar system_data: + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, location: str, properties=None, tags=None, system_data=None, **kwargs) -> None: + super(ArcVmExtensions, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + +class ArcVmExtensionsProperties(Model): + """ArcVmExtensionsProperties describes the properties of an Arc VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_automatic_upgrade: bool + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param instance_view: The machine extension instance view. + :type instance_view: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceView + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'extension_type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'instanceView', 'type': 'ArcVmExtensionsInstanceView'}, + } + + def __init__(self, *, location: str=None, force_update_tag: str=None, publisher: str=None, extension_type: str=None, type_handler_version: str=None, enable_automatic_upgrade: str=None, auto_upgrade_minor_version: str=None, settings: object=None, protected_settings: object=None, instance_view: ArcVmExtensionsInstanceView=None, **kwargs) -> None: + super(ArcVmExtensionsProperties, self).__init__(**kwargs) + self.location = location + self.force_update_tag = force_update_tag + self.publisher = publisher + self.extension_type = extension_type + self.type_handler_version = type_handler_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view + +class ArcVmExtensionsInstanceView(Model): + """ArcVmExtensionsInstanceView describes the ArcVmExtension Instance View. + + :param name: The extension name. + :type name: str + :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: Instance view status. + :type status: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceViewStatus + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'extension_type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'ArcVmExtensionsInstanceViewStatus'}, + } + + def __init__(self, *, name: str=None, extension_type: str=None, type_handler_version: str=None, status: ArcVmExtensionsInstanceViewStatus=None, **kwargs) -> None: + super(ArcVmExtensionsInstanceView, self).__init__(**kwargs) + self.name = name + self.extension_type = extension_type + self.type_handler_version = type_handler_version + self.status = status + +class ArcVmExtensionsInstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: "Info", "Warning", "Error". + :type level: str + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and error messages. + :type message: str + :param time: The time of the status. + :type time: ~datetime.datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, level: str=None, display_status: str=None, message: str=None, time: datetime=None, **kwargs) -> None: + super(ArcVmExtensionsInstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time + +class ArcVmExtensionsPatch(Model): + """The ArcVmExtensions patch definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ArcVmExtensionsPatch, self).__init__(**kwargs) + self.tags = tags + +class ResourceUpdate(Model): + """The Update Resource model definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags: Dict[str,str]=None, **kwargs) -> None: + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = tags + +class ArcVmExtensionsUpdate(ResourceUpdate): + """Describes a Arc VM Extension update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param properties: Describes Arc VM Extension Update Properties. + :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdateProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsUpdateProperties'}, + } + + def __init__(self, *, tags: Dict[str,str]=None, properties: ArcVmExtensionsUpdateProperties=None, **kwargs): + super(ArcVmExtensionsUpdate, self).__init__(tags=tags, **kwargs) + self.properties = properties + self.tags = tags + +class ArcVmExtensionsUpdateProperties(Model): + """ArcVmExtensionsUpdateProperties describes the properties of an Arc VM Extension Update. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_automatic_upgrade: bool + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'extension_type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__(self, *, force_update_tag: str=None, publisher: str=None, extension_type: str=None, type_handler_version: str=None, enable_automatic_upgrade: bool=None, auto_upgrade_minor_version: bool=None, settings: object=None, protected_settings: object=None, **kwargs) -> None: + super(ArcVmExtensionsUpdateProperties, self).__init__(**kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.extension_type = extension_type + self.type_handler_version = type_handler_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + +class ArcVmExtensionsListResult(Model): + """Describes the ArcVmExtensions List Result. + + :param value: The list of extensions. + :type value: list[~azure.mgmt.azurestackhci.models.ArcVmExtensions] + :param next_link: The uri to fetch the next page of arcvmextensions. Call ListNext() with + this to fetch the next page of extensions. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArcVmExtensions]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value: List["ArcVmExtensions"]=None, next_link: str=None, **kwargs) -> None: + super(ArcVmExtensionsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py new file mode 100644 index 00000000000..f2d6a61540c --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class GalleryimagesPaged(Paged): + """ + A paging container for iterating over a list of :class:`Galleryimages ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Galleryimages]'} + } + + def __init__(self, *args, **kwargs): + + super(GalleryimagesPaged, self).__init__(*args, **kwargs) +class NetworkinterfacesPaged(Paged): + """ + A paging container for iterating over a list of :class:`Networkinterfaces ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Networkinterfaces]'} + } + + def __init__(self, *args, **kwargs): + + super(NetworkinterfacesPaged, self).__init__(*args, **kwargs) +class VirtualharddisksPaged(Paged): + """ + A paging container for iterating over a list of :class:`Virtualharddisks ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Virtualharddisks]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualharddisksPaged, self).__init__(*args, **kwargs) +class VirtualmachinesPaged(Paged): + """ + A paging container for iterating over a list of :class:`Virtualmachines ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Virtualmachines]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualmachinesPaged, self).__init__(*args, **kwargs) +class VirtualnetworksPaged(Paged): + """ + A paging container for iterating over a list of :class:`Virtualnetworks ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Virtualnetworks]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualnetworksPaged, self).__init__(*args, **kwargs) +class StoragecontainersPaged(Paged): + """ + A paging container for iterating over a list of :class:`Storagecontainers ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Storagecontainers]'} + } + + def __init__(self, *args, **kwargs): + + super(StoragecontainersPaged, self).__init__(*args, **kwargs) +class ClusterPaged(Paged): + """ + A paging container for iterating over a list of :class:`Cluster ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Cluster]'} + } + + def __init__(self, *args, **kwargs): + + super(ClusterPaged, self).__init__(*args, **kwargs) +class ArcVmExtensionsPaged(Paged): + """ + A paging container for iterating over a list of :class:`ArcVmExtensions ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ArcVmExtensions]'} + } + + def __init__(self, *args, **kwargs): + super(ArcVmExtensionsPaged, self).__init__(*args, **kwargs) \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py new file mode 100644 index 00000000000..f54f2f2c7cf --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._galleryimages_operations import GalleryimagesOperations +from ._networkinterfaces_operations import NetworkinterfacesOperations +from ._operations import Operations +from ._virtualharddisks_operations import VirtualharddisksOperations +from ._virtualmachines_operations import VirtualmachinesOperations +from ._virtualnetworks_operations import VirtualnetworksOperations +from ._storagecontainers_operations import StoragecontainersOperations +from ._clusters_operations import ClustersOperations +from ._arc_vmextensions_operations import ArcVmExtensionsOperations + +__all__ = [ + 'GalleryimagesOperations', + 'NetworkinterfacesOperations', + 'Operations', + 'VirtualharddisksOperations', + 'VirtualmachinesOperations', + 'VirtualnetworksOperations', + 'StoragecontainersOperations', + 'ClustersOperations', + 'ArcVmExtensionsOperations' +] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py new file mode 100644 index 00000000000..3d6265775a0 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py @@ -0,0 +1,490 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +from . import VirtualmachinesOperations as vmops +from .. import models + +class ArcVmExtensionsOperations(object): + """ArcVmExtensionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + self.config = config + self.vmconfig = vmops(client, config, serializer, deserializer) + + def _create_initial( + self, resource_group_name, virtualmachine_name, name, extensionParameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(extensionParameters, 'ArcVmExtensions') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ArcVmExtensions', response) + if response.status_code == 201: + deserialized = self._deserialize('ArcVmExtensions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, virtualmachine_name, name, extensionParameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create the vm extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the vm extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :param extensionParameters: + :type extensionParameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the deserialized response + :param operation_config: :ref: `Operation configuration overrides`. + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ArcVmExtensions or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.ArcVmExtensions] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.ArcVmExtensions]] + :raises: :class:`ErrorResponseException` + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name, + extensionParameters=extensionParameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ArcVmExtensions', response) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + def _update_initial( + self, resource_group_name, virtualmachine_name, name, extension_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct paramaters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(extension_parameters, 'ArcVmExtensionsUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200,202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ArcVmExtensions', response) + if response.status_code == 202: + deserialized = self._deserialize('ArcVmExtensions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + + def update( + self, resource_group_name, virtualmachine_name, name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :param extension_parameters: Parameters supplied to the Create ArcVmExtension operation. + :type extension_parameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the deserialized response + :param operation_config: :ref: `Operation configuration overrides`. + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ArcVmExtensions or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.ArcVmExtensions] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.ArcVmExtensions]] + :raises: :class:`ErrorResponseException` + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + raw_result = self._update_initial( + resource_group_name=resource_group_name, + virtualmachine_name=virtualmachine_name, + name=name, + extension_parameters=extension_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ArcVmExtensions', response) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + def get( + self, resource_group_name, virtualmachine_name, name, custom_headers=None, raw=False, **operation_config): + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the deserialized response + :param operation_config: :ref: `Operation configuration overrides`. + :return: ArcVmExtensions or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.ArcVmExtensions or ~msrest.pipeline.ClientRawResponse + :raises: :class:`ErrorResponseException` + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ArcVmExtensions", response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + def delete( + self, resource_group_name, virtualmachine_name, name, custom_headers=None, raw=False, **operation_config): + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the extension. + :type virtualmachine_name: str + :param name: The name of the virtual machine extension. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the deserialized response + :param operation_config: :ref: `Operation configuration overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`ErrorResponseException` + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), + 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} + + def list_by_virtualmachine_name( + self, resource_group_name, virtualmachine_name, custom_headers=None, raw=False, **operation_config): + """The operation to list all the extensions by machine name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtualmachine_name: The name of the virtual machine containing the arcvmextension. + :type virtualmachine_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the deserialized response + :param operation_config: :ref: `Operation configuration overrides`. + :return: An iterator like instance of ArcVmExtensions + :rtype: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsPaged[~azure.mgmt.azurestackhci.models.ArcVmExtensions] + :raises: :class:`ErrorResponseException` + """ + + try: + self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) + self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) + except Exception as exception: + print("{} : {}".format(type(exception).__name__,exception)) + return + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_virtualmachine_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ArcVmExtensionsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return deserialized + list_by_virtualmachine_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions'} + + def _checkIfProvisionVmAgentEnabled( + self, resource_group_name, virtualmachine_name): + vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) + if vmObject.properties.os_profile.windows_configuration and vmObject.properties.os_profile.windows_configuration.provision_vm_agent == True: + return + else: + if vmObject.properties.os_profile.linux_configuration and vmObject.properties.os_profile.linux_configuration.provision_vm_agent == True: + return + raise Exception("Guest Management is not enabled for this virtual machine.") + + def _checkIfGuestVmAgentConnected( + self, resource_group_name, virtualmachine_name): + vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) + if vmObject.properties.guest_agent_profile: + if vmObject.properties.guest_agent_profile.status == models.Status.connected: + return + elif vmObject.properties.guest_agent_profile.status == models.Status.disconnected: + raise Exception("Guest Agent is currently disconnected.") + else: + error_detail = vmObject.properties.guest_agent_profile.error_details[-1] + error_code_and_message = error_detail.code + error_detail.message + raise Exception(error_code_and_message) + else: + raise Exception("Guest Agent is currently disconnected.") diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py new file mode 100644 index 00000000000..9453655810a --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py @@ -0,0 +1,432 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ClustersOperations(object): + """ClustersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all HCI clusters in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Cluster + :rtype: + ~azure.mgmt.azurestackhci.models.ClusterPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all HCI clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Cluster + :rtype: + ~azure.mgmt.azurestackhci.models.ClusterPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters'} + + def get( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Get HCI cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Cluster or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Cluster or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} + + def create( + self, resource_group_name, cluster_name, cluster, custom_headers=None, raw=False, **operation_config): + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param cluster: Details of the HCI cluster. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Cluster or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Cluster or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(cluster, 'Cluster') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} + + def update( + self, resource_group_name, cluster_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Cluster or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Cluster or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + cluster = models.ClusterUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(cluster, 'ClusterUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} + + def delete( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Delete an HCI cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py new file mode 100644 index 00000000000..9c666c5d9ed --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py @@ -0,0 +1,728 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class GalleryimagesOperations(object): + """GalleryimagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def retrieve( + self, resource_group_name, galleryimages_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Galleryimages or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Galleryimages or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.retrieve.metadata['galimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + # retry with marketplace gallery image resource type + url = self.retrieve.metadata['marketplacegalimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Galleryimages', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Galleryimages', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} + + def resourceTypeIsGalImage(self, resource_group_name, galleryimages_name, custom_headers=None, **operation_config): + url = self.resourceTypeIsGalImage.metadata['galimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + if response.status_code not in [200]: + return False + else: + return True + resourceTypeIsGalImage.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} + + + def _create_or_update_initial( + self, resource_group_name, galleryimages_name, galleryimages, custom_headers=None, raw=False, **operation_config): + # Construct URL + isMarketPlaceImage = False + url = self.create_or_update.metadata['galimageurl'] + if (galleryimages['properties']['identifier'] is not None): + url = self.create_or_update.metadata['marketplacegalimageurl'] + isMarketPlaceImage = True + + + path_format_arguments = {} + if isMarketPlaceImage: + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + else: + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + + body_content = self._serialize.body(galleryimages, 'Galleryimages') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Galleryimages', response) + if response.status_code == 201: + deserialized = self._deserialize('Galleryimages', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, galleryimages_name, galleryimages, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :param galleryimages: + :type galleryimages: ~azure.mgmt.azurestackhci.models.Galleryimages + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Galleryimages or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Galleryimages] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Galleryimages]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + galleryimages_name=galleryimages_name, + galleryimages=galleryimages, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Galleryimages', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} + + def delete( + self, resource_group_name, galleryimages_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + isGalImage = self.resourceTypeIsGalImage(resource_group_name, galleryimages_name, custom_headers, **operation_config) + url = self.update.metadata['galimageurl'] + path_format_arguments = {} + if isGalImage: + # Construct URL + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + else: + url = self.update.metadata['marketplacegalimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} + + def update( + self, resource_group_name, galleryimages_name, tags=None, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param galleryimages_name: + :type galleryimages_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Galleryimages or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Galleryimages or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + galleryimages = models.GalleryimagesPatch(tags=tags) + + isGalImage = self.resourceTypeIsGalImage(resource_group_name, galleryimages_name, custom_headers, **operation_config) + url = self.update.metadata['galimageurl'] + path_format_arguments = {} + if isGalImage: + # Construct URL + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + else: + url = self.update.metadata['marketplacegalimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) + } + + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(galleryimages, 'GalleryimagesPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Galleryimages', response) + if response.status_code == 202: + deserialized = self._deserialize('Galleryimages', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Galleryimages + :rtype: + ~azure.mgmt.azurestackhci.models.GalleryimagesPaged[~azure.mgmt.azurestackhci.models.Galleryimages] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + + url = self.list_by_resource_group.metadata['galimageurl'] + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + def prepare_request_marketplace(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['marketplacegalimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging_marketplace(next_link=None): + request = prepare_request_marketplace(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + + + + deserialzedGal = None + deserialzedMarketplace = None + noGalImages = False + noMarketplaceImages = False + galImageExcpetion = None + marketplaceGalImageException = None + + if raw: + header_dict = {} + try: + deserializedGal = models.GalleryimagesPaged(internal_paging, self._deserialize.dependencies, header_dict) + except Exception as e: + # try marketplace resource + noGalImages = True + galImageExcpetion = e + pass + + try: + deserializedMarketplace = models.GalleryimagesPaged(internal_paging_marketplace, self._deserialize.dependencies, header_dict) + except Exception as e: + # try marketplace resource + marketplaceGalImageException = e + noMarketplaceImages = True + pass + + if (not (noGalImages or noMarketplaceImages)): + allImages = list(deserializedGal) + list(deserializedMarketplace) + return allImages + elif (not noGalImages): + return deserializedGal + elif (not noMarketplaceImages): + return deserializedMarketplace + else: + raise galImageExcpetion + + return deserialized + list_by_resource_group.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """ + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Galleryimages + :rtype: + ~azure.mgmt.azurestackhci.models.GalleryimagesPaged[~azure.mgmt.azurestackhci.models.Galleryimages] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['galimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + def prepare_request_marketplace(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['marketplacegalimageurl'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging_marketplace(next_link=None): + request = prepare_request_marketplace(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + + deserialzedGal = None + deserialzedMarketplace = None + noGalImages = False + noMarketplaceImages = False + galImageExcpetion = None + marketplaceGalImageException = None + + if raw: + header_dict = {} + try: + deserializedGal = models.GalleryimagesPaged(internal_paging, self._deserialize.dependencies, header_dict) + except Exception as e: + # try marketplace resource + noGalImages = True + galImageExcpetion = e + pass + + try: + deserializedMarketplace = models.GalleryimagesPaged(internal_paging_marketplace, self._deserialize.dependencies, header_dict) + except Exception as e: + # try marketplace resource + marketplaceGalImageException = e + noMarketplaceImages = True + pass + + if ((not noGalImages) and not (noMarketplaceImages)): + allImages = list(deserializedGal) + list(deserializedMarketplace) + return allImages + elif (not noGalImages): + return deserializedGal + elif (not noMarketplaceImages): + return deserializedMarketplace + else: + raise galImageExcpetion + + + list_by_subscription.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryimages','marketplacegalimageurl': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py new file mode 100644 index 00000000000..7451122dc26 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py @@ -0,0 +1,470 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class NetworkinterfacesOperations(object): + """NetworkinterfacesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def retrieve( + self, resource_group_name, networkinterfaces_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Networkinterfaces or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Networkinterfaces or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.retrieve.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Networkinterfaces', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} + + + def _create_or_update_initial( + self, resource_group_name, networkinterfaces_name, networkinterfaces, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(networkinterfaces, 'Networkinterfaces') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Networkinterfaces', response) + if response.status_code == 201: + deserialized = self._deserialize('Networkinterfaces', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, networkinterfaces_name, networkinterfaces, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :param networkinterfaces: + :type networkinterfaces: + ~azure.mgmt.azurestackhci.models.Networkinterfaces + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Networkinterfaces or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Networkinterfaces] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Networkinterfaces]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + networkinterfaces_name=networkinterfaces_name, + networkinterfaces=networkinterfaces, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Networkinterfaces', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} + + def delete( + self, resource_group_name, networkinterfaces_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} + + def update( + self, resource_group_name, networkinterfaces_name, tags=None, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param networkinterfaces_name: + :type networkinterfaces_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Networkinterfaces or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Networkinterfaces or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + networkinterfaces = models.NetworkinterfacesPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(networkinterfaces, 'NetworkinterfacesPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Networkinterfaces', response) + if response.status_code == 202: + deserialized = self._deserialize('Networkinterfaces', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Networkinterfaces + :rtype: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPaged[~azure.mgmt.azurestackhci.models.Networkinterfaces] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.NetworkinterfacesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """ + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Networkinterfaces + :rtype: + ~azure.mgmt.azurestackhci.models.NetworkinterfacesPaged[~azure.mgmt.azurestackhci.models.Networkinterfaces] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.NetworkinterfacesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkinterfaces'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py new file mode 100644 index 00000000000..90640dfd943 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all available Microsoft.AzureStackHCI provider operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AvailableOperations or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.AvailableOperations or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AvailableOperations', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AzureStackHCI/operations'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py new file mode 100644 index 00000000000..bdb8f7d1221 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py @@ -0,0 +1,470 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class StoragecontainersOperations(object): + """StoragecontainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def retrieve( + self, resource_group_name, storagecontainers_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Storagecontainers or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Storagecontainers or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.retrieve.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Storagecontainers', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} + + + def _create_or_update_initial( + self, resource_group_name, storagecontainers_name, storagecontainers, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(storagecontainers, 'Storagecontainers') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Storagecontainers', response) + if response.status_code == 201: + deserialized = self._deserialize('Storagecontainers', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, storagecontainers_name, storagecontainers, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :param storagecontainers: + :type storagecontainers: + ~azure.mgmt.azurestackhci.models.Storagecontainers + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Storagecontainers or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Storagecontainers] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Storagecontainers]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + storagecontainers_name=storagecontainers_name, + storagecontainers=storagecontainers, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Storagecontainers', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} + + def delete( + self, resource_group_name, storagecontainers_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} + + def update( + self, resource_group_name, storagecontainers_name, tags=None, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storagecontainers_name: + :type storagecontainers_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Storagecontainers or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Storagecontainers or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + storagecontainers = models.StoragecontainersPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(storagecontainers, 'StoragecontainersPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Storagecontainers', response) + if response.status_code == 202: + deserialized = self._deserialize('Storagecontainers', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Storagecontainers + :rtype: + ~azure.mgmt.azurestackhci.models.StoragecontainersPaged[~azure.mgmt.azurestackhci.models.Storagecontainers] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.StoragecontainersPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """ + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Storagecontainers + :rtype: + ~azure.mgmt.azurestackhci.models.StoragecontainersPaged[~azure.mgmt.azurestackhci.models.Storagecontainers] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.StoragecontainersPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storagecontainers'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py new file mode 100644 index 00000000000..c3f16cf2dcc --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py @@ -0,0 +1,470 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualharddisksOperations(object): + """VirtualharddisksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def retrieve( + self, resource_group_name, virtualharddisks_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Virtualharddisks or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Virtualharddisks or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.retrieve.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Virtualharddisks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtualharddisks_name, virtualharddisks, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtualharddisks, 'Virtualharddisks') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Virtualharddisks', response) + if response.status_code == 201: + deserialized = self._deserialize('Virtualharddisks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtualharddisks_name, virtualharddisks, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :param virtualharddisks: + :type virtualharddisks: + ~azure.mgmt.azurestackhci.models.Virtualharddisks + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Virtualharddisks or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Virtualharddisks] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Virtualharddisks]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtualharddisks_name=virtualharddisks_name, + virtualharddisks=virtualharddisks, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Virtualharddisks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} + + def delete( + self, resource_group_name, virtualharddisks_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} + + def update( + self, resource_group_name, virtualharddisks_name, tags=None, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualharddisks_name: + :type virtualharddisks_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Virtualharddisks or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Virtualharddisks or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + virtualharddisks = models.VirtualharddisksPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtualharddisks, 'VirtualharddisksPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Virtualharddisks', response) + if response.status_code == 202: + deserialized = self._deserialize('Virtualharddisks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Virtualharddisks + :rtype: + ~azure.mgmt.azurestackhci.models.VirtualharddisksPaged[~azure.mgmt.azurestackhci.models.Virtualharddisks] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualharddisksPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """ + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Virtualharddisks + :rtype: + ~azure.mgmt.azurestackhci.models.VirtualharddisksPaged[~azure.mgmt.azurestackhci.models.Virtualharddisks] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualharddisksPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualharddisks'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py new file mode 100644 index 00000000000..8e37ff4ffa1 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py @@ -0,0 +1,816 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualmachinesOperations(object): + """VirtualmachinesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def retrieve( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Virtualmachines or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Virtualmachines or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.retrieve.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Virtualmachines', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtualmachines_name, virtualmachines, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtualmachines, 'Virtualmachines') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Virtualmachines', response) + if response.status_code == 201: + deserialized = self._deserialize('Virtualmachines', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtualmachines_name, virtualmachines, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param virtualmachines: + :type virtualmachines: + ~azure.mgmt.azurestackhci.models.Virtualmachines + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Virtualmachines or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Virtualmachines] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Virtualmachines]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtualmachines_name=virtualmachines_name, + virtualmachines=virtualmachines, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Virtualmachines', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} + + def delete( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} + + def update( + self, resource_group_name, virtualmachines_name, properties=None, tags=None, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param properties: + :type properties: + ~azure.mgmt.azurestackhci.models.VirtualMachineUpdateProperties + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Virtualmachines or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Virtualmachines or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + virtualmachines = models.VirtualmachinesPatch(properties=properties, tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtualmachines, 'VirtualmachinesPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + deserialized = self._deserialize('Virtualmachines', response) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, response, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} + + + def _start_initial( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + virtualmachines_name=virtualmachines_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/start'} + + + def _stop_initial( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + virtualmachines_name=virtualmachines_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/stop'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Virtualmachines + :rtype: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPaged[~azure.mgmt.azurestackhci.models.Virtualmachines] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualmachinesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """ + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Virtualmachines + :rtype: + ~azure.mgmt.azurestackhci.models.VirtualmachinesPaged[~azure.mgmt.azurestackhci.models.Virtualmachines] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualmachinesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualmachines'} + + # def restart( + # self, + # resource_group_name, # type: str + # virtualmachines_name, # type: str + # **kwargs # type: Any + # ): + # # type: (...) -> None + # """stop. + + # :param resource_group_name: The name of the resource group. The name is case insensitive. + # :type resource_group_name: str + # :param virtualmachines_name: + # :type virtualmachines_name: str + # :keyword callable cls: A custom type or function that will be passed the direct response + # :return: None, or the result of cls(response) + # :rtype: None + # :raises: ~azure.core.exceptions.HttpResponseError + # """ + # cls = kwargs.pop('cls', None) # type: ClsType[None] + # error_map = { + # 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + # } + # error_map.update(kwargs.pop('error_map', {})) + # # api_version = "2020-11-01-preview" + # api_version = "2021-07-01-preview" + # accept = "application/json" + + # # Construct URL + # url = self.restart.metadata['url'] # type: ignore + # path_format_arguments = { + # 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + # 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + # 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), + # } + # url = self._client.format_url(url, **path_format_arguments) + + # # Construct parameters + # query_parameters = {} # type: Dict[str, Any] + # query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # # Construct headers + # header_parameters = {} # type: Dict[str, Any] + # header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + # request = self._client.post(url, query_parameters, header_parameters) + # pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + # response = pipeline_response.http_response + + # if response.status_code not in [200, 202]: + # map_error(status_code=response.status_code, response=response, error_map=error_map) + # error = self._deserialize(models.ErrorResponse, response) + # raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + # if cls: + # return cls(pipeline_response, None, {}) + + # restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/restart'} # type: ignor + + def _restart_initial( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restart.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def restart( + self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, polling=True, **operation_config): + """restart + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualmachines_name: + :type virtualmachines_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + virtualmachines_name=virtualmachines_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/restart'} + + + def add_vnic( + self, + resource_group_name, # type: str + virtualmachines_name, # type: str + vnic_names, # type: List[str] + **kwargs # type: Any + ): + virtualmachines = self.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name) + serialized = self._serialize.body(virtualmachines, 'VirtualMachines') + serialized.pop('provisioningState', None) + properties = serialized.get('properties', dict()) + networkProfile = properties.get('networkProfile', dict()) + networkInterfaces = networkProfile.get('networkInterfaces', list()) + for name in vnic_names: + networkInterfaces.append({'id': name}) + networkProfile['networkInterfaces'] = networkInterfaces + properties['networkProfile'] = networkProfile + serialized['properties'] = properties + return self.create_or_update(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name, virtualmachines=serialized) + add_vnic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore + + def remove_vnic( + self, + resource_group_name, # type: str + virtualmachines_name, # type: str + vnic_names, # type: List[str] + **kwargs # type: Any + ): + virtualmachines = self.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name) + serialized = self._serialize.body(virtualmachines, 'VirtualMachines') + serialized.pop('provisioningState', None) + properties = serialized.get('properties', dict()) + networkProfile = properties.get('networkProfile', dict()) + networkInterfaces = networkProfile.get('networkInterfaces', list()) + vnics_to_be_removed = set(vnic_names) + new_networkInterfaces = [] + for nic in networkInterfaces: + if nic.get('id') in vnics_to_be_removed: + continue + new_networkInterfaces.append(nic) + networkProfile['networkInterfaces'] = new_networkInterfaces + properties['networkProfile'] = networkProfile + serialized['properties'] = properties + return self.create_or_update(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name, virtualmachines=serialized) + remove_vnic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py new file mode 100644 index 00000000000..8b0a6a5cb51 --- /dev/null +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py @@ -0,0 +1,470 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualnetworksOperations(object): + """VirtualnetworksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2022-12-15-preview" + + self.config = config + + def retrieve( + self, resource_group_name, virtualnetworks_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Virtualnetworks or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Virtualnetworks or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.retrieve.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Virtualnetworks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtualnetworks_name, virtualnetworks, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtualnetworks, 'Virtualnetworks') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Virtualnetworks', response) + if response.status_code == 201: + deserialized = self._deserialize('Virtualnetworks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtualnetworks_name, virtualnetworks, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :param virtualnetworks: + :type virtualnetworks: + ~azure.mgmt.azurestackhci.models.Virtualnetworks + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Virtualnetworks or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Virtualnetworks] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Virtualnetworks]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtualnetworks_name=virtualnetworks_name, + virtualnetworks=virtualnetworks, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Virtualnetworks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} + + def delete( + self, resource_group_name, virtualnetworks_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + polling_method = ARMPolling(lro_delay, **operation_config) + return LROPoller(self._client, response, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} + + def update( + self, resource_group_name, virtualnetworks_name, tags=None, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param virtualnetworks_name: + :type virtualnetworks_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Virtualnetworks or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestackhci.models.Virtualnetworks or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + virtualnetworks = models.VirtualnetworksPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtualnetworks, 'VirtualnetworksPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Virtualnetworks', response) + if response.status_code == 202: + deserialized = self._deserialize('Virtualnetworks', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """ + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Virtualnetworks + :rtype: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPaged[~azure.mgmt.azurestackhci.models.Virtualnetworks] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualnetworksPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """ + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Virtualnetworks + :rtype: + ~azure.mgmt.azurestackhci.models.VirtualnetworksPaged[~azure.mgmt.azurestackhci.models.Virtualnetworks] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualnetworksPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualnetworks'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py similarity index 50% rename from src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py rename to src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py index 9fa7324972a..0ec2fae7a62 100644 --- a/src/stack-hci-vm/azext_stack_hci_vm/aaz/latest/stack_hci/cluster/identity/__init__.py +++ b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py @@ -1,13 +1,13 @@ -# -------------------------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. +# Licensed under the MIT License. See License.txt in the project root for +# license information. # -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- -# pylint: skip-file -# flake8: noqa +VERSION = "2020-11-01-preview" -from .__cmd_group import * -from ._assign import * -from ._remove import * diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json b/src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json deleted file mode 100644 index c91b1a720cc..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "azext.minCliCoreVersion": "2.50.0" -} \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/commands.py b/src/stack-hci-vm/azext_stack_hci_vm/commands.py deleted file mode 100644 index df961c762cd..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/commands.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: disable=too-many-lines -# pylint: disable=too-many-statements - -# from azure.cli.core.commands import CliCommandType - - -def load_command_table(self, _): # pylint: disable=unused-argument - - with self.command_group('stack-hci-vm cluster'): - from azext_stack_hci.custom import ClusterList, ClusterCreate, IdentityAssign, IdentityRemove - self.command_table['stack-hci-vm cluster list'] = ClusterList(loader=self) - self.command_table['stack-hci-vm cluster create'] = ClusterCreate(loader=self) - self.command_table['stack-hci-vm cluster identity assign'] = IdentityAssign(loader=self) - self.command_table['stack-hci-vm cluster identity remove'] = IdentityRemove(loader=self) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/custom.py b/src/stack-hci-vm/azext_stack_hci_vm/custom.py deleted file mode 100644 index c59c1778af3..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/custom.py +++ /dev/null @@ -1,77 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: disable=too-many-lines -# pylint: disable=too-many-statements, protected-access -from azext_stack_hci.aaz.latest.stack_hci.cluster import List as _ClusterList -from azext_stack_hci.aaz.latest.stack_hci.cluster import Create as _ClusterCreate -from azext_stack_hci.aaz.latest.stack_hci.cluster.identity import Assign as _IdentityAssign -from azext_stack_hci.aaz.latest.stack_hci.cluster.identity import Remove as _IdentityRemove - - -class ClusterList(_ClusterList): - def post_operations(self): - # next_link cannot be accessed - if self.ctx.vars.instance.next_link.to_serialized_data(): - self.ctx.vars.instance.next_link = None - - -class ClusterCreate(_ClusterCreate): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZBoolArg - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.mi_system_assigned = AAZBoolArg( - options=["--mi-system-assigned"], - help="Enable system assigned identity" - ) - args_schema.identity._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if args.mi_system_assigned: - args.identity.type = "SystemAssigned" - - -class IdentityAssign(_IdentityAssign): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZBoolArg - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.system_assigned = AAZBoolArg( - options=["--system-assigned"], - help="Enable system assigned identity" - ) - args_schema.type._registered = False - args_schema.type._required = False - args_schema.user_assigned_identities._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if args.system_assigned: - args.type = "SystemAssigned" - - -class IdentityRemove(_IdentityRemove): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZBoolArg - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.system_assigned = AAZBoolArg( - options=["--system-assigned"], - help="Enable system assigned identity" - ) - args_schema.type._registered = False - args_schema.user_assigned_identities._registered = False - return args_schema - - def pre_instance_update(self, instance): - args = self.ctx.args - if args.system_assigned: - args.type = 'None' diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml deleted file mode 100644 index 214c9ee47de..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_arc_setting_crud.yaml +++ /dev/null @@ -1,771 +0,0 @@ -interactions: - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 - method: GET - uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000003%27%29 - response: - body: - string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' - headers: - cache-control: - - no-cache - content-length: - - "87" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Mon, 29 May 2023 08:57:46 GMT - odata-version: - - "4.0" - request-id: - - 1bed73da-5a5d-4bae-b13d-03ef55b28ca5 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"SI2PEPF00000BC4"}}' - x-ms-resource-unit: - - "2" - status: - code: 200 - message: OK - - request: - body: '{"displayName": "app000003", "keyCredentials": []}' - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - Content-Length: - - "50" - Content-Type: - - application/json - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 - method: POST - uri: https://graph.microsoft.com/v1.0/applications - response: - body: - string: - '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", - "id": "9d59b3c9-1099-4598-8124-527d26e6a19a", "deletedDateTime": null, "appId": - "a5934ecc-a01a-480b-90c8-2263be2885f7", "applicationTemplateId": null, "disabledByMicrosoftStatus": - null, "createdDateTime": "2023-05-29T08:57:47.2444123Z", "displayName": "app000003", - "description": null, "groupMembershipClaims": null, "identifierUris": [], - "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": - null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": - null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], - "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": - null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": - null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": - null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": - [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": - null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, - "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": - {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": - [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": - {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, - "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": - {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": - []}, "spa": {"redirectUris": []}}' - headers: - cache-control: - - no-cache - content-length: - - "1717" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Mon, 29 May 2023 08:57:51 GMT - location: - - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/9d59b3c9-1099-4598-8124-527d26e6a19a/Microsoft.DirectoryServices.Application - odata-version: - - "4.0" - request-id: - - 8fe495c5-6cde-4327-b7a0-587964efe863 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"SI2PEPF00001640"}}' - x-ms-resource-unit: - - "1" - status: - code: 201 - message: Created - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_arc_setting000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001","name":"cli_test_stack_hci_arc_setting000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_arc_setting_crud","date":"2023-05-29T08:57:39Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - "412" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:57:51 GMT - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: - '{"location": "eastus", "properties": {"aadClientId": "a5934ecc-a01a-480b-90c8-2263be2885f7", - "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - Content-Length: - - "148" - Content-Type: - - application/json - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-05-29T08:57:55.9188585Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-05-29T08:57:55.9188585Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"6e333549-147d-4ec2-915a-d71da3b1ab70","aadClientId":"a5934ecc-a01a-480b-90c8-2263be2885f7","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1091" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:57:57 GMT - etag: - - '"1100988c-0000-0100-0000-647469150000"' - expires: - - "-1" - mise-correlation-id: - - 21afe15c-2572-423d-9f44-0fbb51175557 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: "{}" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting create - Connection: - - keep-alive - Content-Length: - - "2" - Content-Type: - - application/json - ParameterSetName: - - -n -g --cluster-name - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-05-29T08:57:59.5118167Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-05-29T08:57:59.5118167Z"},"properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","defaultExtensions":[{"category":"ProductQualityAndSupport"}]}}' - headers: - cache-control: - - no-cache - content-length: - - "781" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:00 GMT - etag: - - '"b0004831-0000-0100-0000-647469180000"' - expires: - - "-1" - mise-correlation-id: - - 1100563b-9d91-4111-ab4c-9cd4b6be56f2 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting create-identity - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -n --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/createArcIdentity?api-version=2023-03-01 - response: - body: - string: "null" - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - cache-control: - - no-cache - content-length: - - "4" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:03 GMT - expires: - - "-1" - location: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - mise-correlation-id: - - 0d208147-8b77-4dcf-a7b5-3aed4b6b80ca - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting create-identity - Connection: - - keep-alive - ParameterSetName: - - -n --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","name":"39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","status":"Accepted","startTime":"2023-05-29T08:58:03.8056473Z"}' - headers: - cache-control: - - no-cache - content-length: - - "550" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:03 GMT - etag: - - '"37002f59-0000-0100-0000-6474691b0000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting create-identity - Connection: - - keep-alive - ParameterSetName: - - -n --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","name":"39c6460f-844d-4074-9303-29c22f87ebdc*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","status":"Succeeded","startTime":"2023-05-29T08:58:03.8056473Z","endTime":"2023-05-29T08:58:09.8717017Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - "610" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:34 GMT - etag: - - '"37003459-0000-0100-0000-647469210000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting consent-and-install-default-extension - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -g --arc-setting-name --cluster-name - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/consentAndInstallDefaultExtensions?api-version=2023-03-01 - response: - body: - string: '{"properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","arcApplicationTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","arcApplicationClientId":"4cd5b949-138b-426e-8f07-0fe2c79f596e","arcApplicationObjectId":"fb68accd-3ee0-46d7-acf7-4fa0749eda2d","arcServicePrincipalObjectId":"16a9a3f4-7b38-4621-b04d-d9e37d015dcf","defaultExtensions":[{"category":"ProductQualityAndSupport","consentTime":"2023-05-29T08:58:36.4965053Z"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings"}' - headers: - cache-control: - - no-cache - content-length: - - "843" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:36 GMT - expires: - - "-1" - mise-correlation-id: - - 1a25070d-4d73-448b-b37a-ab73a8c55a2a - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting initialize-disable-proces - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -g --arc-setting-name --cluster-name - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/initializeDisableProcess?api-version=2023-03-01 - response: - body: - string: "null" - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - cache-control: - - no-cache - content-length: - - "4" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:38 GMT - expires: - - "-1" - location: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - mise-correlation-id: - - c1140600-f82c-4f51-8a1e-c55870ea035d - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting initialize-disable-proces - Connection: - - keep-alive - ParameterSetName: - - -g --arc-setting-name --cluster-name - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","name":"cb465969-8c09-455e-ad04-39c37fe2276c*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","status":"Succeeded","startTime":"2023-05-29T08:58:38.7683478Z","endTime":"2023-05-29T08:58:38.8985219Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - "610" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:39 GMT - etag: - - '"37005c59-0000-0100-0000-6474693e0000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting list - Connection: - - keep-alive - ParameterSetName: - - -g --cluster-name - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings?api-version=2023-03-01 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","perNodeDetails":[],"arcApplicationTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","arcApplicationClientId":"4cd5b949-138b-426e-8f07-0fe2c79f596e","arcApplicationObjectId":"fb68accd-3ee0-46d7-acf7-4fa0749eda2d","arcServicePrincipalObjectId":"16a9a3f4-7b38-4621-b04d-d9e37d015dcf","defaultExtensions":[{"category":"ProductQualityAndSupport","consentTime":"2023-05-29T08:58:36.4965053Z"}]}}]}' - headers: - cache-control: - - no-cache - content-length: - - "875" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:39 GMT - expires: - - "-1" - mise-correlation-id: - - faa6bfd7-9be3-41a0-8023-b63f3878599b - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting show - Connection: - - keep-alive - ParameterSetName: - - -n -g --cluster-name - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","properties":{"connectivityProperties":{"enabled":false},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-6e333549-147d-4ec2-915a-d71da3b1ab70-Arc-Infra-RG","aggregateState":"NotSpecified","perNodeDetails":[],"arcApplicationTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","arcApplicationClientId":"4cd5b949-138b-426e-8f07-0fe2c79f596e","arcApplicationObjectId":"fb68accd-3ee0-46d7-acf7-4fa0749eda2d","arcServicePrincipalObjectId":"16a9a3f4-7b38-4621-b04d-d9e37d015dcf","defaultExtensions":[{"category":"ProductQualityAndSupport","consentTime":"2023-05-29T08:58:36.4965053Z"}]}}' - headers: - cache-control: - - no-cache - content-length: - - "863" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:41 GMT - etag: - - '"b000f931-0000-0100-0000-6474693c0000"' - expires: - - "-1" - mise-correlation-id: - - 86386ed0-7a4e-441f-bf73-5a6754ed552e - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting generate-password - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -n --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/generatePassword?api-version=2023-03-01 - response: - body: - string: '{"secretText":"vKU8Q~7Zj3fEvgui66-EWnhh8bHlfCjT2wXYGbqM","startDateTime":"2023-05-29T08:58:43.6841781+00:00","endDateTime":"2025-05-29T08:58:43.6841782+00:00","keyId":"b4b5d17b-411d-42fa-bff0-57e8f85eaaa3"}' - headers: - cache-control: - - no-cache - content-length: - - "206" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:43 GMT - expires: - - "-1" - mise-correlation-id: - - 715bbb9d-f157-4118-b8aa-fbe14bcf657c - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting delete - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -n -g --cluster-name --no-wait --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_arc_setting000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 - response: - body: - string: "null" - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/5eaf5a98-695a-438a-bbbe-bb96457fb0d3*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - cache-control: - - no-cache - content-length: - - "4" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 29 May 2023 08:58:46 GMT - etag: - - '"b0001d32-0000-0100-0000-647469460000"' - expires: - - "-1" - location: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/5eaf5a98-695a-438a-bbbe-bb96457fb0d3*93D996766DEFBFCB6BFE7943244B1E8B000F4112D0CB9926B40CCFC643F777EB?api-version=2023-03-01 - mise-correlation-id: - - 23f42d0d-0776-4433-a206-d4e4808e8960 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-deletes: - - "14999" - status: - code: 202 - message: Accepted -version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml deleted file mode 100644 index e853b4db356..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_crud.yaml +++ /dev/null @@ -1,894 +0,0 @@ -interactions: - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 - method: GET - uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000003%27%29 - response: - body: - string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' - headers: - cache-control: - - no-cache - content-length: - - "87" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Thu, 01 Jun 2023 02:57:28 GMT - odata-version: - - "4.0" - request-id: - - 454ccc3e-9d4f-4cef-9817-e9081f76ab6e - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Japan East","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"TY1PEPF0000604C"}}' - x-ms-resource-unit: - - "2" - status: - code: 200 - message: OK - - request: - body: '{"displayName": "app000003", "keyCredentials": []}' - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - Content-Length: - - "50" - Content-Type: - - application/json - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 - method: POST - uri: https://graph.microsoft.com/v1.0/applications - response: - body: - string: - '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", - "id": "dd60e7e1-4023-4714-8c97-10b879ee6bf6", "deletedDateTime": null, "appId": - "999b5f21-41f6-4357-8fc1-86fe171f8024", "applicationTemplateId": null, "disabledByMicrosoftStatus": - null, "createdDateTime": "2023-06-01T02:57:30.0436864Z", "displayName": "app000003", - "description": null, "groupMembershipClaims": null, "identifierUris": [], - "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": - null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": - null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], - "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": - null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": - null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": - null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": - [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": - null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, - "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": - {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": - [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": - {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, - "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": - {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": - []}, "spa": {"redirectUris": []}}' - headers: - cache-control: - - no-cache - content-length: - - "1717" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Thu, 01 Jun 2023 02:57:30 GMT - location: - - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/dd60e7e1-4023-4714-8c97-10b879ee6bf6/Microsoft.DirectoryServices.Application - odata-version: - - "4.0" - request-id: - - ee62b343-0357-40c4-b0fb-048eb5415908 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Japan East","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"TY1PEPF00006059"}}' - x-ms-resource-unit: - - "1" - status: - code: 201 - message: Created - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_cluster000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001","name":"cli_test_stack_hci_cluster000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_cluster_crud","date":"2023-06-01T02:57:23Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - "400" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:57:31 GMT - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: - '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": - {"aadClientId": "999b5f21-41f6-4357-8fc1-86fe171f8024", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}, - "tags": {"key0": "value0"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - Content-Length: - - "216" - Content-Type: - - application/json - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T02:57:35.1143798Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T02:57:35.1143798Z"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"999b5f21-41f6-4357-8fc1-86fe171f8024","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1252" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:57:38 GMT - etag: - - '"1100c6e7-0000-0100-0000-647809210000"' - expires: - - "-1" - mise-correlation-id: - - f0266864-8d55-4f31-bdc1-71de6d7f1479 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create-identity - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/createClusterIdentity?api-version=2023-03-01 - response: - body: - string: "null" - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - cache-control: - - no-cache - content-length: - - "4" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:57:39 GMT - expires: - - "-1" - location: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - mise-correlation-id: - - 4b6301b1-3932-4491-b396-584d51eb606c - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create-identity - Connection: - - keep-alive - ParameterSetName: - - --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Accepted","startTime":"2023-06-01T02:57:40.5133087Z"}' - headers: - cache-control: - - no-cache - content-length: - - "526" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:57:40 GMT - etag: - - '"4300df2b-0000-0100-0000-647809240000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create-identity - Connection: - - keep-alive - ParameterSetName: - - --cluster-name -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"05a601ea-5a1d-4491-a401-697f24989501*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Succeeded","startTime":"2023-06-01T02:57:40.5133087Z","endTime":"2023-06-01T02:57:42.8906594Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - "586" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:11 GMT - etag: - - '"4300ee2b-0000-0100-0000-647809260000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster list - Connection: - - keep-alive - ParameterSetName: - - -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters?api-version=2023-03-01 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}]}' - headers: - cache-control: - - no-cache - content-length: - - "1153" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:14 GMT - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-original-request-ids: - - 7fccb38e-9b1e-4694-8559-85d56be7c2d4 - - c6f39ed1-9cbb-4be5-a0ce-7cddd07814f6 - - 51ce5ccb-e600-4219-8de0-0ca99c30551d - - 65d4017b-aeb4-4e72-ba26-50c21da8d2a6 - - 916961d9-cba7-489a-82e7-a2a5e8772284 - - 9b893e4d-e77d-4704-9f06-5d04d99d6e05 - - 26b7f6f6-5f80-43c4-b8ab-63a0b76233ce - - 3c1e8971-f190-485b-9a54-62bb74e4c4ea - - 4d97dd7a-bc0c-4e5d-aec5-58b2d6a60519 - - da04ba3b-4a1f-4a55-87cf-cb86f644016f - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster update - Connection: - - keep-alive - ParameterSetName: - - -n -g --tags - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1141" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:15 GMT - etag: - - '"1100c7e7-0000-0100-0000-647809260000"' - expires: - - "-1" - mise-correlation-id: - - 91fef0e2-8a2e-4bfe-bb29-ef4aecdec127 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: - '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": - {"aadApplicationObjectId": "2e404a96-2452-4490-a1a8-daa2eb03a2a6", "aadClientId": - "59a00546-885a-46b1-a01a-f7b8ea0b51a1", "aadServicePrincipalObjectId": "93b58b7d-cd78-4c57-b9f9-749f7b7ae989", - "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "desiredProperties": - {"diagnosticLevel": "Basic", "windowsServerSubscription": "Disabled"}, "softwareAssuranceProperties": - {"softwareAssuranceIntent": "Disable", "softwareAssuranceStatus": "Disabled"}}, - "tags": {"key0": "value1"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster update - Connection: - - keep-alive - Content-Length: - - "555" - Content-Type: - - application/json - ParameterSetName: - - -n -g --tags - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value1"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T02:57:35.1143798Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T02:58:16.6568224Z"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1385" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:19 GMT - etag: - - '"1100c8e7-0000-0100-0000-647809490000"' - expires: - - "-1" - mise-correlation-id: - - 72ab32e6-4461-43c9-85d7-361efad360f1 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster show - Connection: - - keep-alive - ParameterSetName: - - -n -g - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value1"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1141" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:20 GMT - etag: - - '"1100c8e7-0000-0100-0000-647809490000"' - expires: - - "-1" - mise-correlation-id: - - 3cc78b67-a8a3-4e10-acda-03ebfcc6c82e - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster show - Connection: - - keep-alive - ParameterSetName: - - --ids - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value1"},"identity":{"principalId":"60e0fd81-77c8-4bf3-8b58-283232361147","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"23e80211-eb9e-417c-b786-b8cb3eed78d1","aadClientId":"59a00546-885a-46b1-a01a-f7b8ea0b51a1","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","aadServicePrincipalObjectId":"93b58b7d-cd78-4c57-b9f9-749f7b7ae989","aadApplicationObjectId":"2e404a96-2452-4490-a1a8-daa2eb03a2a6","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1141" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:22 GMT - etag: - - '"1100c8e7-0000-0100-0000-647809490000"' - expires: - - "-1" - mise-correlation-id: - - 9dbe8a0b-f657-4805-9fcd-89136f01d150 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster delete - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -n -g --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: "null" - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - cache-control: - - no-cache - content-length: - - "4" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:23 GMT - etag: - - '"1100c9e7-0000-0100-0000-647809500000"' - expires: - - "-1" - location: - - https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-deletes: - - "14999" - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster delete - Connection: - - keep-alive - ParameterSetName: - - -n -g --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' - headers: - cache-control: - - no-cache - content-length: - - "526" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:25 GMT - etag: - - '"4300302d-0000-0100-0000-647809500000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster delete - Connection: - - keep-alive - ParameterSetName: - - -n -g --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' - headers: - cache-control: - - no-cache - content-length: - - "526" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:58:55 GMT - etag: - - '"4300302d-0000-0100-0000-647809500000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster delete - Connection: - - keep-alive - ParameterSetName: - - -n -g --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' - headers: - cache-control: - - no-cache - content-length: - - "526" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:59:25 GMT - etag: - - '"4300302d-0000-0100-0000-647809500000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster delete - Connection: - - keep-alive - ParameterSetName: - - -n -g --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Deleting","startTime":"2023-06-01T02:58:24.4957878Z"}' - headers: - cache-control: - - no-cache - content-length: - - "526" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 02:59:55 GMT - etag: - - '"4300302d-0000-0100-0000-647809500000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster delete - Connection: - - keep-alive - ParameterSetName: - - -n -g --yes - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D?api-version=2023-03-01 - response: - body: - string: '{"id":"/providers/Microsoft.AzureStackHCI/locations/EASTUS/operationStatuses/49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","name":"49ebae0c-aaaf-463a-b3b2-0006bee9de0f*D70C66C9A09AFECEC6CEEBAD8EAEE1DD8ED3AC4A16B8FCCAFB37EBDC2692F97D","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","status":"Succeeded","startTime":"2023-06-01T02:58:24.4957878Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - "545" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 03:00:26 GMT - etag: - - '"5000a4a8-0000-0800-0000-647809b20000"' - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml deleted file mode 100644 index d8ae5c23a22..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_cluster_identity.yaml +++ /dev/null @@ -1,544 +0,0 @@ -interactions: - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 - method: GET - uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000004%27%29 - response: - body: - string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' - headers: - cache-control: - - no-cache - content-length: - - "87" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:29 GMT - odata-version: - - "4.0" - request-id: - - 09900153-ad2f-4105-94e0-4374298377f1 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"SG1PEPF000066F9"}}' - x-ms-resource-unit: - - "2" - status: - code: 200 - message: OK - - request: - body: '{"displayName": "app000004", "keyCredentials": []}' - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - Content-Length: - - "50" - Content-Type: - - application/json - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.48.1 - method: POST - uri: https://graph.microsoft.com/v1.0/applications - response: - body: - string: - '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", - "id": "f844340b-7526-46b3-92e4-34654be18046", "deletedDateTime": null, "appId": - "9a3a3aa8-cd35-4d65-950d-3682e61be381", "applicationTemplateId": null, "disabledByMicrosoftStatus": - null, "createdDateTime": "2023-06-01T09:54:29.9196249Z", "displayName": "app000004", - "description": null, "groupMembershipClaims": null, "identifierUris": [], - "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": - null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": - null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], - "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": - null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": - null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": - null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": - [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": - null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, - "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": - {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": - [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": - {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, - "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": - {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": - []}, "spa": {"redirectUris": []}}' - headers: - cache-control: - - no-cache - content-length: - - "1717" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:31 GMT - location: - - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/f844340b-7526-46b3-92e4-34654be18046/Microsoft.DirectoryServices.Application - odata-version: - - "4.0" - request-id: - - 6ae4936d-1b8a-4f85-af3f-fb164177d39c - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"SG1PEPF00006137"}}' - x-ms-resource-unit: - - "1" - status: - code: 201 - message: Created - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_cluster000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001","name":"cli_test_stack_hci_cluster000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_cluster_identity","date":"2023-06-01T09:54:25Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - "404" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:31 GMT - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: - '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": - {"aadClientId": "9a3a3aa8-cd35-4d65-950d-3682e61be381", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}, - "tags": {"key0": "value0"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - Content-Length: - - "216" - Content-Type: - - application/json - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id --tags --mi-system-assigned - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","tags":{"key0":"value0"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:36.0575373Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:36.0575373Z"},"identity":{"principalId":"d1e6eee7-ff34-4713-bb5f-caf4f2007206","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"0294a950-b673-4cd3-aed2-607e7237d06a","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1252" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:39 GMT - etag: - - '"1100d7ef-0000-0100-0000-64786add0000"' - expires: - - "-1" - mise-correlation-id: - - f6a0920f-c270-4351-a7d6-94689330e3a7 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_cluster000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001","name":"cli_test_stack_hci_cluster000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_cluster_identity","date":"2023-06-01T09:54:25Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - "404" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:39 GMT - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: - '{"location": "eastus", "properties": {"aadClientId": "9a3a3aa8-cd35-4d65-950d-3682e61be381", - "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - Content-Length: - - "148" - Content-Type: - - application/json - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:44.0894892Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:44.0894892Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1087" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:46 GMT - etag: - - '"1100d9ef-0000-0100-0000-64786ae50000"' - expires: - - "-1" - mise-correlation-id: - - 96b11de5-aa99-448a-b115-15966624d03a - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster identity assign - Connection: - - keep-alive - ParameterSetName: - - --cluster-name -g --system-assigned - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "843" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:48 GMT - etag: - - '"1100d9ef-0000-0100-0000-64786ae50000"' - expires: - - "-1" - mise-correlation-id: - - 1d5b0ce4-65b2-492d-8f99-7073768ac5de - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: - '{"identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": - {"aadClientId": "9a3a3aa8-cd35-4d65-950d-3682e61be381", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", - "desiredProperties": {"diagnosticLevel": "Basic", "windowsServerSubscription": - "Disabled"}, "softwareAssuranceProperties": {"softwareAssuranceIntent": "Disable", - "softwareAssuranceStatus": "Disabled"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster identity assign - Connection: - - keep-alive - Content-Length: - - "390" - Content-Type: - - application/json - ParameterSetName: - - --cluster-name -g --system-assigned - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:44.0894892Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:49.168997Z"},"identity":{"principalId":"cd7610a9-0d16-4153-aa78-0915dc5af0e1","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1226" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:53 GMT - etag: - - '"1100daef-0000-0100-0000-64786aea0000"' - expires: - - "-1" - mise-correlation-id: - - 596e8b1e-3a3c-4424-aef2-93855c32183c - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster identity remove - Connection: - - keep-alive - ParameterSetName: - - --cluster-name -g --system-assigned - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","identity":{"principalId":"cd7610a9-0d16-4153-aa78-0915dc5af0e1","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "983" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:54:55 GMT - etag: - - '"1100daef-0000-0100-0000-64786aea0000"' - expires: - - "-1" - mise-correlation-id: - - fb397559-72ab-44bf-b3ae-13b6227820d5 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: - '{"identity": {"type": "None"}, "location": "eastus", "properties": {"aadClientId": - "9a3a3aa8-cd35-4d65-950d-3682e61be381", "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", - "desiredProperties": {"diagnosticLevel": "Basic", "windowsServerSubscription": - "Disabled"}, "softwareAssuranceProperties": {"softwareAssuranceIntent": "Disable", - "softwareAssuranceStatus": "Disabled"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster identity remove - Connection: - - keep-alive - Content-Length: - - "380" - Content-Type: - - application/json - ParameterSetName: - - --cluster-name -g --system-assigned - User-Agent: - - AZURECLI/2.48.1 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_cluster000001/providers/Microsoft.AzureStackHCI/clusters/cluster000003","name":"cluster000003","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-06-01T09:54:44.0894892Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-06-01T09:54:56.1247294Z"},"identity":{"type":"None"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"b67d0906-fb1e-402e-b5ea-8bcadaf928b0","aadClientId":"9a3a3aa8-cd35-4d65-950d-3682e61be381","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1114" - content-type: - - application/json; charset=utf-8 - date: - - Thu, 01 Jun 2023 09:55:00 GMT - etag: - - '"1100dbef-0000-0100-0000-64786af10000"' - expires: - - "-1" - mise-correlation-id: - - 46dbae79-a5d4-4b86-a509-5145f7dbb46f - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK -version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml deleted file mode 100644 index b82ed9e2d6f..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/recordings/test_stack_hci_extension_crud.yaml +++ /dev/null @@ -1,481 +0,0 @@ -interactions: - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.51.0 - method: GET - uri: https://graph.microsoft.com/v1.0/applications?$filter=startswith%28displayName%2C%27app000003%27%29 - response: - body: - string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#applications","value":[]}' - headers: - cache-control: - - no-cache - content-length: - - "87" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:05 GMT - odata-version: - - "4.0" - request-id: - - 910d2be5-1df4-46ce-842d-8868f28f8fef - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"SI1PEPF0001104C"}}' - x-ms-resource-unit: - - "2" - status: - code: 200 - message: OK - - request: - body: '{"displayName": "app000003", "keyCredentials": []}' - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - ad app create - Connection: - - keep-alive - Content-Length: - - "50" - Content-Type: - - application/json - ParameterSetName: - - --display-name - User-Agent: - - python/3.10.9 (Windows-10-10.0.22621-SP0) AZURECLI/2.51.0 - method: POST - uri: https://graph.microsoft.com/v1.0/applications - response: - body: - string: - '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity", - "id": "f550ce24-074d-4a8e-b811-096bb4a060c6", "deletedDateTime": null, "appId": - "71e0238a-e9ae-4c12-8f3b-0aa425837779", "applicationTemplateId": null, "disabledByMicrosoftStatus": - null, "createdDateTime": "2023-08-28T07:10:07.1114243Z", "displayName": "app000003", - "description": null, "groupMembershipClaims": null, "identifierUris": [], - "isDeviceOnlyAuthSupported": null, "isFallbackPublicClient": null, "notes": - null, "publisherDomain": "AzureSDKTeam.onmicrosoft.com", "serviceManagementReference": - null, "signInAudience": "AzureADandPersonalMicrosoftAccount", "tags": [], - "tokenEncryptionKeyId": null, "samlMetadataUrl": null, "defaultRedirectUri": - null, "certification": null, "optionalClaims": null, "servicePrincipalLockConfiguration": - null, "requestSignatureVerification": null, "addIns": [], "api": {"acceptMappedClaims": - null, "knownClientApplications": [], "requestedAccessTokenVersion": 2, "oauth2PermissionScopes": - [], "preAuthorizedApplications": []}, "appRoles": [], "info": {"logoUrl": - null, "marketingUrl": null, "privacyStatementUrl": null, "supportUrl": null, - "termsOfServiceUrl": null}, "keyCredentials": [], "parentalControlSettings": - {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": - [], "publicClient": {"redirectUris": []}, "requiredResourceAccess": [], "verifiedPublisher": - {"displayName": null, "verifiedPublisherId": null, "addedDateTime": null}, - "web": {"homePageUrl": null, "logoutUrl": null, "redirectUris": [], "implicitGrantSettings": - {"enableAccessTokenIssuance": false, "enableIdTokenIssuance": false}, "redirectUriSettings": - []}, "spa": {"redirectUris": []}}' - headers: - cache-control: - - no-cache - content-length: - - "1717" - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:09 GMT - location: - - https://graph.microsoft.com/v2/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/directoryObjects/f550ce24-074d-4a8e-b811-096bb4a060c6/Microsoft.DirectoryServices.Application - odata-version: - - "4.0" - request-id: - - e65d716c-e4d9-4a01-a990-2e3cdd9da029 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"Southeast Asia","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"SI1PEPF00001A31"}}' - x-ms-resource-unit: - - "1" - status: - code: 201 - message: Created - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_stack_hci_extension000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001","name":"cli_test_stack_hci_extension000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_stack_hci_extension_crud","date":"2023-08-28T07:10:00Z","module":"stack-hci-vm"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - "406" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:10 GMT - expires: - - "-1" - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK - - request: - body: - '{"location": "eastus", "properties": {"aadClientId": "71e0238a-e9ae-4c12-8f3b-0aa425837779", - "aadTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm cluster create - Connection: - - keep-alive - Content-Length: - - "148" - Content-Type: - - application/json - ParameterSetName: - - -n -g --aad-client-id --aad-tenant-id - User-Agent: - - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002","name":"cluster000002","type":"microsoft.azurestackhci/clusters","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-08-28T07:10:14.4029371Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-28T07:10:14.4029371Z"},"properties":{"provisioningState":"Succeeded","status":"NotYetRegistered","cloudId":"31f5b678-68a1-490d-999d-886da92582da","aadClientId":"71e0238a-e9ae-4c12-8f3b-0aa425837779","aadTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","softwareAssuranceProperties":{"softwareAssuranceStatus":"Disabled","softwareAssuranceIntent":"Disable"},"desiredProperties":{"windowsServerSubscription":"Disabled","diagnosticLevel":"Basic"},"trialDaysRemaining":60,"billingModel":"Trial","serviceEndpoint":"https://dp.stackhci.azure.com/eastus/","resourceProviderObjectId":"dce429e3-98f6-46ba-8959-be060dd15eec"}}' - headers: - cache-control: - - no-cache - content-length: - - "1089" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:15 GMT - etag: - - '"ed0316be-0000-0100-0000-64ec48570000"' - expires: - - "-1" - mise-correlation-id: - - 1f3193e5-5f2a-444e-8270-b29b187caaaa - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: "{}" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm arc-setting create - Connection: - - keep-alive - Content-Length: - - "2" - Content-Type: - - application/json - ParameterSetName: - - -n -g --cluster-name - User-Agent: - - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default","name":"default","type":"microsoft.azurestackhci/clusters/arcsettings","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-08-28T07:10:16.9321198Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-28T07:10:16.9321198Z"},"properties":{"connectivityProperties":{"enabled":false,"serviceConfigurations":[]},"provisioningState":"Succeeded","arcInstanceResourceGroup":"cluster000002-31f5b678-68a1-490d-999d-886da92582da-Arc-Infra-RG","aggregateState":"NotSpecified","defaultExtensions":[{"category":"ProductQualityAndSupport"}]}}' - headers: - cache-control: - - no-cache - content-length: - - "806" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:23 GMT - etag: - - '"c300f340-0000-0100-0000-64ec485f0000"' - expires: - - "-1" - mise-correlation-id: - - f59a1d55-8fd1-4954-a7d2-2fb75c7d732d - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: - '{"properties": {"extensionParameters": {"protectedSettings": {"workspaceKey": - "xx"}, "publisher": "Microsoft.Compute", "settings": {"workspaceId": "xx", "port": - "6516"}, "type": "MicrosoftMonitoringAgent", "typeHandlerVersion": "1.10"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm extension create - Connection: - - keep-alive - Content-Length: - - "237" - Content-Type: - - application/json - ParameterSetName: - - -n -g --cluster-name --arc-setting-name --settings --protected-settings --publisher - --type --type-handler-version - User-Agent: - - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent","name":"MicrosoftMonitoringAgent","type":"microsoft.azurestackhci/clusters/arcsettings/extensions","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-08-28T07:10:24.4415908Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-28T07:10:24.4415908Z"},"properties":{"provisioningState":"Succeeded","aggregateState":"NotSpecified","extensionParameters":{"type":"MicrosoftMonitoringAgent","publisher":"Microsoft.Compute","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"workspaceId":"xx","port":"6516"}},"managedBy":"User"}}' - headers: - cache-control: - - no-cache - content-length: - - "862" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:27 GMT - etag: - - '"d101e9e5-0000-0100-0000-64ec48630000"' - expires: - - "-1" - mise-correlation-id: - - cc407c22-18de-46e2-91a3-07e40b3caffe - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-writes: - - "1199" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm extension list - Connection: - - keep-alive - ParameterSetName: - - -g --cluster-name --arc-setting-name - User-Agent: - - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions?api-version=2023-03-01 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent","name":"MicrosoftMonitoringAgent","type":"microsoft.azurestackhci/clusters/arcsettings/extensions","properties":{"provisioningState":"Succeeded","aggregateState":"NotSpecified","perNodeExtensionDetails":[],"extensionParameters":{"type":"MicrosoftMonitoringAgent","publisher":"Microsoft.Compute","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"workspaceId":"xx","port":"6516"}},"managedBy":"User"}}]}' - headers: - cache-control: - - no-cache - content-length: - - "659" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:29 GMT - expires: - - "-1" - mise-correlation-id: - - bbdc371d-7107-4a0e-ac3c-f8f91e536750 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm extension show - Connection: - - keep-alive - ParameterSetName: - - -n -g --cluster-name --arc-setting-name - User-Agent: - - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent?api-version=2023-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent","name":"MicrosoftMonitoringAgent","type":"microsoft.azurestackhci/clusters/arcsettings/extensions","properties":{"provisioningState":"Succeeded","aggregateState":"NotSpecified","perNodeExtensionDetails":[],"extensionParameters":{"type":"MicrosoftMonitoringAgent","publisher":"Microsoft.Compute","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"workspaceId":"xx","port":"6516"}},"managedBy":"User"}}' - headers: - cache-control: - - no-cache - content-length: - - "647" - content-type: - - application/json; charset=utf-8 - date: - - Mon, 28 Aug 2023 07:10:33 GMT - etag: - - '"d101e9e5-0000-0100-0000-64ec48630000"' - expires: - - "-1" - mise-correlation-id: - - 87727d91-66e0-4159-90dd-774233e1154f - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - status: - code: 200 - message: OK - - request: - body: null - headers: - Accept: - - "*/*" - Accept-Encoding: - - gzip, deflate - CommandName: - - stack-hci-vm extension delete - Connection: - - keep-alive - Content-Length: - - "0" - ParameterSetName: - - -n -g --cluster-name --arc-setting-name --no-wait --yes - User-Agent: - - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_stack_hci_extension000001/providers/Microsoft.AzureStackHCI/clusters/cluster000002/arcSettings/default/extensions/MicrosoftMonitoringAgent?api-version=2023-03-01 - response: - body: - string: "" - headers: - cache-control: - - no-cache - content-length: - - "0" - date: - - Mon, 28 Aug 2023 07:10:35 GMT - expires: - - "-1" - mise-correlation-id: - - c2505f20-5cbe-4bf5-9e9f-fe933e2d4963 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - "True" - x-ms-ratelimit-remaining-subscription-deletes: - - "14999" - status: - code: 200 - message: OK -version: 1 diff --git a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py b/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py deleted file mode 100644 index b2fe84ec243..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/tests/latest/test_stack_hci_commands.py +++ /dev/null @@ -1,141 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -# pylint: disable=too-many-lines - -import json - -from azure.cli.testsdk import ( - ResourceGroupPreparer, - ScenarioTest -) - - -class StackHciClientTest(ScenarioTest): - @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_cluster', location='eastus') - def test_stack_hci_cluster_crud(self): - self.kwargs.update({ - 'cluster_name': self.create_random_name('cluster', 15), - 'app_name': self.create_random_name('app', 15) - }) - self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] - self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] - - cluster = self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id} --tags key0=value0 --mi-system-assigned', checks=[ - self.check('name', '{cluster_name}'), - self.check('tags', {'key0': 'value0'}), - self.check('type', 'microsoft.azurestackhci/clusters'), - self.check('identity.type', 'SystemAssigned') - ]).get_output_in_json() - self.kwargs.update({ - 'cluster_id': cluster['id'] - }) - self.cmd('stack-hci-vm cluster create-identity --cluster-name {cluster_name} -g {rg}') - self.cmd('stack-hci-vm cluster list -g {rg}', checks=[ - self.check('length(@)', 1), - self.check('@[0].name', '{cluster_name}'), - self.check('[0].identity.type', 'SystemAssigned'), - self.check('[0].type', 'microsoft.azurestackhci/clusters') - ]) - self.cmd('stack-hci-vm cluster update -n {cluster_name} -g {rg} --tags key0=value1') - self.cmd('stack-hci-vm cluster show -n {cluster_name} -g {rg}', checks=[ - self.check('name', '{cluster_name}'), - self.check('tags', {'key0': 'value1'}), - self.check('type', 'microsoft.azurestackhci/clusters'), - self.exists('aadApplicationObjectId'), - self.exists('aadServicePrincipalObjectId') - ]) - self.cmd('stack-hci-vm cluster show --ids {cluster_id}', checks=[ - self.check('name', '{cluster_name}'), - self.check('tags', {'key0': 'value1'}), - self.check('type', 'microsoft.azurestackhci/clusters'), - self.exists('aadApplicationObjectId'), - self.exists('aadServicePrincipalObjectId') - ]) - self.cmd('stack-hci-vm cluster delete -n {cluster_name} -g {rg} --yes') - - @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_arc_setting', location='eastus') - def test_stack_hci_arc_setting_crud(self): - self.kwargs.update({ - 'cluster_name': self.create_random_name('cluster', 15), - 'app_name': self.create_random_name('app', 15) - }) - self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] - self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] - self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id}') - - self.cmd('stack-hci-vm arc-setting create -n default -g {rg} --cluster-name {cluster_name}', checks=[ - self.check('name', 'default'), - self.check('type', 'microsoft.azurestackhci/clusters/arcsettings') - ]) - self.cmd('stack-hci-vm arc-setting create-identity -n default --cluster-name {cluster_name} -g {rg}') - self.cmd('stack-hci-vm arc-setting consent-and-install-default-extension -g {rg} --arc-setting-name default --cluster-name {cluster_name}', checks=[ - self.check('name', 'default'), - self.check('type', 'microsoft.azurestackhci/clusters/arcsettings'), - self.check('defaultExtensions[0].category', 'ProductQualityAndSupport') - ]) - self.cmd('stack-hci-vm arc-setting initialize-disable-proces -g {rg} --arc-setting-name default --cluster-name {cluster_name}') - self.cmd('stack-hci-vm arc-setting list -g {rg} --cluster-name {cluster_name}', checks=[ - self.check('length(@)', 1), - self.check('@[0].name', 'default') - ]) - self.cmd('stack-hci-vm arc-setting show -n default -g {rg} --cluster-name {cluster_name}', checks=[ - self.check('name', 'default'), - self.check('type', 'microsoft.azurestackhci/clusters/arcsettings') - ]) - self.cmd('stack-hci-vm arc-setting generate-password -n default --cluster-name {cluster_name} -g {rg}', checks=[ - self.exists('secretText') - ]) - self.cmd('stack-hci-vm arc-setting delete -n default -g {rg} --cluster-name {cluster_name} --no-wait --yes') - - @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_extension', location='eastus') - def test_stack_hci_extension_crud(self): - self.kwargs.update({ - 'cluster_name': self.create_random_name('cluster', 15), - 'app_name': self.create_random_name('app', 15), - 'type': 'MicrosoftMonitoringAgent', - 'publisher': 'Microsoft.Compute' - }) - self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] - self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] - self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id}') - self.cmd('stack-hci-vm arc-setting create -n default -g {rg} --cluster-name {cluster_name}') - self.cmd('stack-hci-vm extension create -n {type} -g {rg} --cluster-name {cluster_name} --arc-setting-name default --settings "{{\'workspaceId\': \'xx\', \'port\': \'6516\'}}" --protected-settings "{{\'workspaceKey\': \'xx\'}}" --publisher {publisher} --type {type} --type-handler-version 1.10', checks=[ - self.check('name', self.kwargs['type']), - self.check('type', 'microsoft.azurestackhci/clusters/arcsettings/extensions'), - self.check('extensionParameters.settings.workspaceId', 'xx'), - self.check('extensionParameters.settings.port', '6516') - ]) - self.cmd('stack-hci-vm extension list -g {rg} --cluster-name {cluster_name} --arc-setting-name default', checks=[ - self.check('length(@)', 1), - self.check('@[0].name', self.kwargs['type']) - ]) - self.cmd('stack-hci-vm extension show -n {type} -g {rg} --cluster-name {cluster_name} --arc-setting-name default', checks=[ - self.check('name', self.kwargs['type']), - self.check('type', 'microsoft.azurestackhci/clusters/arcsettings/extensions') - ]) - self.cmd('stack-hci-vm extension delete -n {type} -g {rg} --cluster-name {cluster_name} --arc-setting-name default --no-wait --yes') - - @ResourceGroupPreparer(name_prefix='cli_test_stack_hci_cluster', location='eastus') - def test_stack_hci_cluster_identity(self): - self.kwargs.update({ - 'cluster_name': self.create_random_name('cluster', 15), - 'cluster_name1': self.create_random_name('cluster', 15), - 'app_name': self.create_random_name('app', 15) - }) - self.kwargs['client_id'] = self.cmd('ad app create --display-name {app_name}').get_output_in_json()['appId'] - self.kwargs['tenant_id'] = self.cmd('account show').get_output_in_json()['tenantId'] - - self.cmd('stack-hci-vm cluster create -n {cluster_name} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id} --tags key0=value0 --mi-system-assigned', checks=[ - self.check('identity.type', 'SystemAssigned') - ]) - self.cmd('stack-hci-vm cluster create -n {cluster_name1} -g {rg} --aad-client-id {client_id} --aad-tenant-id {tenant_id}') - self.cmd('stack-hci-vm cluster identity assign --cluster-name {cluster_name1} -g {rg} --system-assigned', checks=[ - self.check('type', 'SystemAssigned') - ]) - self.cmd('stack-hci-vm cluster identity remove --cluster-name {cluster_name1} -g {rg} --system-assigned', checks=[ - self.check('type', 'None') - ]) diff --git a/src/stack-hci-vm/setup.cfg b/src/stack-hci-vm/setup.cfg index 2fdd96e5d39..8bfd5a12f85 100644 --- a/src/stack-hci-vm/setup.cfg +++ b/src/stack-hci-vm/setup.cfg @@ -1 +1,4 @@ -#setup.cfg \ No newline at end of file +[egg_info] +tag_build = +tag_date = 0 + diff --git a/src/stack-hci-vm/setup.py b/src/stack-hci-vm/setup.py index 1b5f4bafd34..a7f947a4e77 100644 --- a/src/stack-hci-vm/setup.py +++ b/src/stack-hci-vm/setup.py @@ -5,17 +5,23 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - +import sys from codecs import open from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '0.2.9' try: - from azext_stack_hci.manual.version import VERSION + from azext_azurestackhci.manual.version import VERSION except ImportError: pass +if '--version' in sys.argv: + index = sys.argv.index('--version') + sys.argv.pop(index) # Removes the '--version' + VERSION = sys.argv.pop(index) # Returns the element after the '--version' +# The version is now ready to use for the setup + # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ @@ -33,7 +39,7 @@ DEPENDENCIES = [] try: - from azext_stack_hci.manual.dependency import DEPENDENCIES + from azext_azurestackhci.manual.dependency import DEPENDENCIES except ImportError: pass @@ -43,16 +49,16 @@ HISTORY = f.read() setup( - name='stack_hci', + name='azurestackhci', version=VERSION, - description='Microsoft Azure Command-Line Tools AzureStackHCIClient Extension', + description='Microsoft Azure Command-Line Tools AzureStackHCI Extension', author='Microsoft Corporation', author_email='azpycli@microsoft.com', - url='https://github.com/Azure/azure-cli-extensions/tree/main/src/stack-hci-vm', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/azurestackhci', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS, packages=find_packages(), install_requires=DEPENDENCIES, - package_data={'azext_stack_hci': ['azext_metadata.json']}, + package_data={'azext_azurestackhci': ['azext_metadata.json']}, ) From 2cbedc23fa58524e1ff05f89dde0b2f513fdc008 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 10:00:38 -0500 Subject: [PATCH 03/21] Fix extension name --- .github/CODEOWNERS | 2 ++ src/index.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c59d1003879..4647e4025ab 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -178,6 +178,8 @@ /src/stack-hci/ @zhoxing-ms +/src/stack-hci-vm/ @wyatt-troia-msft + /src/acrtransfer/ @mabenedi /src/securityinsight/ @houk-ms diff --git a/src/index.json b/src/index.json index cd85dff35d2..2a98a83fb42 100644 --- a/src/index.json +++ b/src/index.json @@ -56438,7 +56438,7 @@ "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "stack-hci", + "name": "stack-hci-vm", "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", "version": "0.1.2" }, From cc26834dd61af03c0a0adc8c8ac99d48cac46aa5 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 10:13:33 -0500 Subject: [PATCH 04/21] Remove stack-hci-vm --- .github/CODEOWNERS | 2 - src/stack-hci-vm/HISTORY.rst | 8 - src/stack-hci-vm/README.md | 207 -- src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO | 218 -- .../azext_azurestackhci/__init__.py | 50 - .../azext_azurestackhci/action.py | 17 - .../azext_azurestackhci/azext_metadata.json | 4 - .../azext_azurestackhci/custom.py | 17 - .../azext_azurestackhci/generated/__init__.py | 12 - .../generated/_client_factory.py | 47 - .../azext_azurestackhci/generated/_help.py | 794 ----- .../azext_azurestackhci/generated/_params.py | 430 --- .../generated/_validators.py | 279 -- .../azext_azurestackhci/generated/action.py | 353 --- .../azext_azurestackhci/generated/commands.py | 145 - .../azext_azurestackhci/generated/custom.py | 847 ------ .../azext_azurestackhci/generated/helpers.py | 20 - .../azext_azurestackhci/manual/__init__.py | 12 - .../azext_azurestackhci/tests/__init__.py | 116 - .../tests/latest/__init__.py | 12 - .../tests/latest/example_steps.py | 503 --- .../latest/test_azurestackhci_scenario.py | 169 -- .../vendored_sdks/__init__.py | 12 - .../vendored_sdks/azurestackhci/__init__.py | 19 - .../azurestackhci/_azure_stack_hci.py | 109 - .../azurestackhci/_azure_stack_hci_client.py | 89 - .../azurestackhci/_configuration.py | 48 - .../azurestackhci/aio/__init__.py | 10 - .../azurestackhci/aio/_azure_stack_hci.py | 103 - .../azurestackhci/aio/_configuration.py | 66 - .../azurestackhci/aio/operations/__init__.py | 29 - .../_arc_vmextensions_operations.py | 537 ---- .../aio/operations/_clusters_operations.py | 429 --- .../operations/_galleryimages_operations.py | 497 --- .../_networkinterfaces_operations.py | 497 --- .../aio/operations/_operations.py | 88 - .../_storagecontainers_operations.py | 497 --- .../_virtualharddisks_operations.py | 497 --- .../operations/_virtualmachines_operations.py | 609 ---- .../operations/_virtualnetworks_operations.py | 497 --- .../azurestackhci/models/__init__.py | 307 -- .../models/_azure_stack_hci_client_enums.py | 36 - .../models/_azure_stack_hci_enums.py | 56 - .../azurestackhci/models/_models.py | 2678 ---------------- .../azurestackhci/models/_models_py3.py | 2691 ----------------- .../azurestackhci/models/_paged_models.py | 117 - .../azurestackhci/operations/__init__.py | 32 - .../_arc_vmextensions_operations.py | 490 --- .../operations/_clusters_operations.py | 432 --- .../operations/_galleryimages_operations.py | 728 ----- .../_networkinterfaces_operations.py | 470 --- .../azurestackhci/operations/_operations.py | 89 - .../_storagecontainers_operations.py | 470 --- .../_virtualharddisks_operations.py | 470 --- .../operations/_virtualmachines_operations.py | 816 ----- .../operations/_virtualnetworks_operations.py | 470 --- .../vendored_sdks/azurestackhci/version.py | 13 - src/stack-hci-vm/linter_exclusions.yml | 15 - src/stack-hci-vm/setup.cfg | 4 - src/stack-hci-vm/setup.py | 64 - 60 files changed, 19343 deletions(-) delete mode 100644 src/stack-hci-vm/HISTORY.rst delete mode 100644 src/stack-hci-vm/README.md delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py delete mode 100644 src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py delete mode 100644 src/stack-hci-vm/linter_exclusions.yml delete mode 100644 src/stack-hci-vm/setup.cfg delete mode 100644 src/stack-hci-vm/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4647e4025ab..c59d1003879 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -178,8 +178,6 @@ /src/stack-hci/ @zhoxing-ms -/src/stack-hci-vm/ @wyatt-troia-msft - /src/acrtransfer/ @mabenedi /src/securityinsight/ @houk-ms diff --git a/src/stack-hci-vm/HISTORY.rst b/src/stack-hci-vm/HISTORY.rst deleted file mode 100644 index 1cb3d46bf79..00000000000 --- a/src/stack-hci-vm/HISTORY.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. :changelog: - -Release History -=============== - -0.1.2 -++++++ -* Initial release. diff --git a/src/stack-hci-vm/README.md b/src/stack-hci-vm/README.md deleted file mode 100644 index 90628c91a1f..00000000000 --- a/src/stack-hci-vm/README.md +++ /dev/null @@ -1,207 +0,0 @@ -# Azure CLI azurestackhci Extension # -This is the extension for azurestackhci - -### How to use ### -Install this extension using the below CLI command -``` -az extension add --name azurestackhci -``` - -### Included Features ### -#### azurestackhci galleryimage #### -##### Create ##### -``` -az azurestackhci galleryimage create \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --container-name "Default_Container" --image-path "C:\\\\test.vhdx" \ - --galleryimages-name "test-gallery-image" --resource-group "test-rg" -``` -##### List ##### -``` -az azurestackhci galleryimage list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci galleryimage update --tags additionalProperties="sample" --galleryimages-name "test-gallery-image" \ - --resource-group "test-rg" -``` -##### Retrieve ##### -``` -az azurestackhci galleryimage retrieve --galleryimages-name "test-gallery-image" --resource-group "test-rg" -``` -##### Delete ##### -``` -az azurestackhci galleryimage delete --galleryimages-name "test-gallery-image" --resource-group "test-rg" -``` -#### azurestackhci networkinterface #### -##### Create ##### -``` -az azurestackhci networkinterface create \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --name "test-nic" - --location "West US2" \ - --subnet-id" "test-vnet" --gateway "1.2.3.4" --ip-address "1.2.3.4" - -OR - -az azurestackhci networkinterface create \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" \ - --ip-configurations "[{\"name\":\"ipconfig-sample\",\"properties\":{\"subnet\":{\"id\":\"test-vnet\"}, \"gateway\":\"1.2.3.4\", \"ip_address\":\"1.2.3.4\"}}]" \ - --networkinterfaces-name "test-nic" -``` -##### List ##### -``` -az azurestackhci networkinterface list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci networkinterface update --tags additionalProperties="sample" --networkinterfaces-name "test-nic" \ - --resource-group "test-rg" -``` -##### Retrieve ##### -``` -az azurestackhci networkinterface retrieve --networkinterfaces-name "test-nic" --resource-group "test-rg" -``` -##### Delete ##### -``` -az azurestackhci networkinterface delete --networkinterfaces-name "test-nic" --resource-group "test-rg" -``` -#### azurestackhci virtualharddisk #### -##### Create ##### -``` -az azurestackhci virtualharddisk create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --disk-size-gb 32 --virtualharddisks-name "test-vhd" -``` -##### List ##### -``` -az azurestackhci virtualharddisk list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci virtualharddisk update --resource-group "test-rg" --tags additionalProperties="sample" \ - --virtualharddisks-name "test-vhd" -``` -##### Retrieve ##### -``` -az azurestackhci virtualharddisk retrieve --resource-group "test-rg" --virtualharddisks-name "test-vhd" -``` -##### Delete ##### -``` -az azurestackhci virtualharddisk delete --resource-group "test-rg" --virtualharddisks-name "test-vhd" -``` -#### azurestackhci virtualmachine #### -##### Create ##### -``` -az azurestackhci virtualmachine create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --hardware-profile vm-size="Default" maximum_memory_mb=1 minimum_memory_mb=1 target_memory_buffer=100 --network-profile network-interfaces={"id":"test-nic"} \ - --os-profile "{\\"adminPassword\\":\\"password\\",\\"adminUsername\\":\\"localadmin\\",\\"computerName\\":\\"luamaster\\"}" \ - --storage-profile "{\\"imageReference\\":{\\"id\\":\\"test-gallery-image\\"}}" --virtualmachines-name "test-vm" - ----linux-configuration ssh_keys='{\"key_data\": \"ssh_public_key\"}' ssh_keys='{\"path\": \"/path/to/id_rsa.pub\"}' -``` -##### List ##### -``` -az azurestackhci virtualmachine list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" \ - --virtualmachines-name "test-vm" -``` -##### Retrieve ##### -``` -az azurestackhci virtualmachine retrieve --resource-group "test-rg" --virtualmachines-name "test-vm" -``` -##### Start ##### -``` -az azurestackhci virtualmachine start --resource-group "test-rg" --virtualmachines-name "test-vm" -``` -##### Stop ##### -``` -az azurestackhci virtualmachine stop --resource-group "test-rg" --virtualmachines-name "test-vm" -``` -##### Delete ##### -``` -az azurestackhci virtualmachine delete --resource-group "test-rg" --virtualmachines-name "test-vm" -``` -##### Add Vnic ##### -``` -az azurestackhci virtualmachine vnic add --resource-group "test-rg" --virtualmachines-name "test-vm" --vnic-name "test-vnic" -``` -##### Remove Vnic ##### -``` -az azurestackhci virtualmachine vnic remove --resource-group "test-rg" --virtualmachines-name "test-vm" --vnic-name "test-vnic" -``` -#### azurestackhci virtualnetwork #### -##### Create ##### -``` -az azurestackhci virtualnetwork create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --network-type "Transparent" ---name "test-vnet" --address-prefix "10.0.0.0/16" \ - --ip-allocation-method "Static" --ip-pool-type "Static" --ip-pool-start "10.0.0.0" ip-pool-end "10.0.0.16" --vlan 10" -``` -##### List ##### -``` -az azurestackhci virtualnetwork list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" \ - --virtualnetworks-name "test-vnet" -``` -##### Retrieve ##### -``` -az azurestackhci virtualnetwork retrieve --resource-group "test-rg" --virtualnetworks-name "test-vnet" -``` -##### Delete ##### -``` -az azurestackhci virtualnetwork delete --resource-group "test-rg" --virtualnetworks-name "test-vnet" -``` -#### azurestackhci storagecontainer #### -##### Create ##### -``` -az azurestackhci storagecontainer create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --path "C:\\\\container_storage" --storagecontainers-name "Default_Container" -``` -##### List ##### -``` -az azurestackhci storagecontainer list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci storagecontainer update --resource-group "test-rg" --tags additionalProperties="sample" \ - --storagecontainers-name "Default_Container" -``` -##### Retrieve ##### -``` -az azurestackhci storagecontainer retrieve --resource-group "test-rg" --storagecontainers-name "Default_Container" -``` -##### Delete ##### -``` -az azurestackhci storagecontainer delete --resource-group "test-rg" --storagecontainers-name "Default_Container" -``` -#### azurestackhci cluster #### -##### Create ##### -``` -az azurestackhci cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" \ - --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --name "myCluster" --resource-group "test-rg" -``` -##### Show ##### -``` -az azurestackhci cluster show --name "myCluster" --resource-group "test-rg" -``` -##### List ##### -``` -az azurestackhci cluster list --resource-group "test-rg" -``` -##### Update ##### -``` -az azurestackhci cluster update --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group "test-rg" -``` -##### Delete ##### -``` -az azurestackhci cluster delete --name "myCluster" --resource-group "test-rg" -``` \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO b/src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO deleted file mode 100644 index 0ed5616d93e..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/PKG-INFO +++ /dev/null @@ -1,218 +0,0 @@ -Metadata-Version: 2.1 -Name: azurestackhci -Version: 0.2.9 -Summary: Microsoft Azure Command-Line Tools AzureStackHCI Extension -Home-page: https://github.com/Azure/azure-cli-extensions/tree/master/src/azurestackhci -Author: Microsoft Corporation -Author-email: azpycli@microsoft.com -License: MIT -Description: # Azure CLI azurestackhci Extension # - This is the extension for azurestackhci - - ### How to use ### - Install this extension using the below CLI command - ``` - az extension add --name azurestackhci - ``` - - ### Included Features ### - #### azurestackhci galleryimage #### - ##### Create ##### - ``` - az azurestackhci galleryimage create \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --container-name "Default_Container" --image-path "C:\\\\test.vhdx" \ - --galleryimages-name "test-gallery-image" --resource-group "test-rg" - ``` - ##### List ##### - ``` - az azurestackhci galleryimage list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci galleryimage update --tags additionalProperties="sample" --galleryimages-name "test-gallery-image" \ - --resource-group "test-rg" - ``` - ##### Retrieve ##### - ``` - az azurestackhci galleryimage retrieve --galleryimages-name "test-gallery-image" --resource-group "test-rg" - ``` - ##### Delete ##### - ``` - az azurestackhci galleryimage delete --galleryimages-name "test-gallery-image" --resource-group "test-rg" - ``` - #### azurestackhci networkinterface #### - ##### Create ##### - ``` - az azurestackhci networkinterface create \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" \ - --ip-configurations "[{\\"name\\":\\"ipconfig-sample\\",\\"properties\\":{\\"subnet\\":{\\"id\\":\\"test-vnet\\"}, \\"gateway\\":\\"1.2.3.4\\", \\"privateIPAddress\\":\\"1.2.3.4\\", \\"privateIPAllocationMethod\\":\\"Static\\"}}]" \ - --networkinterfaces-name "test-nic" --resource-group "test-rg" - ``` - ##### List ##### - ``` - az azurestackhci networkinterface list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci networkinterface update --tags additionalProperties="sample" --networkinterfaces-name "test-nic" \ - --resource-group "test-rg" - ``` - ##### Retrieve ##### - ``` - az azurestackhci networkinterface retrieve --networkinterfaces-name "test-nic" --resource-group "test-rg" - ``` - ##### Delete ##### - ``` - az azurestackhci networkinterface delete --networkinterfaces-name "test-nic" --resource-group "test-rg" - ``` - #### azurestackhci virtualharddisk #### - ##### Create ##### - ``` - az azurestackhci virtualharddisk create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --disk-size-gb 32 --virtualharddisks-name "test-vhd" - ``` - ##### List ##### - ``` - az azurestackhci virtualharddisk list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci virtualharddisk update --resource-group "test-rg" --tags additionalProperties="sample" \ - --virtualharddisks-name "test-vhd" - ``` - ##### Retrieve ##### - ``` - az azurestackhci virtualharddisk retrieve --resource-group "test-rg" --virtualharddisks-name "test-vhd" - ``` - ##### Delete ##### - ``` - az azurestackhci virtualharddisk delete --resource-group "test-rg" --virtualharddisks-name "test-vhd" - ``` - #### azurestackhci virtualmachine #### - ##### Create ##### - ``` - az azurestackhci virtualmachine create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --hardware-profile vm-size="Default" --network-profile network-interfaces={"id":"test-nic"} \ - --os-profile "{\\"adminPassword\\":\\"password\\",\\"adminUsername\\":\\"localadmin\\",\\"computerName\\":\\"luamaster\\"}" \ - --storage-profile "{\\"imageReference\\":{\\"id\\":\\"test-gallery-image\\"}}" --virtualmachines-name "test-vm" - ``` - ##### List ##### - ``` - az azurestackhci virtualmachine list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" \ - --virtualmachines-name "test-vm" - ``` - ##### Retrieve ##### - ``` - az azurestackhci virtualmachine retrieve --resource-group "test-rg" --virtualmachines-name "test-vm" - ``` - ##### Start ##### - ``` - az azurestackhci virtualmachine start --resource-group "test-rg" --virtualmachines-name "test-vm" - ``` - ##### Stop ##### - ``` - az azurestackhci virtualmachine stop --resource-group "test-rg" --virtualmachines-name "test-vm" - ``` - ##### Delete ##### - ``` - az azurestackhci virtualmachine delete --resource-group "test-rg" --virtualmachines-name "test-vm" - ``` - #### azurestackhci virtualnetwork #### - ##### Create ##### - ``` - az azurestackhci virtualnetwork create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --network-type "Transparent" --virtualnetworks-name "test-vnet" - --vlan 10 - ``` - ##### List ##### - ``` - az azurestackhci virtualnetwork list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" \ - --virtualnetworks-name "test-vnet" - ``` - ##### Retrieve ##### - ``` - az azurestackhci virtualnetwork retrieve --resource-group "test-rg" --virtualnetworks-name "test-vnet" - ``` - ##### Delete ##### - ``` - az azurestackhci virtualnetwork delete --resource-group "test-rg" --virtualnetworks-name "test-vnet" - ``` - #### azurestackhci storagecontainer #### - ##### Create ##### - ``` - az azurestackhci storagecontainer create --resource-group "test-rg" \ - --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" \ - --location "West US2" --path "C:\\\\container_storage" --storagecontainers-name "Default_Container" - ``` - ##### List ##### - ``` - az azurestackhci storagecontainer list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci storagecontainer update --resource-group "test-rg" --tags additionalProperties="sample" \ - --storagecontainers-name "Default_Container" - ``` - ##### Retrieve ##### - ``` - az azurestackhci storagecontainer retrieve --resource-group "test-rg" --storagecontainers-name "Default_Container" - ``` - ##### Delete ##### - ``` - az azurestackhci storagecontainer delete --resource-group "test-rg" --storagecontainers-name "Default_Container" - ``` - #### azurestackhci cluster #### - ##### Create ##### - ``` - az azurestackhci cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" \ - --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --name "myCluster" --resource-group "test-rg" - ``` - ##### Show ##### - ``` - az azurestackhci cluster show --name "myCluster" --resource-group "test-rg" - ``` - ##### List ##### - ``` - az azurestackhci cluster list --resource-group "test-rg" - ``` - ##### Update ##### - ``` - az azurestackhci cluster update --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group "test-rg" - ``` - ##### Delete ##### - ``` - az azurestackhci cluster delete --name "myCluster" --resource-group "test-rg" - ``` - - .. :changelog: - - Release History - =============== - - 0.1.0 - ++++++ - * Initial release. - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: System Administrators -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: License :: OSI Approved :: MIT License diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py deleted file mode 100644 index 6c799d8f4c3..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from azure.cli.core import AzCommandsLoader -from azext_azurestackhci.generated._help import helps # pylint: disable=unused-import -try: - from azext_azurestackhci.manual._help import helps # pylint: disable=reimported -except ImportError: - pass - - -class AzureStackHCICommandsLoader(AzCommandsLoader): - - def __init__(self, cli_ctx=None): - from azure.cli.core.commands import CliCommandType - from azext_azurestackhci.generated._client_factory import cf_azurestackhci_cl - azurestackhci_custom = CliCommandType( - operations_tmpl='azext_azurestackhci.custom#{}', - client_factory=cf_azurestackhci_cl) - parent = super(AzureStackHCICommandsLoader, self) - parent.__init__(cli_ctx=cli_ctx, custom_command_type=azurestackhci_custom) - - def load_command_table(self, args): - from azext_azurestackhci.generated.commands import load_command_table - load_command_table(self, args) - try: - from azext_azurestackhci.manual.commands import load_command_table as load_command_table_manual - load_command_table_manual(self, args) - except ImportError: - pass - return self.command_table - - def load_arguments(self, command): - from azext_azurestackhci.generated._params import load_arguments - load_arguments(self, command) - try: - from azext_azurestackhci.manual._params import load_arguments as load_arguments_manual - load_arguments_manual(self, command) - except ImportError: - pass - - -COMMAND_LOADER_CLS = AzureStackHCICommandsLoader diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py deleted file mode 100644 index d95d53bf711..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/action.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wildcard-import -# pylint: disable=unused-wildcard-import - -from .generated.action import * # noqa: F403 -try: - from .manual.action import * # noqa: F403 -except ImportError: - pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json deleted file mode 100644 index cfc30c747c7..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/azext_metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.15.0" -} \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py deleted file mode 100644 index dbe9d5f9742..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/custom.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wildcard-import -# pylint: disable=unused-wildcard-import - -from .generated.custom import * # noqa: F403 -try: - from .manual.custom import * # noqa: F403 -except ImportError: - pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py deleted file mode 100644 index 25bea868024..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_client_factory.py +++ /dev/null @@ -1,47 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - - -def cf_azurestackhci_cl(cli_ctx, *_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_azurestackhci.vendored_sdks.azurestackhci import AzureStackHCIClient - return get_mgmt_service_client(cli_ctx, - AzureStackHCIClient) - - -def cf_galleryimage(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).galleryimages - - -def cf_networkinterface(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).networkinterfaces - - -def cf_virtualharddisk(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).virtualharddisks - - -def cf_virtualmachine(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).virtualmachines - - -def cf_virtualnetwork(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).virtualnetworks - - -def cf_storagecontainer(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).storagecontainers - - -def cf_cluster(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).clusters - -def cf_arc_vmextension(cli_ctx, *_): - return cf_azurestackhci_cl(cli_ctx).arcvmextensions \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py deleted file mode 100644 index 1693cdf47c0..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_help.py +++ /dev/null @@ -1,794 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=too-many-lines - -from knack.help_files import helps - -helps['azurestackhci'] = """ - type: group - short-summary: Manage azurestackhci -""" - -helps['azurestackhci image'] = """ - type: group - short-summary: Manage images with azurestackhci -""" - -helps['azurestackhci image list'] = """ - type: command - short-summary: "List all gallery images" - examples: - - name: ListGalleryImageByResourceGroup - text: |- - az azurestackhci image list --resource-group "test-rg" - - name: ListGalleryImageByResourceGroup - text: |- - az azurestackhci image list -""" - -helps['azurestackhci image create'] = """ - type: command - short-summary: "Create a gallery image" - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. - - name: --offer - short-summary: "offer for Marketplace image" - long-summary: | - Usage: --offer - - name: --publisher - short-summary: "publisher for Marketplace image" - long-summary: | - Usage: --publisher - - name: --sku - short-summary: "sku for Marketplace image" - long-summary: | - Usage: --sku - - name: --version - short-summary: "version for Marketplace image" - long-summary: | - Usage: --version - - name: --storagepath-id - short-summary: "Azure ID of the storagepath which is used to store Gallery Images." - - name: --image-path - short-summary: "Location/Path of the image the gallery image should be created from." - examples: - - name: PutGalleryImage - text: |- - az azurestackhci image create --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-27\ -2844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" \ -type="CustomLocation" --location "West US2" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers\ -/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" --image-path "C:\\\\test.vhdx" \ ---name "test-gallery-image" --resource-group "test-rg" -""" - -helps['azurestackhci image update'] = """ - type: command - short-summary: "Update an image." - examples: - - name: UpdateGalleryImage - text: |- - az azurestackhci image update --tags additionalProperties="sample" --name \ -"test-gallery-image" --resource-group "test-rg" -""" - -helps['azurestackhci image delete'] = """ - type: command - short-summary: "Delete an image." - examples: - - name: DeleteGalleryImage - text: |- - az azurestackhci image delete --name "test-gallery-image" --resource-group \ -"test-rg" -""" - -helps['azurestackhci image show'] = """ - type: command - short-summary: "Get the details of an image" - examples: - - name: GetGalleryImage - text: |- - az azurestackhci image show --name "test-gallery-image" --resource-group \ -"test-rg" -""" - -helps['azurestackhci galleryimage'] = """ - type: group - short-summary: Please use 'az azurestackhci image' instead of 'az azurestackhci galleryimage' -""" - -helps['azurestackhci galleryimage list'] = """ - type: command - short-summary: Please use 'az azurestackhci image list' instead of 'az azurestackhci galleryimage list' -""" - -helps['azurestackhci galleryimage create'] = """ - type: command - short-summary: Please use 'az azurestackhci image create' instead of 'az azurestackhci galleryimage create' - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. -""" - -helps['azurestackhci galleryimage update'] = """ - type: command - short-summary: Please use 'az azurestackhci image update' instead of 'az azurestackhci galleryimage update' -""" - -helps['azurestackhci galleryimage delete'] = """ - type: command - short-summary: Please use 'az azurestackhci image delete' instead of 'az azurestackhci galleryimage delete' -""" - -helps['azurestackhci galleryimage show'] = """ - type: command - short-summary: Please use 'az azurestackhci image show' instead of 'az azurestackhci galleryimage show' -""" - -helps['azurestackhci networkinterface'] = """ - type: group - short-summary: Manage networkinterface with azurestackhci -""" - -helps['azurestackhci networkinterface list'] = """ - type: command - short-summary: "List all network interfaces" - examples: - - name: ListNetworkInterfaceByResourceGroup - text: |- - az azurestackhci networkinterface list --resource-group "test-rg" - - name: ListNetworkInterfaceBySubscription - text: |- - az azurestackhci networkinterface list -""" - -helps['azurestackhci networkinterface create'] = """ - type: command - short-summary: "Create a network interface" - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. - - name: --subnet-id - long-summary: | - Usage: --subnet-id "test-vnet" - The subnet-id provided will be ignored if ip-configurations parameter is also provided - - name: --gateway - long-summary: | - Usage: --gateway "1.2.3.4" - - name: --ip-address - long-summary: | - Usage: --ip-address "1.2.3.4" - - name: --dns-servers - long-summary: | - Usage: --dns-servers 10.220.32.16 10.220.32.17 - examples: - - name: Without ip configurations provided - text: |- - az azurestackhci networkinterface create --resource-group "test-rg" --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4f\ -d-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" \ -type="CustomLocation" --location "West US2" --subnet-id "test-vnet" --gateway "1.2.3.4" \ ---ip-address "10.0.0.0" --name "test-nic" - # examples: - # - name: With ip configurations provided - # text: |- -# az azurestackhci networkinterface create --resource-group "test-rg" --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4f\ -# d-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" \ -# type="CustomLocation" --location "West US2" --ip-configurations "[{\"name\":\"ipconfig-test\",\"properties\":{\ -# \"subnet\":{\"id\":\"test-vnet\"},\"gateway\":\"1.2.3.4\", \"ip_address\":\"10.0.0.0\"}}]" \ -# --name "test-nic" \ -""" - -helps['azurestackhci networkinterface update'] = """ - type: command - short-summary: "Update a network interface." - examples: - - name: UpdateNetworkInterface - text: |- - az azurestackhci networkinterface update --tags additionalProperties="sample" --name \ -"test-nic" --resource-group "test-rg" -""" - -helps['azurestackhci networkinterface delete'] = """ - type: command - short-summary: "Delete a network interface" - examples: - - name: DeleteNetworkInterface - text: |- - az azurestackhci networkinterface delete --name "test-nic" --resource-group "test-rg" -""" - -helps['azurestackhci networkinterface show'] = """ - type: command - short-summary: "Get the details of a network interface" - examples: - - name: GetNetworkInterface - text: |- - az azurestackhci networkinterface show --name "test-nic" --resource-group \ -"test-rg" -""" - -helps['azurestackhci virtualharddisk'] = """ - type: group - short-summary: Manage virtualharddisk with azurestackhci -""" - -helps['azurestackhci virtualharddisk list'] = """ - type: command - short-summary: "List all virtual hard disks" - examples: - - name: ListVirtualHardDiskByResourceGroup - text: |- - az azurestackhci virtualharddisk list --resource-group "test-rg" - - name: ListVirtualHardDiskByResourceGroup - text: |- - az azurestackhci virtualharddisk list -""" - -helps['azurestackhci virtualharddisk create'] = """ - type: command - short-summary: "Create a virtual hard disk" - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. - - name: --disk-size-bytes - short-summary: "Deprecated. Please use --disk-size-gb instead. Size of the disk in GB." - - name: --disk-size-gb - short-summary: "Size of the disk in GB." - - name: --dynamic - short-summary: "Boolean for enabling dynamic sizing on the virtual hard disk. Allowed values: false, true." - - name: --block-size-bytes - short-summary: "Block size." - - name: --logical-sector-bytes - short-summary: "Logical Sector." - - name: --physical-sector-bytes - short-summary: "Physical Sector." - - name: --storagepath-id - short-summary: "Azure ID of the Storage Path which is used to store the VHD." - - name: --disk-file-format - short-summary: "disk file format of the virtual hard disk - vhd or vhdx." - long-summary: | - Usage: --disk-file-format "vhd" - examples: - - name: PutVirtualHardDisk - text: |- - az azurestackhci virtualharddisk create --resource-group "test-rg" --extended-location \ -name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio\ -n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --disk-size-bytes 32 \ ---name "test-vhd" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers\ -/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" -""" - -helps['azurestackhci virtualharddisk update'] = """ - type: command - short-summary: "Update a virtual hard disk" - examples: - - name: UpdateVirtualHardDisk - text: |- - az azurestackhci virtualharddisk update --resource-group "test-rg" --tags additionalProperties="sample" \ ---name "test-vhd" -""" - -helps['azurestackhci virtualharddisk delete'] = """ - type: command - short-summary: "Delete a virtual hard disk" - examples: - - name: DeleteVirtualHardDisk - text: |- - az azurestackhci virtualharddisk delete --resource-group "test-rg" --name "test-vhd" -""" - -helps['azurestackhci virtualharddisk show'] = """ - type: command - short-summary: "Get the details of a virtual hard disk" - examples: - - name: GetVirtualHardDisk - text: |- - az azurestackhci virtualharddisk show --resource-group "test-rg" --name "test-vhd" -""" - -helps['azurestackhci virtualmachine'] = """ - type: group - short-summary: Manage virtualmachine with azurestackhci -""" - -helps['azurestackhci virtualmachine list'] = """ - type: command - short-summary: "List all the VMs" - examples: - - name: ListVirtualMachineByResourceGroup - text: |- - az azurestackhci virtualmachine list --resource-group "test-rg" - - name: ListVirtualMachineBySubscription - text: |- - az azurestackhci virtualmachine list -""" - -helps['azurestackhci virtualmachine create'] = """ - type: command - short-summary: "Create a VM" - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. - - name: --hardware-profile - short-summary: "HardwareProfile - Specifies the hardware settings for the virtual machine." - long-summary: | - Usage: --hardware-profile vm-size=XX processors=XX memory-mb=XX maximum-memory-mb=XX minimum-memory-mb=XX target-memory-buffer=XX - - processors: number of processors for the virtual machine - memory-mb: RAM in mb for the virtual machine - maximum-memory-mb: Maximum dynamic memory in mb - minimum-memory-mb: Minimum dynamic memory in mb - target-memory-buffer: Target memory buffer - - name: --enable-tpm - short-summary: "enable tpm - Enable TPM in security settings for the VMs. If the flag is not provided, default value is False" - long-summary: | - Usage: --enable-tpm=XX - - name: --security-profile - short-summary: "SecurityProfile - Specifies the security settings for the virtual machine." - long-summary: | - Usage: --security-profile secure-boot-enabled=XX - - name: --linux-configuration - short-summary: "LinuxConfiguration - Specifies the security settings for the virtual machine." - - name: --windows-configuration - short-summary: "WindowsConfiguration - Windows Configuration for the virtual machine. " - - name: --admin-username - short-summary: "AdminUsername - Administrator Username" - - name: --admin-password - short-summary: "AdminPassword - Administrator Password" - - name: --disable-vm-management - short-summary: "To enable/disable vm Management agent. The default behaviour enables the provisioning for VM ARC agent" - - name: --computer-name - short-summary: "Name of the Computer" - - name: --ssh-public-keys - short-summary: "Path to SSH public keys" - - name: --os-disk - short-summary: "id of the VHD being used to provision the VM" - - name: --data-disk - short-summary: "names of the data disk VHD's being attached to the VM" - - name: --storagepath-id - short-summary: "Azure ID of the Storage Path pointing to the location where the VM config files are stored." - - name: --allow-password-auth - long-summary: | - Whether to enable password authentication for Linux virtual machines. - - Note: This flag has no effect on Windows virtual machines. - - name: --os-disk - short-summary: "ID of the VHD being used to provision the VM" - - name: --data-disk - short-summary: "IDs of the data disk VHD's being attached to the VM" - - examples: - - name: PutVirtualMachine - text: |- - az azurestackhci virtualmachine create --resource-group "test-rg" --extended-location \ -name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio \ -n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --hardware-profile vm-size="Default" \ ---nic-id "test-nic" --computer-name "test-machine" --admin-username xxx --admin-password xxx --ssh-public-keys /path/to/public_key.pub \ ---image-reference "test-gallery-image" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers\ -/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" --name "test-vm" --allow-password-auth true --disable-vm-management true -""" - -helps['azurestackhci virtualmachine update'] = """ - type: command - short-summary: "Update a VM" - parameters: - - name: --cpu-count - short-summary: "Number of processors" - - name: --memory-gb - short-summary: "Deprecated. Please use --memory-mb instead. Amount of RAM in gb." - - name: --memory-mb - short-summary: "Amount of RAM in mb" - - name: --vhd-names - short-summary: "List of vhd names" - - name: --vnic-names - short-summary: "List of vnic names" - examples: - - name: UpdateVirtualMachine - text: |- - az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" \ ---name "test-vm" --cpu-count XX --memory-mb XX --vhd-names vhd1 vhd2 --vnic-names vnic1 vnic2 -""" - -helps['azurestackhci virtualmachine delete'] = """ - type: command - short-summary: "Delete a VM" - examples: - - name: DeleteVirtualMachine - text: |- - az azurestackhci virtualmachine delete --resource-group "test-rg" --name "test-vm" -""" - -helps['azurestackhci virtualmachine show'] = """ - type: command - short-summary: "Get the details of a VM" - examples: - - name: GetVirtualMachine - text: |- - az azurestackhci virtualmachine show --resource-group "test-rg" --name "test-vm" -""" - -helps['azurestackhci virtualmachine start'] = """ - type: command - short-summary: "Start a stopped VM" - examples: - - name: StartVirtualMachine - text: |- - az azurestackhci virtualmachine start --resource-group "test-rg" --name "test-vm" -""" - -helps['azurestackhci virtualmachine stop'] = """ - type: command - short-summary: "Power off (stop) a running VM" - examples: - - name: StopVirtualMachine - text: |- - az azurestackhci virtualmachine stop --resource-group "test-rg" --name "test-vm" -""" - -helps['azurestackhci virtualmachine restart'] = """ - type: command - short-summary: "Restart a VM" - examples: - - name: RestartVirtualMachine - text: |- - az azurestackhci virtualmachine restart --resource-group "test-rg" --name "test-vm" -""" - -helps['azurestackhci virtualmachine vnic'] = """ - type: group - short-summary: Manage vNIC of a virtual machine with azurestackhci -""" - -helps['azurestackhci virtualmachine vnic add'] = """ - type: command - short-summary: "Add existing vNICs to a VM" - examples: - - name: AddVNIC - text: |- - az azurestackhci virtualmachine vnic add --resource-group "test-rg" --name "test-vm" --vnic-names "test-vnic" -""" - -helps['azurestackhci virtualmachine vnic remove'] = """ - type: command - short-summary: "Remove vNICs from a VM" - examples: - - name: RemoveVNIC - text: |- - az azurestackhci virtualmachine vnic remove --resource-group "test-rg" --name "test-vm" --vnic-names "test-vnic" -""" - -helps['azurestackhci virtualnetwork'] = """ - type: group - short-summary: Manage virtualnetwork with azurestackhci -""" - -helps['azurestackhci virtualnetwork list'] = """ - type: command - short-summary: "List all the virtual networks" - examples: - - name: ListVirtualNetworkByResourceGroup - text: |- - az azurestackhci virtualnetwork list --resource-group "test-rg" - - name: ListVirtualNetworkBySubscription - text: |- - az azurestackhci virtualnetwork list -""" - -helps['azurestackhci virtualnetwork create'] = """ - type: command - short-summary: "Create a virtual network" - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. - - name: --ip-allocation-method - long-summary: | - Usage: --ip-allocation-method "Static/Dynamic" - - name: --address-prefix - long-summary: | - Usage: --address-prefix "1.2.3.0/16" - - name: --ip-pool-start - long-summary: | - Usage: --ip-pool-start "1.2.3.0" - - name: --ip-pool-end - long-summary: | - Usage: --ip-pool-end "1.2.3.4" - - name: --ip-pool-type - long-summary: | - Usage: --ip-pool-type "vm" - - name: --ip-pools - long-summary: | - Usage: --ip-pools [{/"start/":/"1.2.3.0/", /"end/":/"1.2.3.4/", /"ip_pool_type/":/"vm/"}] - - name: --vlan - long-summary: | - Usage: --vlan 10 - - name: --vm-switch-name - long-summary: | - Usage: --vm-switch-name "vm-switch-01" - - name: --dns-servers - long-summary: | - Usage: --dns-servers 10.220.32.16 10.220.32.17 - - name: --routes - long-summary: | - Usage: --routes '[{/"name/":/"route1/",/"properties/":{/"address_prefix/":/"1.2.3.0/28/",/"next_hop_ip_address/":/"1.2.3.1/"}},{/"name/":/"route2/",/"properties/":{/"address_prefix/":/"1.2.6.0/24/",/"next_hop_ip_address/":/"1.2.6.1/"}}]' - Expected value: json-string/json-file/@json-file - - name: --gateway - long-summary: | - Usage: --gateway 1.2.3.4 - - name: --subnets - long-summary: | - Usage: --subnets '[{\"properties\":{\"addressPrefix\":\"1.2.3.0/24\",\"ipAllocationMethod\":\"Static\",\"ipPools\":[{\"end\":\"1.2.3.10\",\"start\":\"1.2.3.0\",\"ipPoolType\":\"vm\"},{\"end\":\"1.2.3.15\",\"start\":\"1.2.3.11\",\"ipPoolType\":\"vm\"}]}}]' - examples: - - name: PutVirtualNetwork - text: |- - az azurestackhci virtualnetwork create --resource-group "test-rg" --extended-location \ -name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio\ -n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --network-type "Transparent" \ ---name "test-vnet" --ip-allocation-method "Static" --address-prefix "10.0.0.0/28" --ip-pool-start "10.0.0.0" \ ---ip-pool-end "10.0.0.15" --vm-switch-name "test-vm-switch" --dns-servers 10.220.32.16 10.220.32.17 -""" - -helps['azurestackhci virtualnetwork update'] = """ - type: command - short-summary: "Update a virtual network" - examples: - - name: UpdateVirtualNetwork - text: |- - az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" \ ---name "test-vnet" -""" - -helps['azurestackhci virtualnetwork delete'] = """ - type: command - short-summary: "Delete a virtual network" - examples: - - name: DeleteVirtualNetwork - text: |- - az azurestackhci virtualnetwork delete --resource-group "test-rg" --name "test-vnet" -""" - -helps['azurestackhci virtualnetwork show'] = """ - type: command - short-summary: "Get the details of a virtual network" - examples: - - name: GetVirtualNetwork - text: |- - az azurestackhci virtualnetwork show --resource-group "test-rg" --name "test-vnet" -""" - -helps['azurestackhci storagepath'] = """ - type: group - short-summary: Manage storagepath with azurestackhci -""" - -helps['azurestackhci storagepath list'] = """ - type: command - short-summary: "List all the storage paths" - examples: - - name: ListStoragePathByResourceGroup - text: |- - az azurestackhci storagepath list --resource-group "test-rg" - - name: ListStoragePathByResourceGroup - text: |- - az azurestackhci storagepath list -""" - -helps['azurestackhci storagepath create'] = """ - type: command - short-summary: "Create a storage path" - parameters: - - name: --extended-location - long-summary: | - Usage: --extended-location type=XX name=XX - - type: The extended location type. - name: The extended location name. - - name: --path - short-summary: "Path on a disk to create storagepath." - examples: - - name: PutStoragePath - text: |- - az azurestackhci storagepath create --resource-group "test-rg" --extended-location \ -name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio\ -n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --path "C:\\\\path_storage" \ ---name "Default_StoragePath" -""" - -helps['azurestackhci storagepath update'] = """ - type: command - short-summary: "Update a storage path" - examples: - - name: UpdateStoragePath - text: |- - az azurestackhci storagepath update --resource-group "test-rg" --tags \ -additionalProperties="sample" --name "Default_StoragePath" -""" - -helps['azurestackhci storagepath delete'] = """ - type: command - short-summary: "Delete a storage path" - examples: - - name: DeleteStoragePath - text: |- - az azurestackhci storagepath delete --resource-group "test-rg" --name \ -"Default_StoragePath" -""" - -helps['azurestackhci storagepath show'] = """ - type: command - short-summary: "Get the details of a storage path." - examples: - - name: GetStoragePath - text: |- - az azurestackhci storagepath show --resource-group "test-rg" --name \ -"Default_StoragePath" -""" - -helps['azurestackhci virtualmachine extension'] = """ - type: group - short-summary: Manage virtualmachine extension with azurestackhci -""" - -helps['azurestackhci virtualmachine extension create'] = """ - type: command - short-summary: "Create a virtualmachine extension." - parameters: - - name: --extension-type - short-summary: "Specify the type of the virtualmachine extension; an example is CustomScriptExtension." - - name: --publisher - short-summary: "The name of the virtualmachine extension handler publisher." - - name: --settings - short-summary: "Json formatted public settings for the virtualmachine extension." - - name: --type-handler-version - short-summary: "Specify the version of the script handler." - - name: --virtualmachine-name - short-summary: "The name of the virtualmachine where the extension should be created or updated." - examples: - - name: PutExtension - text: |- - az azurestackhci virtualmachine extension create --resource-group "test-rg" --location "West US2" --name "test-extension" \ ---extension-type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{\"commandToExecute\":\"hostname\"}' \ ---type-handler-version "1.10" --virtualmachine-name "test-virtualmachine" -""" - -helps['azurestackhci virtualmachine extension update'] = """ - type: command - short-summary: "Update a virtualmachine extension." - examples: - - name: UpdateExtension - text: |- - az azurestackhci virtualmachine extension update --resource-group "test-rg" --name "test-extension" \ ---extension-type "CustomScriptExtension" --virtualmachine-name "test-virtualmachine" --publisher "Microsoft.Compute" \ ---settings '{\"commandToExecute\":\"hostname\"}' --type-handler-version "1.10" -""" - -helps['azurestackhci virtualmachine extension show'] = """ - type: command - short-summary: "Get the details of a virtualmachine extension." - examples: - - name: GetExtension - text: |- - az azurestackhci virtualmachine extension show --name "test-extension" --virtualmachine-name "test-virtualmachine" \ ---resource-group "test-rg" -""" - -helps['azurestackhci virtualmachine extension list'] = """ - type: command - short-summary: "List all the extensions for a virtualmachine." - examples: - - name: ListExtensions - text: |- - az azurestackhci virtualmachine extension list --virtualmachine-name "test-virtualmachine" --resource-group "test-rg" -""" - -helps['azurestackhci virtualmachine extension delete'] = """ - type: command - short-summary: "Delete a virtualmachine extension." - examples: - - name: DeleteExtension - text: |- - az azurestackhci virtualmachine extension delete --name "test-extension" --virtualmachine-name "test-virtualmachine" \ ---resource-group "test-rg" -""" - -helps['azurestackhci virtualmachine extension wait'] = """ - type: command - short-summary: "Place the CLI in a waiting state until a condition of the virtualmachine extension is met." - examples: - - name: Pause executing next line of CLI script until the virtualmachine extension is successfully created. - text: |- - az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" \ ---resource-group "test-rg" --created - - name: Pause executing next line of CLI script until the virtualmachine extension is successfully updated. - text: |- - az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" \ ---resource-group "test-rg" --updated - - name: Pause executing next line of CLI script until the virtualmachine extension is successfully deleted. - text: |- - az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" \ ---resource-group "test-rg" --deleted - -# helps['azurestackhci cluster'] = """ -# type: group -# short-summary: Manage cluster with azurestackhci -# """ - -# helps['azurestackhci cluster list'] = """ -# type: command -# short-summary: "List all HCI clusters in a resource group. And List all HCI clusters in a subscription." -# examples: -# - name: List clusters in a given resource group -# text: |- -# az azurestackhci cluster list --resource-group "test-rg" -# - name: List clusters in a given subscription -# text: |- -# az azurestackhci cluster list -# """ - -# helps['azurestackhci cluster show'] = """ -# type: command -# short-summary: "Get HCI cluster." -# examples: -# - name: Get cluster -# text: |- -# az azurestackhci cluster show --name "myCluster" --resource-group "test-rg" -# """ - -# helps['azurestackhci cluster create'] = """ -# type: command -# short-summary: "Create an HCI cluster." -# examples: -# - name: Create cluster -# text: |- -# az azurestackhci cluster create --location "East US" --aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847d\ -# fc" --aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" --name "myCluster" --resource-group "test-rg" -# """ - -# helps['azurestackhci cluster update'] = """ -# type: command -# short-summary: "Update an HCI cluster." -# examples: -# - name: Update cluster -# text: |- -# az azurestackhci cluster update --tags tag1="value1" tag2="value2" --name "myCluster" --resource-group \ -# "test-rg" -# """ - -# helps['azurestackhci cluster delete'] = """ -# type: command -# short-summary: "Delete an HCI cluster." -# examples: -# - name: Delete cluster -# text: |- -# az azurestackhci cluster delete --name "myCluster" --resource-group "test-rg" -# """ diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py deleted file mode 100644 index a21cdba9516..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_params.py +++ /dev/null @@ -1,430 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=too-many-lines -# pylint: disable=too-many-statements - -from azure.cli.core.commands.parameters import ( - tags_type, - get_three_state_flag, - resource_group_name_type, - get_location_type, - get_enum_type -) -from azure.cli.core.commands.validators import ( - get_default_location_from_resource_group, - validate_file_or_dict -) -from azext_azurestackhci.action import ( - AddGalleryimagesExtendedLocation, - AddNetworkinterfacesExtendedLocation, - AddVirtualharddisksExtendedLocation, - AddVirtualmachinesExtendedLocation, - AddHardwareProfile, - AddNetworkProfile, - AddSecurityProfile, - AddVirtualnetworksExtendedLocation, - AddLinuxConfiguration, - AddStoragecontainersExtendedLocation, - AddStatus -) - -def load_arguments(self, _): - - with self.argument_context('azurestackhci image list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci image create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddGalleryimagesExtendedLocation, nargs='+', help='') - c.argument('container_name', type=str, help='Container Name for storage container') - c.argument('image_path', type=str, help='location of the image the gallery image should be created from') - c.argument('os_type', type=str, help='OS Type [Windows, Linux]') - c.argument('offer', type=str, help='offer for Marketplace image') - c.argument('publisher', type=str, help='publisher for Marketplace image') - c.argument('sku', type=str, help='sku for Marketplace image') - c.argument('version', type=str, help='version for Marketplace image') - - with self.argument_context('azurestackhci image update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image', id_part='name') - c.argument('tags', tags_type) - - with self.argument_context('azurestackhci image delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image', id_part='name') - - with self.argument_context('azurestackhci image show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image', id_part='name') - - with self.argument_context('azurestackhci galleryimage list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci galleryimage create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddGalleryimagesExtendedLocation, nargs='+', help='') - c.argument('storagepath_id', type=str, help='Azure ID of the Storage Path which is used to store the Gallery Images.') - c.argument('image_path', type=str, help='location of the image the gallery image should be created from') - c.argument('hyper-v-generation',type=str, help='HyperV Generation [V1, V2]') - c.argument('os_type', arg_type=get_enum_type(['Windows', 'Linux']), help='OS Type') - c.argument('offer', type=str, help='offer for Marketplace image') - c.argument('publisher', type=str, help='publisher for Marketplace image') - c.argument('sku', type=str, help='sku for Marketplace image') - c.argument('version', type=str, help='version for Marketplace image') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci galleryimage update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image', id_part='name') - c.argument('tags', tags_type) - - with self.argument_context('azurestackhci galleryimage delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci galleryimage show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the gallery image', id_part='name') - - with self.argument_context('azurestackhci networkinterface list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci networkinterface create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the network interface') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddNetworkinterfacesExtendedLocation, nargs='+', help='') - c.argument('ip_configurations', type=validate_file_or_dict, help='IPConfigurations - A list of ' - 'IPConfigurations of the network interface. Expected value: json-string/@json-file.') - c.argument('mac_address', type=str, help='MacAddress - The MAC address of the network interface.') - c.argument('dns_servers', nargs='+', help='Space-separated list of DNS server IP addresses.') - c.argument('subnet_id', type=str, help='ID of the subnet or network to create the network interface on') - c.argument('gateway', type=str, help='Gateway for network interface') - c.argument('ip_address', type=str, help='ip_address - Private IP address of the IP configuration.') - c.argument('ip_allocation_method', type=str, help='ip_allocation_method - The private IP address allocation method. Possible values include: Static, Dynamic', deprecate_info=c.deprecate(target='--ip-allocation-method')) - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci networkinterface update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the network interface', id_part='name') - c.argument('tags', tags_type) - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci networkinterface delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the network interface', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci networkinterface show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the network interface', id_part='name') - - with self.argument_context('azurestackhci virtualharddisk list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci virtualharddisk create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual hard disk') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddVirtualharddisksExtendedLocation, nargs='+', help='') - c.argument('block_size_bytes', type=int, help='Block size') - c.argument('disk_size_bytes', type=int, help='Size of the disk in GB', deprecate_info=c.deprecate(target='--disk-size-bytes', redirect='--disk-size-gb', hide=True)) - c.argument('disk_size_gb', type=int, help='Size of the disk in GB') - c.argument('dynamic', arg_type=get_three_state_flag(), help='Boolean for enabling dynamic sizing on the ' - 'virtual hard disk') - c.argument('logical_sector_bytes', type=int, help='Logical Sector') - c.argument('physical_sector_bytes', type=int, help='Physical Sector') - c.argument('disk_file_format', type=str, help='Disk File Format [vhd, vhdx]') - c.argument('storagepath_id',type=str,help='Azure ID of the Storage Path which is used to store the VHD.') - c.argument('disk_file_format', type=str, help='Disk File Format [vhd, vhdx]') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualharddisk update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual hard disk', id_part='name') - c.argument('tags', tags_type) - - with self.argument_context('azurestackhci virtualharddisk delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual hard disk', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualharddisk show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual hard disk', id_part='name') - - with self.argument_context('azurestackhci virtualmachine list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci virtualmachine create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddVirtualmachinesExtendedLocation, nargs='+', help='') - c.argument('hardware_profile', action=AddHardwareProfile, nargs='+', help='HardwareProfile - Specifies the ' - 'hardware settings for the virtual machine.') - c.argument('image_reference', type=str, help='ImageReference - gallery image name the vm should use to provision') - c.argument('os_disk', type=str, help='Os Disk - name of the vhd the vm should use to provision') - c.argument('data_disk', type=str, nargs='+', help='List of data disk to attach to the vm') - c.argument('storagepath_id', type=str, help='Azure ID of the Storage Path pointing to the location where the VM config files are stored.') - c.argument('network_profile', action=AddNetworkProfile, nargs='+', help='NetworkProfile - describes the ' - 'network configuration the virtual machine') - c.argument('nic_id', type=str, help='nicID - Network Interface id to attach to the virtual machine.') - ## Don't change the order of the lines, because linux_configuration builds on os_profile; - ## Starting here - c.argument('os_profile', type=validate_file_or_dict, help='OsProfile - describes the configuration of the ' - 'operating system and sets login data Expected value: json-string/@json-file.') - c.argument('linux_configuration', action=AddLinuxConfiguration, nargs='*', help='Linux configuration - ' - 'specifies ssh keys for the virtual machine') - ## end here - c.argument('windows_configuration', type=validate_file_or_dict, help='Windows configuration -' - 'Windows Configuration for the virtual machine ') - c.argument('security_profile', action=AddSecurityProfile, nargs='+', help='SecurityProfile - Specifies the ' - 'security settings for the virtual machine.') - c.argument('enable_tpm', help='Enable tpm for security profile', nargs='?', const=True, default=False) - c.argument('storage_profile', type=validate_file_or_dict, help='StorageProfile - contains information about ' - 'the disks and storage information for the virtual machine Expected value: json-string/@json-file.') - c.argument('vm_size', type=str, help='VMSize - stock vm hardware configuration to use') - c.argument('admin_username', type=str, help='Admin Username') - c.argument('admin_password', type=str, help='Admin Password') - c.argument('computer_name', type=str, help='Computer Name') - c.argument('disable_vm_management', arg_type=get_three_state_flag(), help='Boolean for enabling VM arc for server agent') - c.argument('ssh_public_keys', type=str, nargs='*', help='Path to ssh public key(s) for linux vm') - c.argument('allow_password_auth', arg_type=get_three_state_flag(), help='Enable password authentication for Linux VM') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualmachine update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('tags', tags_type) - c.argument('cpu_count', type=int, help='number of processors for the virtual machine') - c.argument('memory_gb', type=int, help='RAM in gb for the virtual machine', deprecate_info=c.deprecate(target='--memory-gb', redirect='--memory-mb', hide=True)) - c.argument('memory_mb', type=int, help='RAM in mb for the virtual machine') - c.argument('vnic_names', type=str, nargs='+', help='List of vnic names') - c.argument('vhd_names', type=str, nargs='+', help='List of virtual hard disk names') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualmachine delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualmachine show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - - with self.argument_context('azurestackhci virtualmachine start') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualmachine restart') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualmachine stop') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualmachine vnic add') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('vnic_names', type=str, nargs='+', help='List of vnic names') - - with self.argument_context('azurestackhci virtualmachine vnic remove') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual machine', id_part='name') - c.argument('vnic_names', type=str, nargs='+', help='List of vnic names') - - with self.argument_context('azurestackhci virtualnetwork list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci virtualnetwork create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual network') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddVirtualnetworksExtendedLocation, nargs='+', help='') - c.argument('network_type', type=str, help='Type of the network') - c.argument('subnets', type=validate_file_or_dict, help='Subnet - list of subnets under the virtual network. ' - 'All other subnet properties in the cli parameters will be ignored if this is provided. ' - 'Expected value: json-string/@json-file.') - c.argument('address_prefix', type=str, help='Cidr for this subnet - IPv4, IPv6') - c.argument('ip_allocation_method', type=str, help='IPAllocationMethod - The IP address allocation method. Possible values include: Static, Dynamic') - c.argument('ip_pools', type=validate_file_or_dict, help='ippools') - c.argument('ip_pool_type', type=str, help='ip pool type') - c.argument('ip_pool_start', type=str, help='start of the ip address pool') - c.argument('ip_pool_end', type=str, help='end of the ip address pool') - c.argument('vlan', type=int, help='Vlan to use for the subnet') - c.argument('vm_switch_name', type=str, help='Name of the VM switch') - c.argument('dns_servers', nargs='+', help='Space-separated list of DNS server IP addresses.') - c.argument('routes', type=validate_file_or_dict, help='Collection of routes contained within a route table') - c.argument('gateway', type=str, help='Gateway') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualnetwork update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual network', id_part='name') - c.argument('tags', tags_type) - - with self.argument_context('azurestackhci virtualnetwork delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual network', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci virtualnetwork show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the virtual network', id_part='name') - - with self.argument_context('azurestackhci storagepath list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('azurestackhci storagepath create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the storage path') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('extended_location', action=AddStoragecontainersExtendedLocation, nargs='+', help='') - c.argument('path', type=str, help='Path on a disk to create storagepath', required=True) - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci storagepath update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the storage path', id_part='name') - c.argument('tags', tags_type) - - with self.argument_context('azurestackhci storagepath delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the storage path', id_part='name') - c.argument('polling_interval', type=str, help='ARM polling interval for long running operations.') - - with self.argument_context('azurestackhci storagepath show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', type=str, help='Name of the storage path', id_part='name') - - with self.argument_context('azurestackhci virtualmachine extension create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('name', help='The name of the extension.') - c.argument('virtualmachine_name', help='The name of the virtual machine where the extension should be created or updated.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' - 'the extension configuration has not changed.') - c.argument('publisher', type=str, help='The name of the extension handler publisher.') - c.argument('extension_type', type=str, help='Specify the type of the extension; an example ' - 'is "CustomScriptExtension".') - c.argument('type_handler_version', type=str, help='Specify the version of the script handler.') - c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' - 'should be automatically upgraded by the platform if there is a newer version available.') - c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' - 'use a newer minor version if one is available at deployment time. Once deployed, however, the ' - 'extension will not upgrade minor versions unless redeployed, even with this property set to true.') - c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' - 'Expected value: json-string/json-file/@json-file.') - c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' - 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' - 'value: json-string/json-file/@json-file.') - c.argument('instance_view_type', help='Specify the type of the extension; an example is ' - '"CustomScriptExtension".', arg_group='Instance View') - c.argument('inst_handler_version', help='Specify the version of the script handler.', - arg_group='Instance View') - c.argument('status', action=AddStatus, nargs='+', help='Instance view status.', arg_group='Instance View') - - with self.argument_context('azurestackhci virtualmachine extension update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.', id_part='name') - c.argument('name', help='The name of the extension.') - c.argument('tags', tags_type) - c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' - 'the extension configuration has not changed.') - c.argument('publisher', type=str, help='The name of the extension handler publisher.') - c.argument('extension_type', type=str, help='Specify the type of the extension; an example ' - 'is "CustomScriptExtension".') - c.argument('type_handler_version', type=str, help='Specify the version of the script handler.') - c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' - 'should be automatically upgraded by the platform if there is a newer version available.') - c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' - 'use a newer minor version if one is available at deployment time. Once deployed, however, the ' - 'extension will not upgrade minor versions unless redeployed, even with this property set to true.') - c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' - 'Expected value: json-string/json-file/@json-file.') - c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' - 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' - 'value: json-string/json-file/@json-file.') - - with self.argument_context('azurestackhci virtualmachine extension show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.', id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - - with self.argument_context('azurestackhci virtualmachine extension list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.') - - with self.argument_context('azurestackhci virtualmachine extension delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('virtualmachine_name', help='The name of the virtual machine where the extension should be deleted from.', - id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - - with self.argument_context('azurestackhci virtualmachine extension wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('virtualmachine_name', help='The name of the virtual machine containing the extension.', - id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - - # with self.argument_context('azurestackhci cluster list') as c: - # c.argument('resource_group_name', resource_group_name_type) - - # with self.argument_context('azurestackhci cluster show') as c: - # c.argument('resource_group_name', resource_group_name_type) - # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' - # 'cluster.', id_part='name') - - # with self.argument_context('azurestackhci cluster create') as c: - # c.argument('resource_group_name', resource_group_name_type) - # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' - # 'cluster.') - # c.argument('tags', tags_type) - # c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - # validator=get_default_location_from_resource_group) - # c.argument('aad_client_id', type=str, help='App id of cluster AAD identity.') - # c.argument('aad_tenant_id', type=str, help='Tenant id of cluster AAD identity.') - - # with self.argument_context('azurestackhci cluster update') as c: - # c.argument('resource_group_name', resource_group_name_type) - # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' - # 'cluster.', id_part='name') - # c.argument('tags', tags_type) - - # with self.argument_context('azurestackhci cluster delete') as c: - # c.argument('resource_group_name', resource_group_name_type) - # c.argument('name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' - # 'cluster.', id_part='name') diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py deleted file mode 100644 index 6a5a6775a24..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/_validators.py +++ /dev/null @@ -1,279 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from knack.util import CLIError -from msrestazure.tools import parse_resource_id -import re -import ipaddress -from ._client_factory import cf_galleryimage, cf_virtualnetwork - -default_ip_allocation_method = "Dynamic" -all_digits_regex = "^[0-9]+$" -windows_not_allowed_chars_regex = "[\\\\`~!@#$%^&*()=+_\[\]\{\}|;:.'\",<>/?]" -linux_not_allowed_chars_regex = "[\\\\`~!@#$%^&*()=+_\[\]\{\}|;:'\",<>/?]" -windows_computername_maxlength = 15 -linux_computername_maxlength = 64 - -def vm_create_validator(cmd, namespace): - """ - Validates parameters for vm creation operation - """ - os_profile = namespace.os_profile or dict() - enable_gm_flag_set = False - if 'linuxConfiguration' in os_profile and os_profile['linuxConfiguration'] is not None: - if 'provisionVMAgent' in os_profile['linuxConfiguration']: - enable_gm_flag_set = enable_gm_flag_set or bool(os_profile['linuxConfiguration']['provisionVMAgent']) - if 'windowsConfiguration' in os_profile and os_profile['windowsConfiguration'] is not None: - if 'provisionVMAgent' in os_profile['windowsConfiguration']: - enable_gm_flag_set = enable_gm_flag_set or bool(os_profile['windowsConfiguration']['provisionVMAgent']) - - enable_gm_flag_set = enable_gm_flag_set or not bool(namespace.disable_vm_management) - - is_username_provided = bool(os_profile.get('adminUsername', None) or namespace.admin_username) - is_password_provided = bool(os_profile.get('adminPassword', None) or namespace.admin_password) - - if enable_gm_flag_set == True and not (is_username_provided and is_password_provided): - raise CLIError('Admin username and password must be provided for enabling Guest Mangement. For disabling Guest Management, use --disable-vm-management') - - osprofile_ostype = os_profile.get('osType', None) - osdisk_id = namespace.os_disk - computer_name = namespace.computer_name - ostype = osprofile_ostype - - if osdisk_id and osprofile_ostype is None: - raise CLIError("Os type must be provided if --os-disk is provided. " - "To provide os type, use this format, --os-profile '{\\\"osType\\\":\\\"Windows\\\"}'") - - if namespace.image_reference: - res = parse_resource_id(namespace.image_reference) - # Use resource_group of image if full resource id is provided; otherwise use the global one - galleryimage = _fetch_galleryimage(cmd.cli_ctx, res.get('resource_group', namespace.resource_group_name), res['name']) - galleryimage_os_type = galleryimage.properties.os_type - - if osprofile_ostype and galleryimage_os_type: - if osprofile_ostype.lower() != galleryimage_os_type.lower(): - raise CLIError("The os type provided is not the correct os type of the gallery image, " - "the os type of this virtual machine should be {}".format(galleryimage_os_type)) - - ostype = galleryimage_os_type or osprofile_ostype - if ostype: - ostype = ostype.lower() - - if enable_gm_flag_set and not namespace.allow_password_auth: - if ostype is None: - raise CLIError("Please provide osType if you are enabling VM Management. To provide osType, use this format --os-profile '{\\\"osType\\\":\\\"Windows\\\"}") - elif ostype == 'linux': - raise CLIError("Guest Management for Azure Stack HCI VMs is currently in Preview. " - "This command needs password-based authentication for the created Linux VM. Use --allow-password-auth" - "\nFor disabling Guest Management, use --disable-vm-management") - - _validate_computer_name(computer_name, ostype) - -def _fetch_galleryimage(cli_ctx, resource_group, name): - image_client = cf_galleryimage(cli_ctx=cli_ctx) - - img = image_client.retrieve(resource_group, name) - return img - -def _validate_computer_name(computer_name, ostype): - if computer_name and ostype: - ostype = ostype.lower() - if ostype == 'windows': - if len(computer_name) > windows_computername_maxlength or re.search(all_digits_regex, computer_name) or re.search(windows_not_allowed_chars_regex, computer_name): - raise CLIError("Windows computer name cannot be more than 15 characters long, be entirely numeric, or contain these characters: ` ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \\ | ; : ' . \" , < > / ?") - elif ostype == 'linux': - if len(computer_name) > linux_computername_maxlength or re.search(linux_not_allowed_chars_regex, computer_name): - raise CLIError("Linux host name cannot exceed 64 characters in length or contain these characters: ` ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , < > / ?") - - -def vnet_create_validator(cmd, namespace): - """ - Validates parameters for vnic creation operation - """ - - routes = namespace.routes or dict() - if routes: - default_gateway = _get_default_gateway_from_routes_dict(routes) - if default_gateway and namespace.gateway: - raise CLIError("Please provide either --gateway or a route with address_prefix 0.0.0.0/0, not both") - _validate_vnet_parameters(namespace) - - -def _validate_vnet_parameters(namespace): - """ - Validates conditions for Static/Dynamic allocation for virtualnetwork - """ - - - if namespace.subnets: - for subnet in namespace.subnets: - _validate_subnet(subnet) - - if namespace.ip_allocation_method == "Static": - # Validate Static-IP conditions - if not (bool(namespace.address_prefix) | bool(namespace.subnets)): - raise CLIError("Address-prefix must be provided if --ip-allocation-method is Static. Please use --address-prefix or --subnets to provide address prefix for virtualnetwork") - - if namespace.address_prefix and not any((namespace.ip_pools, namespace.ip_pool_start, namespace.ip_pool_end)): - # Validate only address-prefix when ip-pools is not provided - _validate_cidr(namespace.address_prefix) - - # Validate IP-Pools from --ip-pools parameter - _validate_ip_pools(namespace.address_prefix, namespace.ip_pools) - - # Validate IP-Pools from --ip-pool-start / --ip-pool-end parameters - if namespace.ip_pool_start and namespace.ip_pool_end: - ip_pools = [{'start' : namespace.ip_pool_start, 'end': namespace.ip_pool_end}] - _validate_ip_pools(namespace.address_prefix, ip_pools) - elif bool(namespace.ip_pool_start) ^ bool(namespace.ip_pool_end): - raise CLIError("Missing --ip-pool-start or --ip-pool-end. Both the parameters need to be provided together") - - _validate_dns_servers(namespace.dns_servers) - else: - # Validate Dynamic-IP conditions - if any((namespace.address_prefix, namespace.ip_pools, namespace.ip_pool_start, namespace.ip_pool_end, namespace.dns_servers)): - raise CLIError("Unsupported configuration. --address-prefix / --ip-pools / --ip-pool-start / --ip-pool-end / dns-servers can only be used when --ip-allocation-method is 'Static'") - - -def _validate_subnet(subnet): - """ - Validate subnet fields - """ - - subnet_properties = subnet.get('properties', {}) - address_prefix = subnet_properties.get('addressPrefix', None) - ip_allocation_method = subnet_properties.get('ipAllocationMethod', None) - ip_pools = subnet_properties.get('ipPools', None) - - if ip_allocation_method == "Static": - # Validate Static-IP conditions - if not address_prefix: - raise CLIError("Missing 'addressPrefix' field in subnets json string/file. 'addressPrefix' must be provided when 'ipAllocationMethod' is Static.") - elif address_prefix and not ip_pools: - # Validate only address-prefix when IP-Pools is not provided - _validate_cidr(address_prefix) - else: - # Validate IP-Pools - _validate_ip_pools(address_prefix, ip_pools) - else: - # Validate Dynamic-IP conditions - if any((address_prefix, ip_pools)): - raise CLIError("'addressPrefix' or 'ipPools' fields cannot be used in subnet when 'ipAllocationMethod' is Dynamic") - - -def _validate_ip_pools(address_prefix, ip_pools): - """ - Validates if the start or end IP address is within the cidr range - """ - - # Validate only if both address-prefix and ip-pools are present - if address_prefix and ip_pools: - address_prefix = _validate_cidr(address_prefix) - for ip_pool in ip_pools: - if ip_pool.get('start') and ip_pool.get('end'): - start = _validate_ip_address(ip_pool.get('start')) - end = _validate_ip_address(ip_pool.get('end')) - else: - raise CLIError("Missing start/end IP address in --ip-pools or --subnets. Please provide both start and end IP addresses.") - - # Validation for start/end IP range - if start not in address_prefix or end not in address_prefix: - raise CLIError("Invalid Input: Range {} {} is not within subnet address prefix {}".format(start, end, address_prefix)) - - -def _validate_cidr(cidr): - """ - Validates the network CIDR - """ - - try: - net_cidr = ipaddress.ip_network(cidr) - except: - raise CLIError("Invalid CIDR provided: {}".format(cidr)) - return net_cidr - - -def _validate_dns_servers(dnsservers): - """ - Validates DNS-Servers - """ - if dnsservers: - [_validate_ip_address(dnsserver) for dnsserver in dnsservers] - - -def _validate_ip_address(ip): - """ - Validates the IP address - """ - - try: - net_ip = ipaddress.ip_address(ip) - except: - raise CLIError("Invalid IP address: {}".format(ip)) - return net_ip - - -def _get_default_gateway_from_routes_dict(routes): - for route in routes: - address_prefix = route.get('properties', None).get('address_prefix', None) - next_hop_ip = route.get('properties', None).get('next_hop_ip_address', None) - if address_prefix == "0.0.0.0/0": - return next_hop_ip - - -def vnic_create_validator(cmd, namespace): - """ - Validates parameters for vnic creation operation - """ - - subnet_ip_allocation_method = default_ip_allocation_method - subnet_properties = None - - res = parse_resource_id(namespace.subnet_id) - vnet = _fetch_virtualnetwork(cmd.cli_ctx, res.get('resource_group', namespace.resource_group_name), res['name']) - - if len(vnet.properties.subnets): - # MOC supports only 1 subnet - subnet_properties = vnet.properties.subnets[0].properties - if subnet_properties: - subnet_ip_allocation_method = subnet_properties.ip_allocation_method or default_ip_allocation_method - subnet_address_prefix = subnet_properties.address_prefix - if subnet_address_prefix and namespace.ip_address: - _validate_vnic_static_ip_address(subnet_address_prefix, namespace.ip_address) - - if subnet_ip_allocation_method != "Static" and any((namespace.ip_address, namespace.gateway)): - raise CLIError("--ip-address and --gateway can be provided only if the associated virtualNetwork's --ip-allocation-method is Static") - - if subnet_ip_allocation_method == "Static" and namespace.gateway is None: - # Use the default gateway set in the vnet - if subnet_properties.route_table and subnet_properties.route_table.properties: - namespace.gateway = _get_default_gateway_from_routes_list(subnet_properties.route_table.properties.routes) - -def _get_default_gateway_from_routes_list(routes): - if routes is None: - return - for route in routes: - if route.properties and route.properties.address_prefix == "0.0.0.0/0": - return route.properties.next_hop_ip_address - - -def _fetch_virtualnetwork(cli_ctx, resource_group, name): - vnet_client = cf_virtualnetwork(cli_ctx=cli_ctx) - - vnet = vnet_client.retrieve(resource_group, name) - return vnet - -def _validate_vnic_static_ip_address(subnet_address_prefix, ip_address): - """ - Validates if the IP-Address provided by the user is within the subnet range - """ - ip = ipaddress.ip_address(ip_address) - network = ipaddress.ip_network(subnet_address_prefix) - if ip not in network: - raise CLIError("ip-address provided is not within the associated virtualnetwork's(or subnet's) address-prefix range. Please provide an IP address within the range of address-prefix.") diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py deleted file mode 100644 index 412ecbd14c3..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/action.py +++ /dev/null @@ -1,353 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access - -import argparse -from collections import defaultdict -from knack.log import get_logger -from knack.util import CLIError -import json -from azure.cli.core.azclierror import InvalidArgumentValueError - - -logger = get_logger(__name__) - -class AddGalleryimagesExtendedLocation(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.extended_location = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'type': - d['type'] = v[0] - elif kl == 'name': - d['name'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' - 'type, name'.format(k)) - return d - - -class AddNetworkinterfacesExtendedLocation(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.extended_location = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'type': - d['type'] = v[0] - elif kl == 'name': - d['name'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' - 'type, name'.format(k)) - return d - - -class AddVirtualharddisksExtendedLocation(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.extended_location = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'type': - d['type'] = v[0] - elif kl == 'name': - d['name'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' - 'type, name'.format(k)) - return d - - -class AddVirtualmachinesExtendedLocation(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.extended_location = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'type': - d['type'] = v[0] - elif kl == 'name': - d['name'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' - 'type, name'.format(k)) - return d - - -class AddHardwareProfile(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.hardware_profile = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - dynamic_memory_config = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'vm-size': - d['vm_size'] = v[0] - elif kl == 'processors': - d['processors'] = v[0] - elif kl == 'memory-mb': - d['memory_mb'] = v[0] - elif kl == 'maximum-memory-mb': - dynamic_memory_config['maximum_memory_mb'] = int(v[0]) - elif kl == 'minimum-memory-mb': - dynamic_memory_config['minimum_memory_mb'] = int(v[0]) - elif kl == 'memory-gb': - logger.warning("'memory-gb' setting under option --hardware-profile has been deprecated and will be removed in a future release. Use 'memory-mb' instead.") - d['memory_mb'] = int(v[0]) * 1024 - elif kl == 'maximum-memory-gb': - logger.warning("'maximum-memory-gb' setting under option --hardware-profile has been deprecated and will be removed in a future release. Use 'maximum-memory-mb' instead.") - dynamic_memory_config['maximum_memory_mb'] = int(v[0]) * 1024 - elif kl == 'minimum-memory-gb': - logger.warning("'minimum-memory-gb' setting under option --hardware-profile has been deprecated and will be removed in a future release. Use 'minimum-memory-mb' instead.") - dynamic_memory_config['minimum_memory_mb'] = int(v[0]) * 1024 - elif kl == 'target-memory-buffer': - dynamic_memory_config['target_memory_buffer'] = int(v[0]) - else: - raise CLIError('Unsupported Key {} is provided for parameter hardware_profile. All possible keys are: ' - 'vm-size, processors, memory-mb, maximum-memory-mb, minimum-memory-mb, target-memory-buffer'.format(k)) - if dynamic_memory_config: - d['dynamic_memory_config'] = dynamic_memory_config - return d - - -class AddNetworkProfile(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.network_profile = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'network-interfaces': - d['network_interfaces'] = (json.loads(v[0])) - else: - raise CLIError('Unsupported Key {} is provided for parameter network_profile. All possible keys are: ' - 'network-interfaces'.format(k)) - return d - - -class AddSecurityProfile(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.security_profile = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'secure-boot-enabled': - d['uefi_settings'] = {} - d['uefi_settings']['secure_boot_enabled'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter security_profile. All possible keys are: ' - 'enable-tpm'.format(k)) - return d - - -class AddVirtualnetworksExtendedLocation(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.extended_location = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'type': - d['type'] = v[0] - elif kl == 'name': - d['name'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' - 'type, name'.format(k)) - return d - - -class AddStoragecontainersExtendedLocation(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.extended_location = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'type': - d['type'] = v[0] - elif kl == 'name': - d['name'] = v[0] - else: - raise CLIError('Unsupported Key {} is provided for parameter extended_location. All possible keys are: ' - 'type, name'.format(k)) - return d - -class AddLinuxConfiguration(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - if action: - if hasattr(namespace, 'os_profile'): - if namespace.os_profile is None: - namespace.os_profile = {'linux_configuration': action} - else: - namespace.os_profile['linux_configuration'] = action - else: - namespace.os_profile = {'linux_configuration': action} - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - ssh_data = [] - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'ssh_keys': - ssh_data.extend(json.loads(i) for i in v) - else: - raise CLIError('Unsupported Key {} is provided for parameter linux_configuration. All possible keys are: ' - 'ssh_data'.format(k)) - if ssh_data: - return {'ssh': {'public_keys': ssh_data}} - return {} - -class AddStatus(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.status = action - - def get_action(self, values, option_string): - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise InvalidArgumentValueError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - - if kl == 'code': - d['code'] = v[0] - - elif kl == 'level': - d['level'] = v[0] - - elif kl == 'display-status': - d['display_status'] = v[0] - - elif kl == 'message': - d['message'] = v[0] - - elif kl == 'time': - d['time'] = v[0] - - else: - raise InvalidArgumentValueError( - 'Unsupported Key {} is provided for parameter status. All possible keys are: code, level,' - ' display-status, message, time'.format(k) - ) - - return d \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py deleted file mode 100644 index 77f3490aa70..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/commands.py +++ /dev/null @@ -1,145 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=too-many-statements -# pylint: disable=too-many-locals - -from azure.cli.core.commands import CliCommandType - -from ._validators import vm_create_validator, vnic_create_validator, vnet_create_validator - -def load_command_table(self, _): - - from azext_azurestackhci.generated._client_factory import cf_galleryimage - azurestackhci_galleryimage = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._galleryimages_operations#Galleryim' - 'agesOperations.{}', - client_factory=cf_galleryimage) - with self.command_group('azurestackhci image', azurestackhci_galleryimage, - client_factory=cf_galleryimage) as g: - g.custom_command('list', 'azurestackhci_galleryimage_list') - g.custom_command('create', 'azurestackhci_galleryimage_create') - g.custom_command('update', 'azurestackhci_galleryimage_update') - g.custom_command('delete', 'azurestackhci_galleryimage_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_galleryimage_show') - - from azext_azurestackhci.generated._client_factory import cf_galleryimage - azurestackhci_galleryimage = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._galleryimages_operations#Galleryim' - 'agesOperations.{}', - client_factory=cf_galleryimage) - with self.command_group('azurestackhci galleryimage', azurestackhci_galleryimage, - client_factory=cf_galleryimage) as g: - g.custom_command('list', 'azurestackhci_galleryimage_list') - g.custom_command('create', 'azurestackhci_galleryimage_create') - g.custom_command('update', 'azurestackhci_galleryimage_update') - g.custom_command('delete', 'azurestackhci_galleryimage_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_galleryimage_show') - - from azext_azurestackhci.generated._client_factory import cf_networkinterface - azurestackhci_networkinterface = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._networkinterfaces_operations#Netwo' - 'rkinterfacesOperations.{}', - client_factory=cf_networkinterface) - with self.command_group('azurestackhci networkinterface', azurestackhci_networkinterface, - client_factory=cf_networkinterface) as g: - g.custom_command('list', 'azurestackhci_networkinterface_list') - g.custom_command('create', 'azurestackhci_networkinterface_create', validator=vnic_create_validator) - g.custom_command('update', 'azurestackhci_networkinterface_update') - g.custom_command('delete', 'azurestackhci_networkinterface_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_networkinterface_show') - - from azext_azurestackhci.generated._client_factory import cf_virtualharddisk - azurestackhci_virtualharddisk = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._virtualharddisks_operations#Virtua' - 'lharddisksOperations.{}', - client_factory=cf_virtualharddisk) - with self.command_group('azurestackhci virtualharddisk', azurestackhci_virtualharddisk, - client_factory=cf_virtualharddisk) as g: - g.custom_command('list', 'azurestackhci_virtualharddisk_list') - g.custom_command('create', 'azurestackhci_virtualharddisk_create') - g.custom_command('update', 'azurestackhci_virtualharddisk_update') - g.custom_command('delete', 'azurestackhci_virtualharddisk_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_virtualharddisk_show') - - from azext_azurestackhci.generated._client_factory import cf_virtualmachine - azurestackhci_virtualmachine = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._virtualmachines_operations#Virtual' - 'machinesOperations.{}', - client_factory=cf_virtualmachine) - with self.command_group('azurestackhci virtualmachine', azurestackhci_virtualmachine, - client_factory=cf_virtualmachine) as g: - g.custom_command('list', 'azurestackhci_virtualmachine_list') - g.custom_command('create', 'azurestackhci_virtualmachine_create', validator=vm_create_validator) - g.custom_command('update', 'azurestackhci_virtualmachine_update') - g.custom_command('delete', 'azurestackhci_virtualmachine_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_virtualmachine_show') - g.custom_command('start', 'azurestackhci_virtualmachine_start') - g.custom_command('stop', 'azurestackhci_virtualmachine_stop') - g.custom_command('restart', 'azurestackhci_virtualmachine_restart') - - with self.command_group('azurestackhci virtualmachine vnic', azurestackhci_virtualmachine, - client_factory=cf_virtualmachine) as g: - g.custom_command('add', 'azurestackhci_virtualmachine_vnic_add') - g.custom_command('remove', 'azurestackhci_virtualmachine_vnic_remove', confirmation=True) - - from azext_azurestackhci.generated._client_factory import cf_virtualnetwork - azurestackhci_virtualnetwork = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._virtualnetworks_operations#Virtual' - 'networksOperations.{}', - client_factory=cf_virtualnetwork) - with self.command_group('azurestackhci virtualnetwork', azurestackhci_virtualnetwork, - client_factory=cf_virtualnetwork) as g: - g.custom_command('list', 'azurestackhci_virtualnetwork_list') - g.custom_command('create', 'azurestackhci_virtualnetwork_create', validator=vnet_create_validator) - g.custom_command('update', 'azurestackhci_virtualnetwork_update') - g.custom_command('delete', 'azurestackhci_virtualnetwork_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_virtualnetwork_show') - - from azext_azurestackhci.generated._client_factory import cf_storagecontainer - azurestackhci_storagecontainer = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._storagecontainers_operations#Stora' - 'gecontainersOperations.{}', - client_factory=cf_storagecontainer) - with self.command_group('azurestackhci storagepath', azurestackhci_storagecontainer, - client_factory=cf_storagecontainer) as g: - g.custom_command('list', 'azurestackhci_storagecontainer_list') - g.custom_command('create', 'azurestackhci_storagecontainer_create') - g.custom_command('update', 'azurestackhci_storagecontainer_update') - g.custom_command('delete', 'azurestackhci_storagecontainer_delete', confirmation=True) - g.custom_command('show', 'azurestackhci_storagecontainer_show') - - from azext_azurestackhci.generated._client_factory import cf_arc_vmextension - azurestackhci_arcvmextension = CliCommandType( - operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._arc_vmextensions_operations#ArcVmExtensions' - 'Operations.{}', - client_factory=cf_arc_vmextension) - with self.command_group('azurestackhci virtualmachine extension', azurestackhci_arcvmextension, - client_factory=cf_arc_vmextension) as g: - g.custom_command('create', 'azurestackhci_vmextension_create') - g.custom_command('show', 'azurestackhci_vmextension_show') - g.custom_command('delete', 'azurestackhci_vmextension_delete', confirmation=True) - g.custom_command('list', 'azurestackhci_vmextension_list') - g.custom_wait_command('wait', 'azurestackhci_vmextension_show') - g.custom_command('update', 'azurestackhci_vmextension_update') - - # from azext_azurestackhci.generated._client_factory import cf_cluster - # azurestackhci_cluster = CliCommandType( - # operations_tmpl='azext_azurestackhci.vendored_sdks.azurestackhci.operations._clusters_operations#ClustersOperat' - # 'ions.{}', - # client_factory=cf_cluster) - # with self.command_group('azurestackhci cluster', azurestackhci_cluster, client_factory=cf_cluster) as g: - # g.custom_command('list', 'azurestackhci_cluster_list') - # g.custom_show_command('show', 'azurestackhci_cluster_show') - # g.custom_command('create', 'azurestackhci_cluster_create') - # g.custom_command('update', 'azurestackhci_cluster_update') - # g.custom_command('delete', 'azurestackhci_cluster_delete', confirmation=True) - - with self.command_group('azurestackhci', is_experimental=True): - pass diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py deleted file mode 100644 index a5078deb7a0..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/custom.py +++ /dev/null @@ -1,847 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=too-many-lines - -from azure.cli.core.azclierror import ArgumentUsageError, CLIError -from knack.prompting import prompt_y_n, NoTTYException -from azure.cli.core.util import sdk_no_wait -from .helpers import read_file -import json -import re - - -def azurestackhci_galleryimage_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_galleryimage_create(client, - resource_group_name, - name, - location, - tags=None, - extended_location=None, - storagepath_id=None, - image_path=None, - os_type=None, - offer=None, - publisher=None, - sku=None, - version=None, - polling_interval=None): - galleryimages = {} - galleryimages['location'] = location - galleryimages['tags'] = tags - galleryimages['extended_location'] = extended_location - galleryimages['properties'] = {} - galleryimages['properties']['storagepath_id'] = storagepath_id - galleryimages['properties']['image_path'] = image_path - galleryimages['properties']['identifier'] = None - - if (os_type is not None): - if (os_type.lower() == 'windows'): - os_type = 'Windows' - elif (os_type.lower() == 'linux'): - os_type = 'Linux' - else: - raise ArgumentUsageError("The supported os types for image creation are 'Windows' and 'Linux'.") - - galleryimages['properties']['os_type'] = os_type - - if (not re.match('[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$', name)): - raise ArgumentUsageError("The name must start and end with an alphanumeric character and must contain all alphanumeric characters or '-', '.', or '_'") - - if ((offer is not None) and (publisher is not None) and (sku is not None) and (version is not None)): - galleryimages['properties']['identifier'] = {} - galleryimages['properties']['identifier']['offer'] = offer - galleryimages['properties']['identifier']['publisher'] = publisher - galleryimages['properties']['identifier']['sku'] = sku - galleryimages['properties']['version'] = {} - galleryimages['properties']['version']['name'] = version - - if (image_path is None and not ((offer is not None) and (publisher is not None) and (sku is not None) and (version is not None))): - raise ArgumentUsageError('All required image specifications are not properly specified. Please specify --image-path which can be a local path or SAS uri , or (--offer, --publisher, --sku, and --version).') - - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.create_or_update(resource_group_name=resource_group_name, - galleryimages_name=name, - galleryimages=galleryimages) - - -def azurestackhci_galleryimage_update(client, - resource_group_name, - name, - tags=None, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.update(resource_group_name=resource_group_name, - galleryimages_name=name, - tags=tags) - - -def azurestackhci_galleryimage_delete(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.delete(resource_group_name=resource_group_name, - galleryimages_name=name) - - -def azurestackhci_galleryimage_show(client, - resource_group_name, - name): - return client.retrieve(resource_group_name=resource_group_name, - galleryimages_name=name) - - -def azurestackhci_networkinterface_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_networkinterface_create(client, - resource_group_name, - name, - location, - tags=None, - extended_location=None, - ip_configurations=None, - subnet_id=None, - gateway=None, - ip_address=None, - ip_allocation_method=None, - mac_address=None, - dns_servers=None, - polling_interval=None): - networkinterfaces = {} - networkinterfaces['location'] = location - networkinterfaces['tags'] = tags - networkinterfaces['extended_location'] = extended_location - networkinterfaces['properties'] = {} - networkinterfaces['properties']['ip_configurations'] = ip_configurations or list() - networkinterfaces['properties']['mac_address'] = mac_address - - if dns_servers: - networkinterfaces['properties']['dns_settings'] = {} - networkinterfaces['properties']['dns_settings']['dns_servers'] = dns_servers - - ipconfig = "" - if ip_configurations is None and subnet_id is None: - raise ArgumentUsageError("Network Interface should have atleast one IP Configuration. Please specify the --ip-configurations parameter and provide a IP Configuration") - if ip_configurations is not None and subnet_id is not None: - message = "Both `--ip-configurations` and `--subnet-id` are provided. This will result in ignoring subnet-id. Please refer help section for details. Do you want to continue?" - if not prompt_y_n(message, 'n'): - raise CLIError('Operation cancelled. Please use the command again with correct parameters') - if ip_configurations is not None: - if len(ip_configurations) == 0: - raise ArgumentUsageError("Empty network ip configurations are provided. Please specify the `--ip-configurations` correctly or pass the `subnet-id`") - i = 0 - while i < len(ip_configurations): - ipconfig = str(ip_configurations[i]).replace("\'","\"") - ipconfig = json.loads(ipconfig) - if ('properties' not in ipconfig or 'subnet' not in ipconfig['properties'] or 'id' not in ipconfig['properties']['subnet']): - raise ArgumentUsageError("Network Interface should have atleast one IP Configuration. \ -Please specify the --ip-configurations parameter and provide IP Configurations along with the subnet id for each ip config and the associated virtual network ID") - i = i + 1 - # IP Configurations - if ip_configurations is None and subnet_id is not None: - if len(subnet_id.strip()) == 0: - raise ArgumentUsageError("Empty network subnet-id provided. Please pass the `subnet-id` correctly or pass `ip-configurations`") - networkipconfig = {} - networkipconfig['name'] = 'ipconfig' - networkipconfig['properties'] = {} - networkipconfig['properties']['private_ip_address'] = ip_address - networkipconfig['properties']['gateway'] = gateway - networkipconfig['properties']['subnet'] = {} - networkipconfig['properties']['subnet']['id'] = subnet_id - networkinterfaces['properties']['ip_configurations'].append(networkipconfig) - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.create_or_update(resource_group_name=resource_group_name, - networkinterfaces_name=name, - networkinterfaces=networkinterfaces) - - -def azurestackhci_networkinterface_update(client, - resource_group_name, - name, - tags=None): - return client.update(resource_group_name=resource_group_name, - networkinterfaces_name=name, - tags=tags) - - -def azurestackhci_networkinterface_delete(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.delete(resource_group_name=resource_group_name, - networkinterfaces_name=name) - - -def azurestackhci_networkinterface_show(client, - resource_group_name, - name): - return client.retrieve(resource_group_name=resource_group_name, - networkinterfaces_name=name) - - -def azurestackhci_virtualharddisk_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_virtualharddisk_create(client, - resource_group_name, - name, - location, - tags=None, - extended_location=None, - block_size_bytes=None, - disk_size_bytes=None, - disk_size_gb=None, - disk_file_format=None, - dynamic=None, - logical_sector_bytes=None, - physical_sector_bytes=None, - storagepath_id=None, - polling_interval=None): - # For backward compatibility. disk_size_bytes is deprecated - if disk_size_bytes and not disk_size_gb: - disk_size_gb = disk_size_bytes - - virtualharddisks = {} - virtualharddisks['location'] = location - virtualharddisks['tags'] = tags - virtualharddisks['extended_location'] = extended_location - virtualharddisks['properties'] = {} - virtualharddisks['properties']['block_size_bytes'] = block_size_bytes - virtualharddisks['properties']['disk_size_gb'] = disk_size_gb - virtualharddisks['properties']['disk_file_format'] = disk_file_format - virtualharddisks['properties']['dynamic'] = dynamic - virtualharddisks['properties']['logical_sector_bytes'] = logical_sector_bytes - virtualharddisks['properties']['physical_sector_bytes'] = physical_sector_bytes - virtualharddisks['properties']['storagepath_id'] = storagepath_id - - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.create_or_update(resource_group_name=resource_group_name, - virtualharddisks_name=name, - virtualharddisks=virtualharddisks) - - -def azurestackhci_virtualharddisk_update(client, - resource_group_name, - name, - tags=None): - return client.update(resource_group_name=resource_group_name, - virtualharddisks_name=name, - tags=tags) - - -def azurestackhci_virtualharddisk_delete(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.delete(resource_group_name=resource_group_name, - virtualharddisks_name=name) - - -def azurestackhci_virtualharddisk_show(client, - resource_group_name, - name): - return client.retrieve(resource_group_name=resource_group_name, - virtualharddisks_name=name) - - -def azurestackhci_virtualmachine_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_virtualmachine_create(client, - resource_group_name, - name, - location, - tags=None, - extended_location=None, - hardware_profile=None, - image_reference=None, - network_profile=None, - nic_id=None, - os_profile=None, - security_profile = None, - enable_tpm=None, - storage_profile=None, - storagepath_id=None, - linux_configuration=None, - windows_configuration=None, - vm_size=None, - admin_password=None, - admin_username=None, - computer_name=None, - ssh_public_keys=None, - os_disk=None, - data_disk=None, - allow_password_auth=None, - disable_vm_management=None, - polling_interval=None): - virtualmachines = {} - virtualmachines['location'] = location - virtualmachines['tags'] = tags - virtualmachines['extended_location'] = extended_location - virtualmachines['properties'] = {} - virtualmachines['properties']['hardware_profile'] = hardware_profile or {} - virtualmachines['properties']['network_profile'] = network_profile or {} - virtualmachines['properties']['security_profile'] = security_profile or {} - virtualmachines['properties']['security_profile']['enable_tpm'] = True if enable_tpm else False - virtualmachines['properties']['storage_profile'] = storage_profile or {} - - if vm_size == "Default": - raise ArgumentUsageError("Invalid vm-size provided. 'Default' is not a supported vm-size.") - - if os_profile is None: - os_profile = {} - - if linux_configuration is None: - linux_configuration = {} - - if windows_configuration is None: - windows_configuration = {} - - # Enabling the vm arc agent by default and disabling it as per user's input - # If the user wants to disable guest management, VM Agent provisioning is disabled - if disable_vm_management == True: - windows_configuration['provision_vm_agent'] = False - linux_configuration['provision_vm_agent'] = False - # Otherwise, the provisioning will be enabled by default - else: - windows_configuration['provision_vm_agent'] = True - linux_configuration['provision_vm_agent'] = True - - # If provisioning vm agent, identity should be SystemAssigned - virtualmachines['identity'] = { 'type': 'SystemAssigned' } - - if allow_password_auth: - linux_configuration['disable_password_authentication'] = False - - # set the OS configurations for VM - if any(i is not None for i in (admin_username, admin_password)): - if admin_password is not None: - os_profile['admin_password'] = admin_password - if admin_username is not None: - os_profile['admin_username'] = admin_username - - if computer_name is not None: - os_profile['computer_name'] = computer_name - - if ssh_public_keys: - keys = [] - for key_path in ssh_public_keys: - key = read_file(key_path) - keys.append({'key_data': key}) - linux_configuration['ssh'] = {'public_keys': keys} - windows_configuration['ssh'] = {'public_keys': keys} - - # Overriden Variables - if image_reference is not None: - virtualmachines['properties']['storage_profile']['image_reference'] = {'id': image_reference} - if os_disk is not None: - virtualmachines['properties']['storage_profile']['os_disk'] = {'id': os_disk} - if storagepath_id is not None: - virtualmachines['properties']['storage_profile']['storagepath_id'] = storagepath_id - if data_disk is not None: - virtualmachines['properties']['storage_profile']['data_disks'] = [] - for disk in data_disk: - virtualmachines['properties']['storage_profile']['data_disks'].append({'id': disk}) - if nic_id is not None: - virtualmachines['properties']['network_profile']['network_interfaces'] = [{'id' : nic_id}] - if vm_size is not None: - virtualmachines['properties']['hardware_profile']['vm_size'] = vm_size - - if windows_configuration: - os_profile['windows_configuration'] = windows_configuration - if linux_configuration: - os_profile['linux_configuration'] = linux_configuration - if os_profile: - virtualmachines['properties']['os_profile'] = os_profile - - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.create_or_update(resource_group_name=resource_group_name, - virtualmachines_name=name, - virtualmachines=virtualmachines) - - -def azurestackhci_virtualmachine_update(client, - resource_group_name, - name, - tags=None, - cpu_count=None, - memory_gb=None, - memory_mb=None, - vnic_names=None, - vhd_names=None, - polling_interval=None): - # For backward compatibility. memory_gb is deprecated - if memory_gb and not memory_mb: - memory_mb = memory_gb * 1024 - - virtualmachine_properties = {} - if cpu_count is not None or memory_mb is not None: - virtualmachine_properties['hardware_profile'] = {} - if cpu_count is not None: - virtualmachine_properties['hardware_profile']['processors'] = cpu_count - if memory_mb is not None: - virtualmachine_properties['hardware_profile']['memory_mb'] = memory_mb - - if vnic_names is not None: - virtualmachine_properties['network_profile'] = { 'network_interfaces' : [] } - for vnic_name in vnic_names: - virtualmachine_properties['network_profile']['network_interfaces'].append({'id': vnic_name}) - - if vhd_names is not None: - virtualmachine_properties['storage_profile'] = {'data_disks': [] } - for vhd_name in vhd_names: - virtualmachine_properties['storage_profile']['data_disks'].append({'id': vhd_name}) - - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.update(resource_group_name=resource_group_name, - virtualmachines_name=name, - properties=virtualmachine_properties, - tags=tags) - - -def azurestackhci_virtualmachine_delete(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.delete(resource_group_name=resource_group_name, - virtualmachines_name=name) - - -def azurestackhci_virtualmachine_show(client, - resource_group_name, - name): - return client.retrieve(resource_group_name=resource_group_name, - virtualmachines_name=name) - - -def azurestackhci_virtualmachine_start(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.start(resource_group_name=resource_group_name, - virtualmachines_name=name) - - -def azurestackhci_virtualmachine_stop(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.stop(resource_group_name=resource_group_name, - virtualmachines_name=name) - -def azurestackhci_virtualmachine_restart(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.restart(resource_group_name=resource_group_name, - virtualmachines_name=name) - -def azurestackhci_virtualmachine_vnic_add(client, - resource_group_name, - name, - vnic_names): - return client.add_vnic(resource_group_name=resource_group_name, - virtualmachines_name=name, vnic_names=vnic_names) - -def azurestackhci_virtualmachine_vnic_remove(client, - resource_group_name, - name, - vnic_names): - return client.remove_vnic(resource_group_name=resource_group_name, - virtualmachines_name=name, vnic_names=vnic_names) - -def azurestackhci_virtualnetwork_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_virtualnetwork_create(client, - resource_group_name, - name, - location, - tags=None, - extended_location=None, - network_type=None, - subnets=None, - address_prefix=None, - ip_allocation_method=None, - ip_pools=None, - ip_pool_type=None, - ip_pool_start=None, - ip_pool_end=None, - vlan=0, - routes=None, - gateway=None, - vm_switch_name=None, - dns_servers=None, - polling_interval=None): - virtualnetworks = {} - virtualnetworks['location'] = location - virtualnetworks['tags'] = tags - virtualnetworks['extended_location'] = extended_location - virtualnetworks['properties'] = {} - virtualnetworks['properties']['network_type'] = network_type - virtualnetworks['properties']['subnets'] = subnets or list() - virtualnetworks['properties']['vm_switch_name'] = vm_switch_name - - if dns_servers: - virtualnetworks['properties']['dhcp_options'] = {} - virtualnetworks['properties']['dhcp_options']['dns_servers'] = dns_servers - - if subnets is None and any([param for param in (address_prefix, ip_pool_start, ip_pool_end, ip_pool_type, ip_allocation_method, ip_pools, vlan, routes, gateway)]): - - # Subnets - subnet = {} - subnet['name'] = name - subnet['properties'] = {} - subnet['properties']['address_prefix'] = address_prefix - subnet['properties']['ip_allocation_method'] = ip_allocation_method - subnet['properties']['ip_pools'] = ip_pools or list() - subnet['properties']['vlan'] = vlan - - # IPPools - if any([param for param in (ip_pool_type, ip_pool_start, ip_pool_end)]): - ippool = {} - ippool['ip_pool_type'] = ip_pool_type - ippool['start'] = ip_pool_start - ippool['end'] = ip_pool_end - - subnet['properties']['ip_pools'].append(ippool) - - if routes: - # Route table - subnet['properties']['route_table'] = {} - routeTable = {} - routeTable['name'] = name + "-RT" - routeTable['properties'] = {} - routeTable['properties']['routes'] = routes or list() - subnet['properties']['route_table'] = routeTable - - if gateway: - # Add default route - default_route = {} - default_route['name'] = name + "-default-route" - default_route['properties'] = {} - default_route['properties']['address_prefix'] = "0.0.0.0/0" - default_route['properties']['next_hop_ip_address'] = gateway - - if 'route_table' in subnet['properties']: - subnet['properties']['route_table']['properties']['routes'].append(default_route) - else: - routeTable = {} - routeTable['name'] = name + "-RT" - routeTable['properties'] = {} - routeTable['properties']['routes'] = list() - routeTable['properties']['routes'].append(default_route) - subnet['properties']['route_table'] = routeTable - - virtualnetworks['properties']['subnets'].append(subnet) - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.create_or_update(resource_group_name=resource_group_name, - virtualnetworks_name=name, - virtualnetworks=virtualnetworks) - - -def azurestackhci_virtualnetwork_update(client, - resource_group_name, - name, - tags=None, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.update(resource_group_name=resource_group_name, - virtualnetworks_name=name, - tags=tags) - - -def azurestackhci_virtualnetwork_delete(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.delete(resource_group_name=resource_group_name, - virtualnetworks_name=name) - - -def azurestackhci_virtualnetwork_show(client, - resource_group_name, - name): - return client.retrieve(resource_group_name=resource_group_name, - virtualnetworks_name=name) - - -def azurestackhci_storagecontainer_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_storagecontainer_create(client, - resource_group_name, - name, - location, - tags=None, - extended_location=None, - path=None, - polling_interval=None): - storagecontainers = {} - storagecontainers['location'] = location - storagecontainers['tags'] = tags - storagecontainers['extended_location'] = extended_location - storagecontainers['properties'] = {} - storagecontainers['properties']['path'] = path - - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.create_or_update(resource_group_name=resource_group_name, - storagecontainers_name=name, - storagecontainers=storagecontainers) - - -def azurestackhci_storagecontainer_update(client, - resource_group_name, - name, - tags=None): - return client.update(resource_group_name=resource_group_name, - storagecontainers_name=name, - tags=tags) - - -def azurestackhci_storagecontainer_delete(client, - resource_group_name, - name, - polling_interval=None): - if polling_interval: - client.config.long_running_operation_timeout=polling_interval - return client.delete(resource_group_name=resource_group_name, - storagecontainers_name=name) - - -def azurestackhci_storagecontainer_show(client, - resource_group_name, - name): - return client.retrieve(resource_group_name=resource_group_name, - storagecontainers_name=name) - - -def azurestackhci_cluster_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def azurestackhci_cluster_show(client, - resource_group_name, - name): - return client.get(resource_group_name=resource_group_name, - cluster_name=name) - - -def azurestackhci_cluster_create(client, - resource_group_name, - name, - location, - tags=None, - aad_client_id=None, - aad_tenant_id=None): - cluster = {} - cluster['tags'] = tags - cluster['location'] = location - cluster['aad_client_id'] = aad_client_id - cluster['aad_tenant_id'] = aad_tenant_id - return client.create(resource_group_name=resource_group_name, - cluster_name=name, - cluster=cluster) - - -def azurestackhci_cluster_update(client, - resource_group_name, - name, - tags=None): - cluster = {} - cluster['tags'] = tags - return client.update(resource_group_name=resource_group_name, - cluster_name=name, - cluster=cluster) - - -def azurestackhci_cluster_delete(client, - resource_group_name, - name): - return client.delete(resource_group_name=resource_group_name, - cluster_name=name) - -def azurestackhci_vmextension_create(client, - resource_group_name, - virtualmachine_name, - name, - location, - tags=None, - force_update_tag=None, - publisher=None, - extension_type=None, - type_handler_version=None, - enable_auto_upgrade=None, - auto_upgrade_minor=None, - settings=None, - protected_settings=None, - instance_view_type=None, - inst_handler_version=None, - status=None, - no_wait=False): - extensionParameters = {} - extensionParameters['tags'] = tags - extensionParameters['location'] = location - extensionParameters['properties'] = {} - extensionParameters['properties']['location'] = location - if force_update_tag is not None: - extensionParameters['properties']['force_update_tag'] = force_update_tag - if publisher is not None: - extensionParameters['properties']['publisher'] = publisher - if extension_type is not None: - extensionParameters['properties']['extension_type'] = extension_type - if type_handler_version is not None: - extensionParameters['properties']['type_handler_version'] = type_handler_version - if enable_auto_upgrade is not None: - extensionParameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade - if auto_upgrade_minor is not None: - extensionParameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor - if settings is not None: - extensionParameters['properties']['settings'] = settings - if protected_settings is not None: - extensionParameters['properties']['protected_settings'] = protected_settings - extensionParameters['properties']['instance_view'] = {} - extensionParameters['properties']['instance_view']['name'] = name - if instance_view_type is not None: - extensionParameters['properties']['instance_view']['type'] = instance_view_type - if inst_handler_version is not None: - extensionParameters['properties']['instance_view']['type_handler_version'] = inst_handler_version - if status is not None: - extensionParameters['properties']['instance_view']['status'] = status - if len(extensionParameters['properties']['instance_view']) == 0: - del extensionParameters['properties']['instance_view'] - return sdk_no_wait(no_wait, - client.create, - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name, - extensionParameters=extensionParameters) - -def azurestackhci_vmextension_update(client, - resource_group_name, - virtualmachine_name, - name, - tags=None, - force_update_tag=None, - publisher=None, - extension_type=None, - type_handler_version=None, - enable_auto_upgrade=None, - auto_upgrade_minor=None, - settings=None, - protected_settings=None, - no_wait=False): - extension_parameters = {} - if tags is not None: - extension_parameters['tags'] = tags - extension_parameters['properties'] = {} - if force_update_tag is not None: - extension_parameters['properties']['force_update_tag'] = force_update_tag - if publisher is not None: - extension_parameters['properties']['publisher'] = publisher - if extension_type is not None: - extension_parameters['properties']['extension_type'] = extension_type - if type_handler_version is not None: - extension_parameters['properties']['type_handler_version'] = type_handler_version - if enable_auto_upgrade is not None: - extension_parameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade - if auto_upgrade_minor is not None: - extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor - if settings is not None: - extension_parameters['properties']['settings'] = settings - if protected_settings is not None: - extension_parameters['properties']['protected_settings'] = protected_settings - if len(extension_parameters['properties']) == 0: - del extension_parameters['properties'] - return sdk_no_wait(no_wait, - client.update, - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name, - extension_parameters=extension_parameters) - -def azurestackhci_vmextension_show(client, - resource_group_name, - virtualmachine_name, - name): - return client.get(resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name) - -def azurestackhci_vmextension_list(client, - resource_group_name, - virtualmachine_name): - return client.list_by_virtualmachine_name(resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name) - -def azurestackhci_vmextension_delete(client, - resource_group_name, - virtualmachine_name, - name, - no_wait=False): - return sdk_no_wait(no_wait, - client.delete, - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py deleted file mode 100644 index bea0a0e5b19..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/generated/helpers.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import os -from knack.util import CLIError -from azure.cli.core.util import read_file_content - -def read_file(file_path): - path = os.path.expanduser(file_path) - if os.path.exists(path): - return read_file_content(path) - else: - raise CLIError('File not found: {}'.format(file_path)) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/manual/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/__init__.py deleted file mode 100644 index 70488e93851..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/__init__.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -import inspect -import logging -import os -import sys -import traceback -import datetime as dt - -from azure.core.exceptions import AzureError -from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError - - -logger = logging.getLogger('azure.cli.testsdk') -logger.addHandler(logging.StreamHandler()) -__path__ = __import__('pkgutil').extend_path(__path__, __name__) -exceptions = [] -test_map = dict() -SUCCESSED = "successed" -FAILED = "failed" - - -def try_manual(func): - def import_manual_function(origin_func): - from importlib import import_module - decorated_path = inspect.getfile(origin_func).lower() - module_path = __path__[0].lower() - if not decorated_path.startswith(module_path): - raise Exception("Decorator can only be used in submodules!") - manual_path = os.path.join( - decorated_path[module_path.rfind(os.path.sep) + 1:]) - manual_file_path, manual_file_name = os.path.split(manual_path) - module_name, _ = os.path.splitext(manual_file_name) - manual_module = "..manual." + \ - ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) - return getattr(import_module(manual_module, package=__name__), origin_func.__name__) - - def get_func_to_call(): - func_to_call = func - try: - func_to_call = import_manual_function(func) - logger.info("Found manual override for %s(...)", func.__name__) - except (ImportError, AttributeError): - pass - return func_to_call - - def wrapper(*args, **kwargs): - func_to_call = get_func_to_call() - logger.info("running %s()...", func.__name__) - try: - test_map[func.__name__] = dict() - test_map[func.__name__]["result"] = SUCCESSED - test_map[func.__name__]["error_message"] = "" - test_map[func.__name__]["error_stack"] = "" - test_map[func.__name__]["error_normalized"] = "" - test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() - ret = func_to_call(*args, **kwargs) - except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, - JMESPathCheckAssertionError) as e: - use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") - if use_exception_cache is None or use_exception_cache.lower() != "true": - raise - test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() - test_map[func.__name__]["result"] = FAILED - test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] - test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( - "\r\n", " ").replace("\n", " ")[:500] - logger.info("--------------------------------------") - logger.info("step exception: %s", e) - logger.error("--------------------------------------") - logger.error("step exception in %s: %s", func.__name__, e) - logger.info(traceback.format_exc()) - exceptions.append((func.__name__, sys.exc_info())) - else: - test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() - return ret - - if inspect.isclass(func): - return get_func_to_call() - return wrapper - - -def calc_coverage(filename): - filename = filename.split(".")[0] - coverage_name = filename + "_coverage.md" - with open(coverage_name, "w") as f: - f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") - total = len(test_map) - covered = 0 - for k, v in test_map.items(): - if not k.startswith("step_"): - total -= 1 - continue - if v["result"] == SUCCESSED: - covered += 1 - f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" - "{end_dt}|\n".format(step_name=k, **v)) - f.write("Coverage: {}/{}\n".format(covered, total)) - print("Create coverage\n", file=sys.stderr) - - -def raise_if(): - if exceptions: - if len(exceptions) <= 1: - raise exceptions[0][1][1] - message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) - message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) - raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py deleted file mode 100644 index 0cd3543ebd2..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/example_steps.py +++ /dev/null @@ -1,503 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - - -from .. import try_manual - - -# EXAMPLE: /Clusters/put/Create cluster -@try_manual -def step_cluster_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci cluster create ' - '--location "East US" ' - '--aad-client-id "24a6e53d-04e5-44d2-b7cc-1b732a847dfc" ' - '--aad-tenant-id "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94" ' - '--name "{myCluster}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /Clusters/get/Get cluster -@try_manual -def step_cluster_show(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci cluster show ' - '--name "{myCluster}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /Clusters/get/List clusters in a given resource group -@try_manual -def step_cluster_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci cluster list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /Clusters/get/List clusters in a given subscription -@try_manual -def step_cluster_list2(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci cluster list ' - '-g ""', - checks=checks) - - -# EXAMPLE: /Clusters/patch/Update cluster -@try_manual -def step_cluster_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci cluster update ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myCluster}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /Clusters/delete/Delete cluster -@try_manual -def step_cluster_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci cluster delete -y ' - '--name "{myCluster}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /galleryimages/put/PutGalleryImage -@try_manual -def step_galleryimage_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci galleryimage create ' - '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' - 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' - '--location "West US2" ' - '--container-name "Default_Container" ' - '--image-path "C:\\\\test.vhdx" ' - '--galleryimages-name "test-gallery-image" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /galleryimages/get/GetGalleryImage -@try_manual -def step_galleryimage_retrieve(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci galleryimage retrieve ' - '--galleryimages-name "test-gallery-image" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /galleryimages/get/ListGalleryImageByResourceGroup -@try_manual -def step_galleryimage_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci galleryimage list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /galleryimages/patch/UpdateGalleryImage -@try_manual -def step_galleryimage_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci galleryimage update ' - '--tags additionalProperties="sample" ' - '--galleryimages-name "test-gallery-image" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /galleryimages/delete/DeleteGalleryImage -@try_manual -def step_galleryimage_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci galleryimage delete -y ' - '--galleryimages-name "test-gallery-image" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /networkinterfaces/put/PutNetworkInterface -@try_manual -def step_networkinterface_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci networkinterface create ' - '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' - 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' - '--location "West US2" ' - '--name "test-nic" ' - '--subnet_id "test-vnet" ' - '--gateway "sample_gateway" ' - '--prefix_length "16" ' - '--ip_address "1.2.3.4" ' - '--ip_allocation_method "Static" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /networkinterfaces/get/GetNetworkInterface -@try_manual -def step_networkinterface_retrieve(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci networkinterface retrieve ' - '--networkinterfaces-name "test-nic" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /networkinterfaces/get/ListNetworkInterfaceByResourceGroup -@try_manual -def step_networkinterface_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci networkinterface list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /networkinterfaces/get/ListNetworkInterfaceBySubscription -@try_manual -def step_networkinterface_list2(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci networkinterface list ' - '-g ""', - checks=checks) - - -# EXAMPLE: /networkinterfaces/patch/UpdateNetworkInterface -@try_manual -def step_networkinterface_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci networkinterface update ' - '--tags additionalProperties="sample" ' - '--networkinterfaces-name "test-nic" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /networkinterfaces/delete/DeleteNetworkInterface -@try_manual -def step_networkinterface_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci networkinterface delete -y ' - '--networkinterfaces-name "test-nic" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /storagecontainers/put/PutStorageContainer -@try_manual -def step_storagecontainer_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci storagecontainer create ' - '--resource-group "{rg}" ' - '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' - 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' - '--location "West US2" ' - '--path "C:\\\\container_storage" ' - '--storagecontainers-name "Default_Container"', - checks=checks) - - -# EXAMPLE: /storagecontainers/get/GetStorageContainer -@try_manual -def step_storagecontainer_retrieve(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci storagecontainer retrieve ' - '--resource-group "{rg}" ' - '--storagecontainers-name "Default_Container"', - checks=checks) - - -# EXAMPLE: /storagecontainers/get/ListStorageContainerByResourceGroup -@try_manual -def step_storagecontainer_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci storagecontainer list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /storagecontainers/patch/UpdateStorageContainer -@try_manual -def step_storagecontainer_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci storagecontainer update ' - '--resource-group "{rg}" ' - '--tags additionalProperties="sample" ' - '--storagecontainers-name "Default_Container"', - checks=checks) - - -# EXAMPLE: /storagecontainers/delete/DeleteStorageContainer -@try_manual -def step_storagecontainer_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci storagecontainer delete -y ' - '--resource-group "{rg}" ' - '--storagecontainers-name "Default_Container"', - checks=checks) - - -# EXAMPLE: /virtualharddisks/put/PutVirtualHardDisk -@try_manual -def step_virtualharddisk_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualharddisk create ' - '--resource-group "{rg}" ' - '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' - 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' - '--location "West US2" ' - '--disk-size-gb 32 ' - '--virtualharddisks-name "test-vhd"', - checks=checks) - - -# EXAMPLE: /virtualharddisks/get/GetVirtualHardDisk -@try_manual -def step_virtualharddisk_retrieve(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualharddisk retrieve ' - '--resource-group "{rg}" ' - '--virtualharddisks-name "test-vhd"', - checks=checks) - - -# EXAMPLE: /virtualharddisks/get/ListVirtualHardDiskByResourceGroup -@try_manual -def step_virtualharddisk_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualharddisk list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /virtualharddisks/patch/UpdateVirtualHardDisk -@try_manual -def step_virtualharddisk_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualharddisk update ' - '--resource-group "{rg}" ' - '--tags additionalProperties="sample" ' - '--virtualharddisks-name "test-vhd"', - checks=checks) - - -# EXAMPLE: /virtualharddisks/delete/DeleteVirtualHardDisk -@try_manual -def step_virtualharddisk_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualharddisk delete -y ' - '--resource-group "{rg}" ' - '--virtualharddisks-name "test-vhd"', - checks=checks) - - -# EXAMPLE: /virtualmachines/put/PutVirtualMachine -@try_manual -def step_virtualmachine_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine create ' - '--resource-group "{rg}" ' - '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' - 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' - '--location "West US2" ' - '--hardware-profile vm-size="Default" ' - '--network-profile network-interfaces={{"id":"test-nic"}} ' - '--os-profile "{{\\"adminPassword\\":\\"password\\",\\"adminUsername\\":\\"localadmin\\",\\"computerName\\' - '":\\"luamaster\\"}}" ' - '--storage-profile "{{\\"imageReference\\":{{\\"id\\":\\"test-gallery-image\\"}}}}" ' - '--virtualmachines-name "test-vm"', - checks=checks) - - -# EXAMPLE: /virtualmachines/get/GetVirtualMachine -@try_manual -def step_virtualmachine_retrieve(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine retrieve ' - '--resource-group "{rg}" ' - '--virtualmachines-name "test-vm"', - checks=checks) - - -# EXAMPLE: /virtualmachines/get/ListVirtualMachineByResourceGroup -@try_manual -def step_virtualmachine_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /virtualmachines/get/ListVirtualMachineBySubscription -@try_manual -def step_virtualmachine_list2(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine list ' - '-g ""', - checks=checks) - - -# EXAMPLE: /virtualmachines/patch/UpdateVirtualMachine -@try_manual -def step_virtualmachine_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine update ' - '--resource-group "{rg}" ' - '--tags additionalProperties="sample" ' - '--virtualmachines-name "test-vm"', - checks=checks) - - -# EXAMPLE: /virtualmachines/post/StartVirtualMachine -@try_manual -def step_virtualmachine_start(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine start ' - '--resource-group "{rg}" ' - '--virtualmachines-name "test-vm"', - checks=checks) - - -# EXAMPLE: /virtualmachines/post/StopVirtualMachine -@try_manual -def step_virtualmachine_stop(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine stop ' - '--resource-group "{rg}" ' - '--virtualmachines-name "test-vm"', - checks=checks) - - -# EXAMPLE: /virtualmachines/delete/DeleteVirtualMachine -@try_manual -def step_virtualmachine_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualmachine delete -y ' - '--resource-group "{rg}" ' - '--virtualmachines-name "test-vm"', - checks=checks) - - -# EXAMPLE: /virtualnetworks/put/PutVirtualNetwork -@try_manual -def step_virtualnetwork_create(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualnetwork create ' - '--resource-group "{rg}" ' - '--extended-location name="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Exte' - 'ndedLocation/customLocations/dogfood-location" type="CustomLocation" ' - '--location "West US2" ' - '--network-type "Transparent" ' - '--name "test-vnet" ', - '--address-prefix "10.0.0.0/16" ', - '--ip-allocation-method "Static" ', - '--ip-pool-type "vm" ', - '--ip-pool-start "10.0.0.0" ', - '--ip-pool-end "10.0.0.16" ' - '--vlan 10', - '--vm-switch-name "test-vm-switch', - checks=checks) - - -# EXAMPLE: /virtualnetworks/get/GetVirtualNetwork -@try_manual -def step_virtualnetwork_retrieve(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualnetwork retrieve ' - '--resource-group "{rg}" ' - '--virtualnetworks-name "test-vnet"', - checks=checks) - - -# EXAMPLE: /virtualnetworks/get/ListVirtualNetworkByResourceGroup -@try_manual -def step_virtualnetwork_list(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualnetwork list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /virtualnetworks/get/ListVirtualNetworkBySubscription -@try_manual -def step_virtualnetwork_list2(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualnetwork list ' - '-g ""', - checks=checks) - - -# EXAMPLE: /virtualnetworks/patch/UpdateVirtualNetwork -@try_manual -def step_virtualnetwork_update(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualnetwork update ' - '--resource-group "{rg}" ' - '--tags additionalProperties="sample" ' - '--virtualnetworks-name "test-vnet"', - checks=checks) - - -# EXAMPLE: /virtualnetworks/delete/DeleteVirtualNetwork -@try_manual -def step_virtualnetwork_delete(test, rg_2, rg, checks=None): - if checks is None: - checks = [] - test.cmd('az azurestackhci virtualnetwork delete -y ' - '--resource-group "{rg}" ' - '--virtualnetworks-name "test-vnet"', - checks=checks) - diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py deleted file mode 100644 index 4684d382b7a..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/tests/latest/test_azurestackhci_scenario.py +++ /dev/null @@ -1,169 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import os -from azure.cli.testsdk import ScenarioTest -from azure.cli.testsdk import ResourceGroupPreparer -from .example_steps import step_cluster_create -from .example_steps import step_cluster_show -from .example_steps import step_cluster_list -from .example_steps import step_cluster_list2 -from .example_steps import step_cluster_update -from .example_steps import step_cluster_delete -from .example_steps import step_galleryimage_create -from .example_steps import step_galleryimage_retrieve -from .example_steps import step_galleryimage_list -from .example_steps import step_galleryimage_update -from .example_steps import step_galleryimage_delete -from .example_steps import step_networkinterface_create -from .example_steps import step_networkinterface_retrieve -from .example_steps import step_networkinterface_list -from .example_steps import step_networkinterface_list2 -from .example_steps import step_networkinterface_update -from .example_steps import step_networkinterface_delete -from .example_steps import step_storagecontainer_create -from .example_steps import step_storagecontainer_retrieve -from .example_steps import step_storagecontainer_list -from .example_steps import step_storagecontainer_update -from .example_steps import step_storagecontainer_delete -from .example_steps import step_virtualharddisk_create -from .example_steps import step_virtualharddisk_retrieve -from .example_steps import step_virtualharddisk_list -from .example_steps import step_virtualharddisk_update -from .example_steps import step_virtualharddisk_delete -from .example_steps import step_virtualmachine_create -from .example_steps import step_virtualmachine_retrieve -from .example_steps import step_virtualmachine_list -from .example_steps import step_virtualmachine_list2 -from .example_steps import step_virtualmachine_update -from .example_steps import step_virtualmachine_start -from .example_steps import step_virtualmachine_stop -from .example_steps import step_virtualmachine_delete -from .example_steps import step_virtualnetwork_create -from .example_steps import step_virtualnetwork_retrieve -from .example_steps import step_virtualnetwork_list -from .example_steps import step_virtualnetwork_list2 -from .example_steps import step_virtualnetwork_update -from .example_steps import step_virtualnetwork_delete -from .. import ( - try_manual, - raise_if, - calc_coverage -) - - -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - - -# Env setup_scenario -@try_manual -def setup_scenario(test, rg_2, rg): - pass - - -# Env cleanup_scenario -@try_manual -def cleanup_scenario(test, rg_2, rg): - pass - - -# Testcase: Scenario -@try_manual -def call_scenario(test, rg_2, rg): - setup_scenario(test, rg_2, rg) - step_cluster_create(test, rg_2, rg, checks=[ - test.check("location", "East US", case_sensitive=False), - test.check("aadClientId", "24a6e53d-04e5-44d2-b7cc-1b732a847dfc", case_sensitive=False), - test.check("aadTenantId", "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94", case_sensitive=False), - test.check("name", "{myCluster}", case_sensitive=False), - ]) - step_cluster_show(test, rg_2, rg, checks=[ - test.check("location", "East US", case_sensitive=False), - test.check("aadClientId", "24a6e53d-04e5-44d2-b7cc-1b732a847dfc", case_sensitive=False), - test.check("aadTenantId", "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94", case_sensitive=False), - test.check("name", "{myCluster}", case_sensitive=False), - ]) - step_cluster_list(test, rg_2, rg, checks=[ - test.check('length(@)', 1), - ]) - step_cluster_list2(test, rg_2, rg, checks=[ - test.check('length(@)', 1), - ]) - step_cluster_update(test, rg_2, rg, checks=[ - test.check("location", "East US", case_sensitive=False), - test.check("aadTenantId", "7e589cc1-a8b6-4dff-91bd-5ec0fa18db94", case_sensitive=False), - test.check("name", "{myCluster}", case_sensitive=False), - test.check("tags.tag1", "value1", case_sensitive=False), - test.check("tags.tag2", "value2", case_sensitive=False), - ]) - step_cluster_delete(test, rg_2, rg, checks=[]) - step_galleryimage_create(test, rg_2, rg, checks=[]) - step_galleryimage_retrieve(test, rg_2, rg, checks=[]) - step_galleryimage_list(test, rg_2, rg, checks=[]) - step_galleryimage_list(test, rg_2, rg, checks=[]) - step_galleryimage_update(test, rg_2, rg, checks=[]) - step_galleryimage_delete(test, rg_2, rg, checks=[]) - step_networkinterface_create(test, rg_2, rg, checks=[]) - step_networkinterface_retrieve(test, rg_2, rg, checks=[]) - step_networkinterface_list(test, rg_2, rg, checks=[]) - step_networkinterface_list2(test, rg_2, rg, checks=[]) - step_networkinterface_update(test, rg_2, rg, checks=[]) - step_networkinterface_delete(test, rg_2, rg, checks=[]) - step_storagecontainer_create(test, rg_2, rg, checks=[]) - step_storagecontainer_retrieve(test, rg_2, rg, checks=[]) - step_storagecontainer_list(test, rg_2, rg, checks=[]) - step_storagecontainer_list(test, rg_2, rg, checks=[]) - step_storagecontainer_update(test, rg_2, rg, checks=[]) - step_storagecontainer_delete(test, rg_2, rg, checks=[]) - step_virtualharddisk_create(test, rg_2, rg, checks=[]) - step_virtualharddisk_retrieve(test, rg_2, rg, checks=[]) - step_virtualharddisk_list(test, rg_2, rg, checks=[]) - step_virtualharddisk_list(test, rg_2, rg, checks=[]) - step_virtualharddisk_update(test, rg_2, rg, checks=[]) - step_virtualharddisk_delete(test, rg_2, rg, checks=[]) - step_virtualmachine_create(test, rg_2, rg, checks=[]) - step_virtualmachine_retrieve(test, rg_2, rg, checks=[]) - step_virtualmachine_list(test, rg_2, rg, checks=[]) - step_virtualmachine_list2(test, rg_2, rg, checks=[]) - step_virtualmachine_update(test, rg_2, rg, checks=[]) - step_virtualmachine_start(test, rg_2, rg, checks=[]) - step_virtualmachine_stop(test, rg_2, rg, checks=[]) - step_virtualmachine_delete(test, rg_2, rg, checks=[]) - step_virtualnetwork_create(test, rg_2, rg, checks=[]) - step_virtualnetwork_retrieve(test, rg_2, rg, checks=[]) - step_virtualnetwork_list(test, rg_2, rg, checks=[]) - step_virtualnetwork_list2(test, rg_2, rg, checks=[]) - step_virtualnetwork_update(test, rg_2, rg, checks=[]) - step_virtualnetwork_delete(test, rg_2, rg, checks=[]) - cleanup_scenario(test, rg_2, rg) - - -# Test class for Scenario -@try_manual -class AzurestackhciScenarioTest(ScenarioTest): - - def __init__(self, *args, **kwargs): - super(AzurestackhciScenarioTest, self).__init__(*args, **kwargs) - self.kwargs.update({ - 'subscription_id': self.get_subscription_id() - }) - - self.kwargs.update({ - 'myCluster': 'myCluster', - }) - - - @ResourceGroupPreparer(name_prefix='clitestazurestackhci_dogfoodarc'[:7], key='rg_2', parameter_name='rg_2') - @ResourceGroupPreparer(name_prefix='clitestazurestackhci_test-rg'[:7], key='rg', parameter_name='rg') - def test_azurestackhci_Scenario(self, rg_2, rg): - call_scenario(self, rg_2, rg) - calc_coverage(__file__) - raise_if() - diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py deleted file mode 100644 index 67630aacb5a..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from ._configuration import AzureStackHCIClientConfiguration -from ._azure_stack_hci_client import AzureStackHCIClient -__all__ = ['AzureStackHCIClient', 'AzureStackHCIClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION - diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py deleted file mode 100644 index 553d9e13358..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - -from ._configuration import AzureStackHCIConfiguration -from .operations import GalleryimagesOperations -from .operations import NetworkinterfacesOperations -from .operations import Operations -from .operations import VirtualharddisksOperations -from .operations import VirtualmachinesOperations -from .operations import VirtualnetworksOperations -from .operations import StoragecontainersOperations -from .operations import ClustersOperations -from .operations import ArcVmExtensionsOperations -from . import models - - -class AzureStackHCI(object): - """The Microsoft.AzureStackHCI Rest API spec. - - :ivar galleryimages: GalleryimagesOperations operations - :vartype galleryimages: azure_stack_hci.operations.GalleryimagesOperations - :ivar networkinterfaces: NetworkinterfacesOperations operations - :vartype networkinterfaces: azure_stack_hci.operations.NetworkinterfacesOperations - :ivar operations: Operations operations - :vartype operations: azure_stack_hci.operations.Operations - :ivar virtualharddisks: VirtualharddisksOperations operations - :vartype virtualharddisks: azure_stack_hci.operations.VirtualharddisksOperations - :ivar virtualmachines: VirtualmachinesOperations operations - :vartype virtualmachines: azure_stack_hci.operations.VirtualmachinesOperations - :ivar virtualnetworks: VirtualnetworksOperations operations - :vartype virtualnetworks: azure_stack_hci.operations.VirtualnetworksOperations - :ivar storagecontainers: StoragecontainersOperations operations - :vartype storagecontainers: azure_stack_hci.operations.StoragecontainersOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure_stack_hci.operations.ClustersOperations - :ivar arcvmextensions: ArcVmExtensions operations - :vartype arcvmextensions: azure_stack_hci.operations.ArcVmExtensions - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = AzureStackHCIConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.galleryimages = GalleryimagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.networkinterfaces = NetworkinterfacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.virtualharddisks = VirtualharddisksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtualmachines = VirtualmachinesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtualnetworks = VirtualnetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.storagecontainers = StoragecontainersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.clusters = ClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.arcvmextensions = ArcVmExtensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureStackHCI - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py deleted file mode 100644 index 9be9b6d2fbd..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_azure_stack_hci_client.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer - -from ._configuration import AzureStackHCIClientConfiguration -from .operations import GalleryimagesOperations -from .operations import NetworkinterfacesOperations -from .operations import Operations -from .operations import VirtualharddisksOperations -from .operations import VirtualmachinesOperations -from .operations import VirtualnetworksOperations -from .operations import StoragecontainersOperations -from .operations import ClustersOperations -from .operations import ArcVmExtensionsOperations -from . import models - - -class AzureStackHCIClient(SDKClient): - """Azure Stack HCI management service - - :ivar config: Configuration for client. - :vartype config: AzureStackHCIClientConfiguration - - :ivar galleryimages: Galleryimages operations - :vartype galleryimages: azure.mgmt.azurestackhci.operations.GalleryimagesOperations - :ivar networkinterfaces: Networkinterfaces operations - :vartype networkinterfaces: azure.mgmt.azurestackhci.operations.NetworkinterfacesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.azurestackhci.operations.Operations - :ivar virtualharddisks: Virtualharddisks operations - :vartype virtualharddisks: azure.mgmt.azurestackhci.operations.VirtualharddisksOperations - :ivar virtualmachines: Virtualmachines operations - :vartype virtualmachines: azure.mgmt.azurestackhci.operations.VirtualmachinesOperations - :ivar virtualnetworks: Virtualnetworks operations - :vartype virtualnetworks: azure.mgmt.azurestackhci.operations.VirtualnetworksOperations - :ivar storagecontainers: Storagecontainers operations - :vartype storagecontainers: azure.mgmt.azurestackhci.operations.StoragecontainersOperations - :ivar clusters: Clusters operations - :vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations - :ivar arcvmextensions: ArcVmExtensions operations - :vartype arcvmextensions: azure.mgmt.azurestackhci.operations.ArcVmExtensionsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = AzureStackHCIClientConfiguration(credentials, subscription_id, base_url) - super(AzureStackHCIClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-11-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.galleryimages = GalleryimagesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.networkinterfaces = NetworkinterfacesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.virtualharddisks = VirtualharddisksOperations( - self._client, self.config, self._serialize, self._deserialize) - self.virtualmachines = VirtualmachinesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.virtualnetworks = VirtualnetworksOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storagecontainers = StoragecontainersOperations( - self._client, self.config, self._serialize, self._deserialize) - self.clusters = ClustersOperations( - self._client, self.config, self._serialize, self._deserialize) - self.arcvmextensions = ArcVmExtensionsOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py deleted file mode 100644 index 7808947548b..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/_configuration.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration - -from .version import VERSION - - -class AzureStackHCIClientConfiguration(AzureConfiguration): - """Configuration for AzureStackHCIClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(AzureStackHCIClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-azurestackhci/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py deleted file mode 100644 index 90b0258800b..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_stack_hci import AzureStackHCI -__all__ = ['AzureStackHCI'] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py deleted file mode 100644 index 17453629a04..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_azure_stack_hci.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Optional, TYPE_CHECKING - -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import AzureStackHCIConfiguration -from .operations import GalleryimagesOperations -from .operations import NetworkinterfacesOperations -from .operations import Operations -from .operations import VirtualharddisksOperations -from .operations import VirtualmachinesOperations -from .operations import VirtualnetworksOperations -from .operations import StoragecontainersOperations -from .operations import ClustersOperations -from .operations import ArcVmExtensionsOperations -from .. import models - - -class AzureStackHCI(object): - """The Microsoft.AzureStackHCI Rest API spec. - - :ivar galleryimages: GalleryimagesOperations operations - :vartype galleryimages: azure_stack_hci.aio.operations.GalleryimagesOperations - :ivar networkinterfaces: NetworkinterfacesOperations operations - :vartype networkinterfaces: azure_stack_hci.aio.operations.NetworkinterfacesOperations - :ivar operations: Operations operations - :vartype operations: azure_stack_hci.aio.operations.Operations - :ivar virtualharddisks: VirtualharddisksOperations operations - :vartype virtualharddisks: azure_stack_hci.aio.operations.VirtualharddisksOperations - :ivar virtualmachines: VirtualmachinesOperations operations - :vartype virtualmachines: azure_stack_hci.aio.operations.VirtualmachinesOperations - :ivar virtualnetworks: VirtualnetworksOperations operations - :vartype virtualnetworks: azure_stack_hci.aio.operations.VirtualnetworksOperations - :ivar storagecontainers: StoragecontainersOperations operations - :vartype storagecontainers: azure_stack_hci.aio.operations.StoragecontainersOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure_stack_hci.aio.operations.ClustersOperations - :ivar arcvmextensions: ArcVmExtensionsOperations operations - :vartype arcvmextensions: azure_stack_hci.aio.operations.ArcVmExtensionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = AzureStackHCIConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.galleryimages = GalleryimagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.networkinterfaces = NetworkinterfacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.virtualharddisks = VirtualharddisksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtualmachines = VirtualmachinesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtualnetworks = VirtualnetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.storagecontainers = StoragecontainersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.clusters = ClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.arcvmextensions = ArcVmExtensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureStackHCI": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py deleted file mode 100644 index f6e7a40d157..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class AzureStackHCIConfiguration(Configuration): - """Configuration for AzureStackHCI. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(AzureStackHCIConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2020-11-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azurestackhci/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py deleted file mode 100644 index c3d1854e783..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._galleryimages_operations import GalleryimagesOperations -from ._networkinterfaces_operations import NetworkinterfacesOperations -from ._operations import Operations -from ._virtualharddisks_operations import VirtualharddisksOperations -from ._virtualmachines_operations import VirtualmachinesOperations -from ._virtualnetworks_operations import VirtualnetworksOperations -from ._storagecontainers_operations import StoragecontainersOperations -from ._clusters_operations import ClustersOperations -from ._arc_vmextensions_operations import ArcVmExtensionsOperations - -__all__ = [ - 'GalleryimagesOperations', - 'NetworkinterfacesOperations', - 'Operations', - 'VirtualharddisksOperations', - 'VirtualmachinesOperations', - 'VirtualnetworksOperations', - 'StoragecontainersOperations', - 'ClustersOperations', - 'ArcVmExtensionsOperations', -] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py deleted file mode 100644 index 92076fb887c..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_arc_vmextensions_operations.py +++ /dev/null @@ -1,537 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ArcVmExtensionsOperations: - """ArcVmExtensionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_initial( - self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: models.ArcVmExtensions, **kwargs) -> "models.ArcVmExtensions": - cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map',{})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str'), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'ArcVmExtensionsUpdate') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - async def create( - self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: "models.ArcVmExtensionsUpdate", **kwargs) -> AsyncLROPoller["models.ArcVmExtensions"]: - """create. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :param extension_parameters: Parameters supplied to the Create ArcVmExtension operation. - :type extension_parameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ArcVmExtensions or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.ArcVmExtensions] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] - lro_delay = kwargs.pop('polling_interval', self._config.polling_interval) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name, - extension_parameters=extension_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - async def _update_initial( - self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: "models.ArcVmExtensionsUpdate", **kwargs) -> Optional["models.ArcVmExtensions"]: - cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map',{})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str'), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'ArcVmExtensions') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client.pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - async def update( - self, resource_group_name: str, virtualmachine_name: str, name: str, extension_parameters: "models.ArcVmExtensionsUpdate", **kwargs) -> AsyncLROPoller["models.ArcVmExtensions"]: - """The operation to update the vm extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :type extension_parameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ArcVmExtensions or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.ArcVmExtensions] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name, - extension_parameters=extension_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - async def get( - self, resource_group_name: str, virtualmachine_name: str, name: str, **kwargs) -> "models.ArcVmExtensions": - """The operation to get the vm extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArcVmExtensions, or the result of cls(response) - :rtype: ~azure_stack_hci.models.ArcVmExtensions - :raises: ~azure.core.exceptions.HttpResponseError - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensions"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArcVmExtensions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - async def delete( - self, resource_group_name: str, virtualmachine_name: str, name: str, **kwargs) -> None: - """delete - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine where the extension should be deleted. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - def list_by_virtualmachine_name( - self, resource_group_name: str, virtualmachine_name: str, **kwargs) -> AsyncIterable["models.ArcVmExtensionListResult"]: - """list_by_machine_name - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ArcVmExtensionsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.ArcVmExtensionsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - cls = kwargs.pop('cls', None) # type: ClsType["models.ArcVmExtensionsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_virtualmachine_name.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ArcVmExtensionsListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_virtualmachine_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions'} - - def _checkIfProvisionVmAgentEnabled( - self, resource_group_name, virtualmachine_name): - vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) - if vmObject.properties.os_profile.windows_configuration and vmObject.properties.os_profile.windows_configuration.provision_vm_agent == True: - return - else: - if vmObject.properties.os_profile.linux_configuration and vmObject.properties.os_profile.linux_configuration.provision_vm_agent == True: - return - raise Exception("Guest Management is not enabled for this virtual machine.") - - def _checkIfGuestVmAgentConnected( - self, resource_group_name, virtualmachine_name): - vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) - if vmObject.properties.guest_agent_profile: - if vmObject.properties.guest_agent_profile.status == models.Status.connected: - return - elif vmObject.properties.guest_agent_profile.status == models.Status.disconnected: - raise Exception("Guest Agent is currently disconnected.") - else: - error_detail = vmObject.properties.guest_agent_profile.error_details[-1] - error_code_and_message = error_detail.code + error_detail.message - raise Exception(error_code_and_message) - else: - raise Exception("Guest Agent is currently disconnected.") \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py deleted file mode 100644 index 85f3621ae40..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_clusters_operations.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ClustersOperations: - """ClustersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.ClusterList"]: - """List all HCI clusters in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClusterList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.ClusterList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ClusterList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.ClusterList"]: - """List all HCI clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClusterList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.ClusterList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ClusterList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters'} # type: ignore - - async def get( - self, - resource_group_name: str, - cluster_name: str, - **kwargs - ) -> "models.Cluster": - """Get HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Cluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore - - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: "models.Cluster", - **kwargs - ) -> "models.Cluster": - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :param cluster: Details of the HCI cluster. - :type cluster: ~azure_stack_hci.models.Cluster - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Cluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cluster, 'Cluster') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: "models.ClusterUpdate", - **kwargs - ) -> "models.Cluster": - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :param cluster: Details of the HCI cluster. - :type cluster: ~azure_stack_hci.models.ClusterUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Cluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cluster, 'ClusterUpdate') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - cluster_name: str, - **kwargs - ) -> None: - """Delete an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py deleted file mode 100644 index ae9f8cef6b8..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_galleryimages_operations.py +++ /dev/null @@ -1,497 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class GalleryimagesOperations: - """GalleryimagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def retrieve( - self, - resource_group_name: str, - galleryimages_name: str, - **kwargs - ) -> "models.Galleryimages": - """retrieve. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Galleryimages, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Galleryimages - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.retrieve.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Galleryimages', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - galleryimages_name: str, - galleryimages: "models.Galleryimages", - **kwargs - ) -> "models.Galleryimages": - cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(galleryimages, 'Galleryimages') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Galleryimages', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Galleryimages', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - galleryimages_name: str, - galleryimages: "models.Galleryimages", - **kwargs - ) -> AsyncLROPoller["models.Galleryimages"]: - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :param galleryimages: - :type galleryimages: ~azure_stack_hci.models.Galleryimages - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Galleryimages or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Galleryimages] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - galleryimages_name=galleryimages_name, - galleryimages=galleryimages, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Galleryimages', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - galleryimages_name: str, - **kwargs - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - galleryimages_name: str, - galleryimages: "models.GalleryimagesPatch", - **kwargs - ) -> "models.Galleryimages": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :param galleryimages: - :type galleryimages: ~azure_stack_hci.models.GalleryimagesPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Galleryimages, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Galleryimages - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Galleryimages"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(galleryimages, 'GalleryimagesPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Galleryimages', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Galleryimages', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.GalleryimagesListResult"]: - """list_by_resource_group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryimagesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.GalleryimagesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryimagesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('GalleryimagesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.GalleryimagesListResult"]: - """list_by_subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryimagesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.GalleryimagesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryimagesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('GalleryimagesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryimages'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py deleted file mode 100644 index 417791458cc..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_networkinterfaces_operations.py +++ /dev/null @@ -1,497 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkinterfacesOperations: - """NetworkinterfacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def retrieve( - self, - resource_group_name: str, - networkinterfaces_name: str, - **kwargs - ) -> "models.Networkinterfaces": - """retrieve. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Networkinterfaces, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Networkinterfaces - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.retrieve.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Networkinterfaces', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - networkinterfaces_name: str, - networkinterfaces: "models.Networkinterfaces", - **kwargs - ) -> "models.Networkinterfaces": - cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(networkinterfaces, 'Networkinterfaces') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Networkinterfaces', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Networkinterfaces', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - networkinterfaces_name: str, - networkinterfaces: "models.Networkinterfaces", - **kwargs - ) -> AsyncLROPoller["models.Networkinterfaces"]: - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :param networkinterfaces: - :type networkinterfaces: ~azure_stack_hci.models.Networkinterfaces - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Networkinterfaces or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Networkinterfaces] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - networkinterfaces_name=networkinterfaces_name, - networkinterfaces=networkinterfaces, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Networkinterfaces', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - networkinterfaces_name: str, - **kwargs - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - networkinterfaces_name: str, - networkinterfaces: "models.NetworkinterfacesPatch", - **kwargs - ) -> "models.Networkinterfaces": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :param networkinterfaces: - :type networkinterfaces: ~azure_stack_hci.models.NetworkinterfacesPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Networkinterfaces, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Networkinterfaces - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Networkinterfaces"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(networkinterfaces, 'NetworkinterfacesPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Networkinterfaces', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Networkinterfaces', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.NetworkinterfacesListResult"]: - """list_by_resource_group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkinterfacesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.NetworkinterfacesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkinterfacesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkinterfacesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.NetworkinterfacesListResult"]: - """list_by_subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkinterfacesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.NetworkinterfacesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkinterfacesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkinterfacesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkinterfaces'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py deleted file mode 100644 index dc4ff259aae..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_operations.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def list( - self, - **kwargs - ) -> "models.AvailableOperations": - """List all available Microsoft.AzureStackHCI provider operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AvailableOperations, or the result of cls(response) - :rtype: ~azure_stack_hci.models.AvailableOperations - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableOperations"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AvailableOperations', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.AzureStackHCI/operations'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py deleted file mode 100644 index 79b957255e7..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_storagecontainers_operations.py +++ /dev/null @@ -1,497 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class StoragecontainersOperations: - """StoragecontainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def retrieve( - self, - resource_group_name: str, - storagecontainers_name: str, - **kwargs - ) -> "models.Storagecontainers": - """retrieve. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Storagecontainers, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Storagecontainers - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.retrieve.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Storagecontainers', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - storagecontainers_name: str, - storagecontainers: "models.Storagecontainers", - **kwargs - ) -> "models.Storagecontainers": - cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(storagecontainers, 'Storagecontainers') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Storagecontainers', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Storagecontainers', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - storagecontainers_name: str, - storagecontainers: "models.Storagecontainers", - **kwargs - ) -> AsyncLROPoller["models.Storagecontainers"]: - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :param storagecontainers: - :type storagecontainers: ~azure_stack_hci.models.Storagecontainers - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Storagecontainers or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Storagecontainers] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - storagecontainers_name=storagecontainers_name, - storagecontainers=storagecontainers, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Storagecontainers', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - storagecontainers_name: str, - **kwargs - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - storagecontainers_name: str, - storagecontainers: "models.StoragecontainersPatch", - **kwargs - ) -> "models.Storagecontainers": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :param storagecontainers: - :type storagecontainers: ~azure_stack_hci.models.StoragecontainersPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Storagecontainers, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Storagecontainers - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Storagecontainers"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(storagecontainers, 'StoragecontainersPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Storagecontainers', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Storagecontainers', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.StoragecontainersListResult"]: - """list_by_resource_group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StoragecontainersListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.StoragecontainersListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StoragecontainersListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('StoragecontainersListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.StoragecontainersListResult"]: - """list_by_subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StoragecontainersListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.StoragecontainersListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StoragecontainersListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('StoragecontainersListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storagecontainers'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py deleted file mode 100644 index 0d2b24992e7..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualharddisks_operations.py +++ /dev/null @@ -1,497 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualharddisksOperations: - """VirtualharddisksOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def retrieve( - self, - resource_group_name: str, - virtualharddisks_name: str, - **kwargs - ) -> "models.Virtualharddisks": - """retrieve. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Virtualharddisks, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Virtualharddisks - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.retrieve.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Virtualharddisks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtualharddisks_name: str, - virtualharddisks: "models.Virtualharddisks", - **kwargs - ) -> "models.Virtualharddisks": - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtualharddisks, 'Virtualharddisks') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Virtualharddisks', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Virtualharddisks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtualharddisks_name: str, - virtualharddisks: "models.Virtualharddisks", - **kwargs - ) -> AsyncLROPoller["models.Virtualharddisks"]: - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :param virtualharddisks: - :type virtualharddisks: ~azure_stack_hci.models.Virtualharddisks - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Virtualharddisks or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Virtualharddisks] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtualharddisks_name=virtualharddisks_name, - virtualharddisks=virtualharddisks, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Virtualharddisks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - virtualharddisks_name: str, - **kwargs - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - virtualharddisks_name: str, - virtualharddisks: "models.VirtualharddisksPatch", - **kwargs - ) -> "models.Virtualharddisks": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :param virtualharddisks: - :type virtualharddisks: ~azure_stack_hci.models.VirtualharddisksPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Virtualharddisks, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Virtualharddisks - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualharddisks"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtualharddisks, 'VirtualharddisksPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Virtualharddisks', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Virtualharddisks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.VirtualharddisksListResult"]: - """list_by_resource_group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualharddisksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualharddisksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualharddisksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualharddisksListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.VirtualharddisksListResult"]: - """list_by_subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualharddisksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualharddisksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualharddisksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualharddisksListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualharddisks'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py deleted file mode 100644 index df9cac66094..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualmachines_operations.py +++ /dev/null @@ -1,609 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualmachinesOperations: - """VirtualmachinesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def retrieve( - self, - resource_group_name: str, - virtualmachines_name: str, - **kwargs - ) -> "models.Virtualmachines": - """retrieve. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Virtualmachines, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Virtualmachines - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.retrieve.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Virtualmachines', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtualmachines_name: str, - virtualmachines: "models.Virtualmachines", - **kwargs - ) -> "models.Virtualmachines": - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtualmachines, 'Virtualmachines') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Virtualmachines', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Virtualmachines', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtualmachines_name: str, - virtualmachines: "models.Virtualmachines", - **kwargs - ) -> AsyncLROPoller["models.Virtualmachines"]: - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param virtualmachines: - :type virtualmachines: ~azure_stack_hci.models.Virtualmachines - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Virtualmachines or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Virtualmachines] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtualmachines_name=virtualmachines_name, - virtualmachines=virtualmachines, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Virtualmachines', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - virtualmachines_name: str, - **kwargs - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - virtualmachines_name: str, - virtualmachines: "models.VirtualmachinesPatch", - **kwargs - ) -> "models.Virtualmachines": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param virtualmachines: - :type virtualmachines: ~azure_stack_hci.models.VirtualmachinesPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Virtualmachines, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Virtualmachines - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualmachines"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtualmachines, 'VirtualmachinesPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Virtualmachines', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Virtualmachines', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore - - async def start( - self, - resource_group_name: str, - virtualmachines_name: str, - **kwargs - ) -> None: - """start. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.start.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/start'} # type: ignore - - async def stop( - self, - resource_group_name: str, - virtualmachines_name: str, - **kwargs - ) -> None: - """stop. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.stop.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/stop'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.VirtualmachinesListResult"]: - """list_by_resource_group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualmachinesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualmachinesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualmachinesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualmachinesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.VirtualmachinesListResult"]: - """list_by_subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualmachinesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualmachinesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualmachinesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualmachinesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualmachines'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py deleted file mode 100644 index ceb55b4a00d..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/aio/operations/_virtualnetworks_operations.py +++ /dev/null @@ -1,497 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualnetworksOperations: - """VirtualnetworksOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure_stack_hci.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def retrieve( - self, - resource_group_name: str, - virtualnetworks_name: str, - **kwargs - ) -> "models.Virtualnetworks": - """retrieve. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Virtualnetworks, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Virtualnetworks - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.retrieve.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Virtualnetworks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtualnetworks_name: str, - virtualnetworks: "models.Virtualnetworks", - **kwargs - ) -> "models.Virtualnetworks": - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtualnetworks, 'Virtualnetworks') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Virtualnetworks', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Virtualnetworks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtualnetworks_name: str, - virtualnetworks: "models.Virtualnetworks", - **kwargs - ) -> AsyncLROPoller["models.Virtualnetworks"]: - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :param virtualnetworks: - :type virtualnetworks: ~azure_stack_hci.models.Virtualnetworks - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Virtualnetworks or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci.models.Virtualnetworks] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtualnetworks_name=virtualnetworks_name, - virtualnetworks=virtualnetworks, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Virtualnetworks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - virtualnetworks_name: str, - **kwargs - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - virtualnetworks_name: str, - virtualnetworks: "models.VirtualnetworksPatch", - **kwargs - ) -> "models.Virtualnetworks": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :param virtualnetworks: - :type virtualnetworks: ~azure_stack_hci.models.VirtualnetworksPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Virtualnetworks, or the result of cls(response) - :rtype: ~azure_stack_hci.models.Virtualnetworks - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Virtualnetworks"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtualnetworks, 'VirtualnetworksPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Virtualnetworks', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Virtualnetworks', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.VirtualnetworksListResult"]: - """list_by_resource_group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualnetworksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualnetworksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualnetworksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualnetworksListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.VirtualnetworksListResult"]: - """list_by_subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualnetworksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci.models.VirtualnetworksListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualnetworksListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualnetworksListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualnetworks'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py deleted file mode 100644 index d9c7402cab5..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/__init__.py +++ /dev/null @@ -1,307 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AvailableOperations - from ._models_py3 import AzureEntityResource - from ._models_py3 import Cluster - from ._models_py3 import ClusterNode - from ._models_py3 import ClusterReportedProperties - from ._models_py3 import ClusterUpdate - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse, ErrorResponseException - from ._models_py3 import Galleryimages - from ._models_py3 import GalleryimagesExtendedLocation - from ._models_py3 import GalleryimagesPatch - from ._models_py3 import GalleryimagesProperties - from ._models_py3 import GalleryimagesPropertiesIdentifier - from ._models_py3 import GalleryimagesPropertiesVersion - from ._models_py3 import HardwareProfileUpdate - from ._models_py3 import Networkinterfaces - from ._models_py3 import NetworkinterfacesExtendedLocation - from ._models_py3 import NetworkinterfacesPatch - from ._models_py3 import NetworkinterfacesProperties - from ._models_py3 import NetworkinterfacesPropertiesInterfaceDNSSettings - from ._models_py3 import NetworkinterfacesPropertiesIpConfigurationsItem - from ._models_py3 import NetworkinterfacesPropertiesIpConfigurationsItemProperties - from ._models_py3 import NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet - from ._models_py3 import NetworkProfileUpdate - from ._models_py3 import NetworkProfileUpdateNetworkInterfacesItem - from ._models_py3 import OperationDetail - from ._models_py3 import OperationDisplay - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import Storagecontainers - from ._models_py3 import StoragecontainersExtendedLocation - from ._models_py3 import StoragecontainersPatch - from ._models_py3 import StoragecontainersProperties - from ._models_py3 import StorageProfileUpdate - from ._models_py3 import StorageProfileUpdateDataDisksItem - from ._models_py3 import SystemData - from ._models_py3 import TrackedResource - from ._models_py3 import Virtualharddisks - from ._models_py3 import VirtualharddisksExtendedLocation - from ._models_py3 import VirtualharddisksPatch - from ._models_py3 import VirtualharddisksProperties - from ._models_py3 import Virtualmachines - from ._models_py3 import VirtualmachinesExtendedLocation - from ._models_py3 import VirtualmachinesPatch - from ._models_py3 import VirtualmachinesProperties - from ._models_py3 import VirtualmachinesPropertiesHardwareProfile - from ._models_py3 import VirtualmachinesPropertiesNetworkProfile - from ._models_py3 import VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem - from ._models_py3 import VirtualmachinesPropertiesOsProfile - from ._models_py3 import VirtualmachinesPropertiesOsProfileLinuxConfiguration - from ._models_py3 import VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh - from ._models_py3 import VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem - from ._models_py3 import VirtualmachinesPropertiesOsProfileWindowsConfiguration - from ._models_py3 import VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh - from ._models_py3 import VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem - from ._models_py3 import VirtualmachinesPropertiesSecurityProfile - from ._models_py3 import VirtualmachinesPropertiesSecurityProfileUefiSettings - from ._models_py3 import VirtualmachinesPropertiesStorageProfile - from ._models_py3 import VirtualmachinesPropertiesStorageProfileDataDisksItem - from ._models_py3 import VirtualmachinesPropertiesStorageProfileImageReference - from ._models_py3 import VirtualmachinesPropertiesStorageProfileOsDisk - from ._models_py3 import VirtualMachineUpdateProperties - from ._models_py3 import VirtualMachineGuestAgentProfile - from ._models_py3 import VirtualMachineGuestAgentProfileErrorDetail - from ._models_py3 import VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo - from ._models_py3 import Virtualnetworks - from ._models_py3 import VirtualnetworksExtendedLocation - from ._models_py3 import VirtualnetworksPatch - from ._models_py3 import VirtualnetworksProperties - from ._models_py3 import VirtualnetworksPropertiesDHCPOptions - from ._models_py3 import VirtualnetworksPropertiesSubnetsItem - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemProperties - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesIPPool - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem - from ._models_py3 import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties - from ._models_py3 import VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig - from ._models_py3 import VirtualmachinesIdentity - from ._models_py3 import ArcVmExtensions - from ._models_py3 import ArcVmExtensionsProperties - from ._models_py3 import ArcVmExtensionsInstanceView - from ._models_py3 import ArcVmExtensionsInstanceViewStatus - from ._models_py3 import ArcVmExtensionsPatch - from ._models_py3 import ResourceUpdate - from ._models_py3 import ArcVmExtensionsUpdate - from ._models_py3 import ArcVmExtensionsProperties - from ._models_py3 import ArcVmExtensionsListResult -except (SyntaxError, ImportError): - from ._models import AvailableOperations - from ._models import AzureEntityResource - from ._models import Cluster - from ._models import ClusterNode - from ._models import ClusterReportedProperties - from ._models import ClusterUpdate - from ._models import ErrorAdditionalInfo - from ._models import ErrorDetail - from ._models import ErrorResponse, ErrorResponseException - from ._models import Galleryimages - from ._models import GalleryimagesExtendedLocation - from ._models import GalleryimagesPatch - from ._models import GalleryimagesProperties - from ._models import GalleryimagesPropertiesIdentifier - from ._models import GalleryimagesPropertiesVersion - from ._models import HardwareProfileUpdate - from ._models import Networkinterfaces - from ._models import NetworkinterfacesExtendedLocation - from ._models import NetworkinterfacesPatch - from ._models import NetworkinterfacesProperties - from ._models import NetworkinterfacesPropertiesInterfaceDNSSettings - from ._models import NetworkinterfacesPropertiesIpConfigurationsItem - from ._models import NetworkinterfacesPropertiesIpConfigurationsItemProperties - from ._models import NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet - from ._models import NetworkProfileUpdate - from ._models import NetworkProfileUpdateNetworkInterfacesItem - from ._models import OperationDetail - from ._models import OperationDisplay - from ._models import ProxyResource - from ._models import Resource - from ._models import Storagecontainers - from ._models import StoragecontainersExtendedLocation - from ._models import StoragecontainersPatch - from ._models import StoragecontainersProperties - from ._models import StorageProfileUpdate - from ._models import StorageProfileUpdateDataDisksItem - from ._models import SystemData - from ._models import TrackedResource - from ._models import Virtualharddisks - from ._models import VirtualharddisksExtendedLocation - from ._models import VirtualharddisksPatch - from ._models import VirtualharddisksProperties - from ._models import Virtualmachines - from ._models import VirtualmachinesExtendedLocation - from ._models import VirtualmachinesPatch - from ._models import VirtualmachinesProperties - from ._models import VirtualmachinesPropertiesHardwareProfile - from ._models import VirtualmachinesPropertiesNetworkProfile - from ._models import VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem - from ._models import VirtualmachinesPropertiesOsProfile - from ._models import VirtualmachinesPropertiesOsProfileLinuxConfiguration - from ._models import VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh - from ._models import VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem - from ._models import VirtualmachinesPropertiesOsProfileWindowsConfiguration - from ._models import VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh - from ._models import VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem - from ._models import VirtualmachinesPropertiesSecurityProfile - from ._models import VirtualmachinesPropertiesSecurityProfileUefiSettings - from ._models import VirtualmachinesPropertiesStorageProfile - from ._models import VirtualmachinesPropertiesStorageProfileDataDisksItem - from ._models import VirtualmachinesPropertiesStorageProfileImageReference - from ._models import VirtualmachinesPropertiesStorageProfileOsDisk - from ._models import VirtualMachineUpdateProperties - from ._models import VirtualMachineGuestAgentProfile - from ._models import VirtualMachineGuestAgentProfileErrorDetail - from ._models import VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo - from ._models import Virtualnetworks - from ._models import VirtualnetworksExtendedLocation - from ._models import VirtualnetworksPatch - from ._models import VirtualnetworksProperties - from ._models import VirtualnetworksPropertiesDHCPOptions - from ._models import VirtualnetworksPropertiesSubnetsItem - from ._models import VirtualnetworksPropertiesSubnetsItemProperties - from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem - from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesIPPool - from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable - from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties - from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem - from ._models import VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties - from ._models import VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig - from ._models import VirtualmachinesIdentity - from ._models import ArcVmExtensions - from ._models import ArcVmExtensionsProperties - from ._models import ArcVmExtensionsInstanceView - from ._models import ArcVmExtensionsInstanceViewStatus - from ._models import ArcVmExtensionsPatch - from ._models import ResourceUpdate - from ._models import ArcVmExtensionsUpdate - from ._models import ArcVmExtensionsUpdateProperties - from ._models import ArcVmExtensionsListResult -from ._paged_models import ClusterPaged -from ._paged_models import GalleryimagesPaged -from ._paged_models import NetworkinterfacesPaged -from ._paged_models import StoragecontainersPaged -from ._paged_models import VirtualharddisksPaged -from ._paged_models import VirtualmachinesPaged -from ._paged_models import VirtualnetworksPaged -from ._paged_models import ArcVmExtensionsPaged -from ._azure_stack_hci_client_enums import ( - CreatedByType, - ProvisioningState, - Status, -) - -__all__ = [ - 'AvailableOperations', - 'AzureEntityResource', - 'Cluster', - 'ClusterNode', - 'ClusterReportedProperties', - 'ClusterUpdate', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', 'ErrorResponseException', - 'Galleryimages', - 'GalleryimagesExtendedLocation', - 'GalleryimagesPatch', - 'GalleryimagesProperties', - 'GalleryimagesPropertiesIdentifier', - 'GalleryimagesPropertiesVersion', - 'HardwareProfileUpdate', - 'Networkinterfaces', - 'NetworkinterfacesExtendedLocation', - 'NetworkinterfacesPatch', - 'NetworkinterfacesProperties', - 'NetworkinterfacesPropertiesInterfaceDNSSettings', - 'NetworkinterfacesPropertiesIpConfigurationsItem', - 'NetworkinterfacesPropertiesIpConfigurationsItemProperties', - 'NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet', - 'NetworkProfileUpdate', - 'NetworkProfileUpdateNetworkInterfacesItem', - 'OperationDetail', - 'OperationDisplay', - 'ProxyResource', - 'Resource', - 'Storagecontainers', - 'StoragecontainersExtendedLocation', - 'StoragecontainersPatch', - 'StoragecontainersProperties', - 'StorageProfileUpdate', - 'StorageProfileUpdateDataDisksItem', - 'SystemData', - 'TrackedResource', - 'Virtualharddisks', - 'VirtualharddisksExtendedLocation', - 'VirtualharddisksPatch', - 'VirtualharddisksProperties', - 'Virtualmachines', - 'VirtualmachinesExtendedLocation', - 'VirtualmachinesPatch', - 'VirtualmachinesProperties', - 'VirtualmachinesPropertiesHardwareProfile', - 'VirtualmachinesPropertiesNetworkProfile', - 'VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem', - 'VirtualmachinesPropertiesOsProfile', - 'VirtualmachinesPropertiesOsProfileLinuxConfiguration', - 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh', - 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem', - 'VirtualmachinesPropertiesOsProfileWindowsConfiguration', - 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh', - 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem', - 'VirtualmachinesPropertiesSecurityProfile', - 'VirtualmachinesPropertiesStorageProfile', - 'VirtualmachinesPropertiesStorageProfileDataDisksItem', - 'VirtualmachinesPropertiesStorageProfileImageReference', - 'VirtualMachineUpdateProperties', - 'VirtualMachineGuestAgentProfile', - 'VirtualMachineGuestAgentProfileErrorDetail', - 'VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo', - 'Virtualnetworks', - 'VirtualnetworksExtendedLocation', - 'VirtualnetworksPatch', - 'VirtualnetworksProperties', - 'VirtualnetworksPropertiesDHCPOptions', - 'VirtualnetworksPropertiesSubnetsItem', - 'VirtualnetworksPropertiesSubnetsItemProperties', - 'VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem', - 'VirtualnetworksPropertiesSubnetsItemPropertiesIPPool', - 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable', - 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties', - 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem', - 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties', - 'GalleryimagesPaged', - 'NetworkinterfacesPaged', - 'VirtualharddisksPaged', - 'VirtualmachinesPaged', - 'VirtualnetworksPaged', - 'StoragecontainersPaged', - 'ClusterPaged', - 'CreatedByType', - 'ProvisioningState', - 'Status', - 'VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig', - 'VirtualmachinesIdentity', - 'ArcVmExtensions', - 'ArcVmExtensionsProperties', - 'ArcVmExtensionsInstanceView', - 'ArcVmExtensionsInstanceViewStatus', - 'ArcVmExtensionsPatch', - 'ResourceUpdate', - 'ArcVmExtensionsUpdate', - 'ArcVmExtensionsUpdateProperties', - 'ArcVmExtensionsListResult' -] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py deleted file mode 100644 index b094a0de43d..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_client_enums.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class CreatedByType(str, Enum): - - user = "User" - application = "Application" - managed_identity = "ManagedIdentity" - key = "Key" - - -class ProvisioningState(str, Enum): - - succeeded = "Succeeded" - failed = "Failed" - canceled = "Canceled" - accepted = "Accepted" - provisioning = "Provisioning" - - -class Status(str, Enum): - - connected = "Connected" - disconnected = "Disconnected" - error = "Error" diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py deleted file mode 100644 index 2ae785e6379..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_azure_stack_hci_enums.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - ACCEPTED = "Accepted" - PROVISIONING = "Provisioning" - -class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the cluster agent. - """ - - NOT_YET_REGISTERED = "NotYetRegistered" - CONNECTED_RECENTLY = "ConnectedRecently" - NOT_CONNECTED_RECENTLY = "NotConnectedRecently" - DISCONNECTED = "Disconnected" - ERROR = "Error" diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py deleted file mode 100644 index 5466aea22b0..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models.py +++ /dev/null @@ -1,2678 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from ast import Mod -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class AvailableOperations(Model): - """Available operations of the service. - - :param value: Collection of available operation details - :type value: list[~azure.mgmt.azurestackhci.models.OperationDetail] - :param next_link: URL client should use to fetch the next page (per server - side paging). - It's null for now, added for future use. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationDetail]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AvailableOperations, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class Resource(Model): - """Common fields that are returned in the response for all Azure Resource - Manager resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AzureEntityResource(Resource): - """The resource model definition for an Azure Resource Manager resource with - an etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top - level resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) - - -class Cluster(TrackedResource): - """Cluster details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning state. Possible values include: - 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' - :vartype provisioning_state: str or - ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar status: Status of the cluster agent. Possible values include: - 'Connected', 'Disconnected', 'Error' - :vartype status: str or ~azure.mgmt.azurestackhci.models.Status - :ivar cloud_id: Unique, immutable resource id. - :vartype cloud_id: str - :param aad_client_id: Required. App id of cluster AAD identity. - :type aad_client_id: str - :param aad_tenant_id: Required. Tenant id of cluster AAD identity. - :type aad_tenant_id: str - :param reported_properties: Properties reported by cluster agent. - :type reported_properties: - ~azure.mgmt.azurestackhci.models.ClusterReportedProperties - :ivar trial_days_remaining: Number of days remaining in the trial period. - :vartype trial_days_remaining: float - :ivar billing_model: Type of billing applied to the resource. - :vartype billing_model: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - 'cloud_id': {'readonly': True}, - 'aad_client_id': {'required': True}, - 'aad_tenant_id': {'required': True}, - 'trial_days_remaining': {'readonly': True}, - 'billing_model': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'cloud_id': {'key': 'properties.cloudId', 'type': 'str'}, - 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, - 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, - 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, - 'trial_days_remaining': {'key': 'properties.trialDaysRemaining', 'type': 'float'}, - 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Cluster, self).__init__(**kwargs) - self.system_data = kwargs.get('system_data', None) - self.provisioning_state = None - self.status = None - self.cloud_id = None - self.aad_client_id = kwargs.get('aad_client_id', None) - self.aad_tenant_id = kwargs.get('aad_tenant_id', None) - self.reported_properties = kwargs.get('reported_properties', None) - self.trial_days_remaining = None - self.billing_model = None - - -class ClusterNode(Model): - """Cluster node details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Name of the cluster node. - :vartype name: str - :ivar id: Id of the node in the cluster. - :vartype id: float - :ivar manufacturer: Manufacturer of the cluster node hardware. - :vartype manufacturer: str - :ivar model: Model name of the cluster node hardware. - :vartype model: str - :ivar os_name: Operating system running on the cluster node. - :vartype os_name: str - :ivar os_version: Version of the operating system running on the cluster - node. - :vartype os_version: str - :ivar serial_number: Immutable id of the cluster node. - :vartype serial_number: str - :ivar core_count: Number of physical cores on the cluster node. - :vartype core_count: float - :ivar memory_in_gi_b: Total available memory on the cluster node (in GiB). - :vartype memory_in_gi_b: float - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'manufacturer': {'readonly': True}, - 'model': {'readonly': True}, - 'os_name': {'readonly': True}, - 'os_version': {'readonly': True}, - 'serial_number': {'readonly': True}, - 'core_count': {'readonly': True}, - 'memory_in_gi_b': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'float'}, - 'manufacturer': {'key': 'manufacturer', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - 'os_name': {'key': 'osName', 'type': 'str'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'core_count': {'key': 'coreCount', 'type': 'float'}, - 'memory_in_gi_b': {'key': 'memoryInGiB', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ClusterNode, self).__init__(**kwargs) - self.name = None - self.id = None - self.manufacturer = None - self.model = None - self.os_name = None - self.os_version = None - self.serial_number = None - self.core_count = None - self.memory_in_gi_b = None - - -class ClusterReportedProperties(Model): - """Properties reported by cluster agent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar cluster_name: Name of the on-prem cluster connected to this - resource. - :vartype cluster_name: str - :ivar cluster_id: Unique id generated by the on-prem cluster. - :vartype cluster_id: str - :ivar cluster_version: Version of the cluster software. - :vartype cluster_version: str - :ivar nodes: List of nodes reported by the cluster. - :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] - :ivar last_updated: Last time the cluster reported the data. - :vartype last_updated: datetime - """ - - _validation = { - 'cluster_name': {'readonly': True}, - 'cluster_id': {'readonly': True}, - 'cluster_version': {'readonly': True}, - 'nodes': {'readonly': True}, - 'last_updated': {'readonly': True}, - } - - _attribute_map = { - 'cluster_name': {'key': 'clusterName', 'type': 'str'}, - 'cluster_id': {'key': 'clusterId', 'type': 'str'}, - 'cluster_version': {'key': 'clusterVersion', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': '[ClusterNode]'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ClusterReportedProperties, self).__init__(**kwargs) - self.cluster_name = None - self.cluster_id = None - self.cluster_version = None - self.nodes = None - self.last_updated = None - - -class ClusterUpdate(Model): - """Cluster details to update. - - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ClusterUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class ErrorAdditionalInfo(Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: object - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__(self, **kwargs): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(Model): - """Error response. - - Common error response for all Azure Resource Manager APIs to return error - details for failed operations. (This also follows the OData error response - format.). - - :param error: The error object. - :type error: ~azure.mgmt.azurestackhci.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) - - -class Galleryimages(Model): - """The galleryimages resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: ~azure.mgmt.azurestackhci.models.GalleryimagesProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.GalleryimagesExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'GalleryimagesProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'GalleryimagesExtendedLocation'}, - } - - def __init__(self, **kwargs): - super(Galleryimages, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - self.extended_location = kwargs.get('extended_location', None) - - -class GalleryimagesExtendedLocation(Model): - """GalleryimagesExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(GalleryimagesExtendedLocation, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class GalleryimagesPatch(Model): - """The galleryimages resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(GalleryimagesPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class GalleryimagesProperties(Model): - """GalleryimagesProperties. - - :param storagepath_id: Azure ID of the storagepath which is used to store the Gallery Images. - :type storagepath_id: str - :param image_path: location of the image the gallery image should be - created from - :type image_path: str - :param os_type: operating system type that the gallery image uses. - Expected to be linux or windows - :type os_type: str - :param provisioning_state: - :type provisioning_state: str - :param status: MOCGalleryImageStatus defines the observed state of - MOCGalleryImage - :type status: object - :param identifier: galleryImageIdentifier defines the identity of the gallery image - :type identifier: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesIdentifier - :param version: version of the gallery image. - :type version: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesVersion - """ - - _attribute_map = { - 'storagepath_id': {'key': 'containerName', 'type': 'str'}, - 'image_path': {'key': 'imagePath', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'identifier': {'key': 'identifier', 'type': 'GalleryimagesPropertiesIdentifier'}, - 'version': {'key': 'version', 'type': 'GalleryimagesPropertiesVersion'}, - } - - def __init__(self, **kwargs): - super(GalleryimagesProperties, self).__init__(**kwargs) - self.storagepath_id = kwargs.get('storagepath_id', None) - self.image_path = kwargs.get('image_path', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.status = kwargs.get('status', None) - self.identifier = kwargs.get('identifier', None) - self.version = kwargs.get('version', None) - -class GalleryimagesPropertiesIdentifier(Model): - """GalleryimagesPropertiesIdentifier. - - :param offer: The name of the gallery image definition offer - :type offer: str - :param pubilsher: The name of the gallery image definition publisher - :type publisher: str - :param sku: The name of the gallery image definition SKU - :type sku: str - """ - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(GalleryimagesPropertiesIdentifier, self).__init__(**kwargs) - self.offer = kwargs.get('offer', None) - self.publisher = kwargs.get('publisher', None) - self.sku = kwargs.get('sku', None) - -class GalleryimagesPropertiesVersion(Model): - """GalleryimagesPropertiesIdentifier. - - :param name: The name of the gallery image version - :type name: str - - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(GalleryimagesPropertiesVersion, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - - -class HardwareProfileUpdate(Model): - """HardwareProfile - Specifies the hardware settings for the virtual machine. - - :param vm_size: - :type vm_size: str - :param processors: number of processors for the virtual machine - :type processors: int - :param memory_mb: RAM in mb for the virtual machine - :type memory_mb: int - """ - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'processors': {'key': 'processors', 'type': 'int'}, - 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(HardwareProfileUpdate, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.processors = kwargs.get('processors', None) - self.memory_mb = kwargs.get('memory_mb', None) - - -class Networkinterfaces(Model): - """The networkinterfaces resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'NetworkinterfacesProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'NetworkinterfacesExtendedLocation'}, - } - - def __init__(self, **kwargs): - super(Networkinterfaces, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - self.extended_location = kwargs.get('extended_location', None) - - -class NetworkinterfacesExtendedLocation(Model): - """NetworkinterfacesExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesExtendedLocation, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class NetworkinterfacesPatch(Model): - """The networkinterfaces resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class NetworkinterfacesProperties(Model): - """MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface. - - :param ip_configurations: IPConfigurations - A list of IPConfigurations of - the network interface. - :type ip_configurations: - list[~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItem] - :param mac_address: MacAddress - The MAC address of the network interface. - :type mac_address: str - :param dns_settings: DNS Settings for the interface - :type dns_settings: ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesInterfaceDNSSettings - :param provisioning_state: - :type provisioning_state: str - :param status: MOCNetworkInterfaceStatus defines the observed state of - MOCNetworkInterface - :type status: object - :param resource_name: name of the object to be used in moc - :type resource_name: str - """ - - _attribute_map = { - 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NetworkinterfacesPropertiesIpConfigurationsItem]'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - 'dns_settings': {'key': 'dnsSettings', 'type': 'NetworkinterfacesPropertiesInterfaceDNSSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'resource_name' : {'key': 'resourceName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesProperties, self).__init__(**kwargs) - self.ip_configurations = kwargs.get('ip_configurations', None) - self.mac_address = kwargs.get('mac_address', None) - self.dns_settings = kwargs.get('dns_settings', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.status = kwargs.get('status', None) - self.resource_name = kwargs.get('resource_name', None) - - -class NetworkinterfacesPropertiesIpConfigurationsItem(Model): - """InterfaceIPConfiguration iPConfiguration in a network interface. - - :param name: Name - The name of the resource that is unique within a - resource group. This name can be used to access the resource. - :type name: str - :param properties: InterfaceIPConfigurationPropertiesFormat properties of - IP configuration. - :type properties: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemProperties'}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesPropertiesIpConfigurationsItem, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.properties = kwargs.get('properties', None) - - -class NetworkinterfacesPropertiesIpConfigurationsItemProperties(Model): - """InterfaceIPConfigurationPropertiesFormat properties of IP configuration. - - :param gateway: Gateway for network interface - :type gateway: str - :param prefix_length: prefixLength for network interface - :type prefix_length: str - :param private_ip_address: PrivateIPAddress - Private IP address of the IP - configuration. - :type private_ip_address: str - :param private_ip_allocation_method: PrivateIPAllocationMethod - The - private IP address allocation method. Possible values include: 'Static', - 'Dynamic' - :type private_ip_allocation_method: str - :param subnet: Subnet - Name of Subnet bound to the IP configuration. - :type subnet: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet - """ - - _attribute_map = { - 'gateway': {'key': 'gateway', 'type': 'str'}, - 'prefix_length': {'key': 'prefixLength', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet'}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesPropertiesIpConfigurationsItemProperties, self).__init__(**kwargs) - self.gateway = kwargs.get('gateway', None) - self.prefix_length = kwargs.get('prefix_length', None) - self.private_ip_address = kwargs.get('private_ip_address', None) - self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) - self.subnet = kwargs.get('subnet', None) - - -class NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet(Model): - """Subnet - Name of Subnet bound to the IP configuration. - - :param id: ID - The ARM resource id in the form of - /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class NetworkinterfacesPropertiesInterfaceDNSSettings(Model): - """NetworkinterfacesPropertiesInterfaceDNSSettings. - - :param dns_servers: List of DNS server IP Addresses for the interface. - :type dns_servers: list[str] - """ - - _attribute_map = { - "dns_servers": {"key": "dnsServers", "type": "[str]"}, - } - - def __init__(self, **kwargs): - super(NetworkinterfacesPropertiesInterfaceDNSSettings, self).__init__(**kwargs) - self.dns_servers = kwargs.get('dns_servers', None) - - -class NetworkProfileUpdate(Model): - """NetworkProfile - describes the network update configuration the virtual - machine. - - :param network_interfaces: NetworkInterfaces - list of network interfaces - to be attached to the virtual machine - :type network_interfaces: - list[~azure.mgmt.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem] - """ - - _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkProfileUpdateNetworkInterfacesItem]'}, - } - - def __init__(self, **kwargs): - super(NetworkProfileUpdate, self).__init__(**kwargs) - self.network_interfaces = kwargs.get('network_interfaces', None) - - -class NetworkProfileUpdateNetworkInterfacesItem(Model): - """NetworkProfileUpdateNetworkInterfacesItem. - - :param id: ID - Resource Id - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(NetworkProfileUpdateNetworkInterfacesItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class OperationDetail(Model): - """Operation detail payload. - - :param name: Name of the operation - :type name: str - :param is_data_action: Indicates whether the operation is a data action - :type is_data_action: bool - :param display: Display of the operation - :type display: ~azure.mgmt.azurestackhci.models.OperationDisplay - :param origin: Origin of the operation - :type origin: str - :param properties: Properties of the operation - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(OperationDetail, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.is_data_action = kwargs.get('is_data_action', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - - -class OperationDisplay(Model): - """Operation display payload. - - :param provider: Resource provider of the operation - :type provider: str - :param resource: Resource of the operation - :type resource: str - :param operation: Localized friendly name for the operation - :type operation: str - :param description: Localized friendly description for the operation - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ProxyResource(Resource): - """The resource model definition for an Azure Resource Manager proxy resource. - It will have everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ProxyResource, self).__init__(**kwargs) - - -class Storagecontainers(Model): - """The storagecontainers resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.StoragecontainersProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.StoragecontainersExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'StoragecontainersProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'StoragecontainersExtendedLocation'}, - } - - def __init__(self, **kwargs): - super(Storagecontainers, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - self.extended_location = kwargs.get('extended_location', None) - - -class StoragecontainersExtendedLocation(Model): - """StoragecontainersExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StoragecontainersExtendedLocation, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class StoragecontainersPatch(Model): - """The storagecontainers resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(StoragecontainersPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class StoragecontainersProperties(Model): - """StoragecontainersProperties. - - :param path: location of the image the gallery image should be created - from - :type path: str - :param provisioning_state: - :type provisioning_state: str - :param status: MOCStorageContainerStatus defines the observed state of - MOCStorageContainer - :type status: object - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(StoragecontainersProperties, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.status = kwargs.get('status', None) - - -class StorageProfileUpdate(Model): - """StorageProfileUpdate. - - :param data_disks: adds data disks to the virtual machine for the update - call - :type data_disks: - list[~azure.mgmt.azurestackhci.models.StorageProfileUpdateDataDisksItem] - """ - - _attribute_map = { - 'data_disks': {'key': 'dataDisks', 'type': '[StorageProfileUpdateDataDisksItem]'}, - } - - def __init__(self, **kwargs): - super(StorageProfileUpdate, self).__init__(**kwargs) - self.data_disks = kwargs.get('data_disks', None) - - -class StorageProfileUpdateDataDisksItem(Model): - """StorageProfileUpdateDataDisksItem. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageProfileUpdateDataDisksItem, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class SystemData(Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. - Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - :type created_by_type: str or - ~azure.mgmt.azurestackhci.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the - resource. Possible values include: 'User', 'Application', - 'ManagedIdentity', 'Key' - :type last_modified_by_type: str or - ~azure.mgmt.azurestackhci.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. - :type last_modified_at: datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class Virtualharddisks(Model): - """The virtualharddisks resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualharddisksProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.VirtualharddisksExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualharddisksProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualharddisksExtendedLocation'}, - } - - def __init__(self, **kwargs): - super(Virtualharddisks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - self.extended_location = kwargs.get('extended_location', None) - - -class VirtualharddisksExtendedLocation(Model): - """VirtualharddisksExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualharddisksExtendedLocation, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class VirtualharddisksPatch(Model): - """The virtualharddisks resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(VirtualharddisksPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class VirtualharddisksProperties(Model): - """MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk. - - :param block_size_bytes: - :type block_size_bytes: int - :param disk_size_gb: diskSizeGB - size of the disk in GB - :type disk_size_gb: long - :param dynamic: Boolean for enabling dynamic sizing on the virtual hard - disk - :type dynamic: bool - :param logical_sector_bytes: - :type logical_sector_bytes: int - :param physical_sector_bytes: - :type physical_sector_bytes: int - :param storagepath_id: - :type storagepath_id: str - :param provisioning_state: - :type provisioning_state: str - :param status: MOCVirtualHardDiskStatus defines the observed state of - MOCVirtualHardDisk - :type status: object - :param disk_file_format: file format of the hard disk. - Expected to be vhd or vhdx - :type disk_file_format: str - """ - - _attribute_map = { - 'block_size_bytes': {'key': 'blockSizeBytes', 'type': 'int'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'long'}, - 'dynamic': {'key': 'dynamic', 'type': 'bool'}, - 'logical_sector_bytes': {'key': 'logicalSectorBytes', 'type': 'int'}, - 'physical_sector_bytes': {'key': 'physicalSectorBytes', 'type': 'int'}, - 'storagepath_id': {'key': 'containerId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'disk_file_format': {'key': 'diskFileFormat', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualharddisksProperties, self).__init__(**kwargs) - self.block_size_bytes = kwargs.get('block_size_bytes', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.dynamic = kwargs.get('dynamic', None) - self.logical_sector_bytes = kwargs.get('logical_sector_bytes', None) - self.physical_sector_bytes = kwargs.get('physical_sector_bytes', None) - self.storagepath_id = kwargs.get('storagepath_id', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.status = kwargs.get('status', None) - self.disk_file_format = kwargs.get('disk_file_format', None) - - -class Virtualmachines(Model): - """The virtualmachines resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualmachinesProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.VirtualmachinesExtendedLocation - :param identity: - :type identity: - ~azure.mgmt.azurestackhci.models.VirtualmachinesIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualmachinesProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualmachinesExtendedLocation'}, - 'identity': {'key': 'identity', 'type': 'VirtualmachinesIdentity'}, - } - - def __init__(self, **kwargs): - super(Virtualmachines, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - self.extended_location = kwargs.get('extended_location', None) - self.identity = kwargs.get('identity', None) - - -class VirtualmachinesExtendedLocation(Model): - """VirtualmachinesExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesExtendedLocation, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class VirtualmachinesIdentity(Model): - """VirtualmachinesIdentity - - :param type: The identity type. - :type type: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - - -class VirtualmachinesPatch(Model): - """The virtualmachines resource patch definition. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualMachineUpdateProperties - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineUpdateProperties'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPatch, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class VirtualmachinesProperties(Model): - """MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine. - - :param hardware_profile: HardwareProfile - Specifies the hardware settings - for the virtual machine. - :type hardware_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile - :param network_profile: NetworkProfile - describes the network - configuration the virtual machine - :type network_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile - :param os_profile: OsProfile - describes the configuration of the - operating system and sets login data - :type os_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfile - :param security_profile: SecurityProfile - Specifies the security settings - for the virtual machine. - :type security_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile - :param storage_profile: StorageProfile - contains information about the - disks and storage information for the virtual machine - :type storage_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfile - :param provisioning_state: - :type provisioning_state: str - :param status: MOCVirtualMachineStatus defines the observed state of - MOCVirtualMachine - :type status: object - :param guest_agent_profile: GuestAgentProfile - Contains information related - to guest agent. - :type guest_agent_profile: - ~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfile - """ - - _attribute_map = { - 'hardware_profile': {'key': 'hardwareProfile', 'type': 'VirtualmachinesPropertiesHardwareProfile'}, - 'network_profile': {'key': 'networkProfile', 'type': 'VirtualmachinesPropertiesNetworkProfile'}, - 'os_profile': {'key': 'osProfile', 'type': 'VirtualmachinesPropertiesOsProfile'}, - 'security_profile': {'key': 'securityProfile', 'type': 'VirtualmachinesPropertiesSecurityProfile'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualmachinesPropertiesStorageProfile'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'guest_agent_profile': {'key': 'guestAgentProfile', 'type': 'VirtualMachineGuestAgentProfile'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesProperties, self).__init__(**kwargs) - self.hardware_profile = kwargs.get('hardware_profile', None) - self.network_profile = kwargs.get('network_profile', None) - self.os_profile = kwargs.get('os_profile', None) - self.security_profile = kwargs.get('security_profile', None) - self.storage_profile = kwargs.get('storage_profile', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.status = kwargs.get('status', None) - - -class VirtualmachinesPropertiesHardwareProfile(Model): - """HardwareProfile - Specifies the hardware settings for the virtual machine. - - :param vm_size: - :type vm_size: str - :param processors: number of processors for the virtual machine - :type processors: int - :param memory_mb: RAM in mb for the virtual machine. - :type memory_mb: int - :param dynamic_memory_config: - :type dynamic_memory_config: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig - """ - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'processors': {'key': 'processors', 'type': 'int'}, - 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, - 'dynamic_memory_config': {'key': 'dynamicMemoryConfig', 'type': 'VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesHardwareProfile, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.processors = kwargs.get('processors', None) - self.memory_mb = kwargs.get('memory_mb', None) - self.dynamic_memory_config = kwargs.get('dynamic_memory_config', None) - -class VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig(Model): - """VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig. - - :param maximum_memory_mb: - :type maximum_memory_mb: long - :param minimum_memory_mb: - :type minimum_memory_mb: long - :param target_memory_buffer: - :type target_memory_buffer: int - """ - - _attribute_map = { - 'maximum_memory_mb': {'key': 'maximumMemoryMB', 'type': 'long'}, - 'minimum_memory_mb': {'key': 'minimumMemoryMB', 'type': 'long'}, - 'target_memory_buffer': {'key': 'targetMemoryBuffer', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig, self).__init__(**kwargs) - self.maximum_memory_mb = kwargs.get('maximum_memory_mb', None) - self.minimum_memory_mb = kwargs.get('minimum_memory_mb', None) - self.target_memory_buffer = kwargs.get('target_memory_buffer', None) - -class VirtualmachinesPropertiesNetworkProfile(Model): - """NetworkProfile - describes the network configuration the virtual machine. - - :param network_interfaces: NetworkInterfaces - list of network interfaces - to be attached to the virtual machine - :type network_interfaces: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem] - """ - - _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem]'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesNetworkProfile, self).__init__(**kwargs) - self.network_interfaces = kwargs.get('network_interfaces', None) - - -class VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem(Model): - """VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem. - - :param id: ID - Resource Id - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class VirtualmachinesPropertiesOsProfile(Model): - """OsProfile - describes the configuration of the operating system and sets - login data. - - :param admin_password: AdminPassword - admin password - :type admin_password: str - :param admin_username: AdminUsername - admin username - :type admin_username: str - :param computer_name: ComputerName - name of the compute - :type computer_name: str - :param linux_configuration: LinuxConfiguration - linux specific - configuration values for the virtual machine - :type linux_configuration: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfiguration - :param os_type: OsType - string specifying whether the OS is Linux or - Windows - :type os_type: str - :param windows_configuration: Windows Configuration for the virtual - machine - :type windows_configuration: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfiguration - """ - - _attribute_map = { - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfiguration'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfiguration'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfile, self).__init__(**kwargs) - self.admin_password = kwargs.get('admin_password', None) - self.admin_username = kwargs.get('admin_username', None) - self.computer_name = kwargs.get('computer_name', None) - self.linux_configuration = kwargs.get('linux_configuration', None) - self.os_type = kwargs.get('os_type', None) - self.windows_configuration = kwargs.get('windows_configuration', None) - - -class VirtualmachinesPropertiesOsProfileLinuxConfiguration(Model): - """LinuxConfiguration - linux specific configuration values for the virtual - machine. - - :param disable_password_authentication: DisablePasswordAuthentication - - whether password authentication should be disabled - :type disable_password_authentication: bool - :param ssh: SSH - contains settings related to ssh configuration - :type ssh: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh - :param provision_vm_agent: Whether to provision guest management agent - :type provision_vm_agent: bool - """ - - _attribute_map = { - 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, - 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh'}, - 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfileLinuxConfiguration, self).__init__(**kwargs) - self.disable_password_authentication = kwargs.get('disable_password_authentication', None) - self.ssh = kwargs.get('ssh', None) - self.provision_vm_agent = kwargs.get('provision_vm_agent', None) - - -class VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh(Model): - """SSH - contains settings related to ssh configuration. - - :param public_keys: PublicKeys - The list of SSH public keys used to - authenticate with linux based VMs. - :type public_keys: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem] - """ - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem]'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) - - -class VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem(Model): - """VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem. - - :param key_data: KeyData - SSH public key certificate used to authenticate - with the VM through ssh. The key needs to be at least 2048-bit and in - ssh-rsa format.

For creating ssh keys, see [Create SSH keys on - Linux and Mac for Li nux VMs in - Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - :type key_data: str - :param path: Path - Specifies the full path on the created VM where ssh - public key is stored. If the file already exists, the specified key is - appended to the file. Example: /home/user/.ssh/authorized_keys - :type path: str - """ - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) - self.path = kwargs.get('path', None) - - -class VirtualmachinesPropertiesOsProfileWindowsConfiguration(Model): - """Windows Configuration for the virtual machine . - - :param enable_automatic_updates: Whether to EnableAutomaticUpdates on the - machine - :type enable_automatic_updates: bool - :param provision_vm_agent: Whether to provision guest management agent - :type provision_vm_agent: bool - :param ssh: AdditionalUnattendContent AdditionalUnattendContent - *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - SSH - :type ssh: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh - :param time_zone: TimeZone for the virtual machine - :type time_zone: str - """ - - _attribute_map = { - 'enable_automatic_updates': {'key': 'enableAutomaticUpdates', 'type': 'bool'}, - 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfileWindowsConfiguration, self).__init__(**kwargs) - self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) - self.ssh = kwargs.get('ssh', None) - self.time_zone = kwargs.get('time_zone', None) - self.provision_vm_agent = kwargs.get('provision_vm_agent', None) - - -class VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh(Model): - """AdditionalUnattendContent AdditionalUnattendContent - *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - SSH. - - :param public_keys: PublicKeys - The list of SSH public keys used to - authenticate with linux based VMs. - :type public_keys: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem] - """ - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem]'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) - - -class VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem(Model): - """VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem. - - :param key_data: KeyData - SSH public key certificate used to authenticate - with the VM through ssh. The key needs to be at least 2048-bit and in - ssh-rsa format.

For creating ssh keys, see [Create SSH keys on - Linux and Mac for Li nux VMs in - Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - :type key_data: str - :param path: Path - Specifies the full path on the created VM where ssh - public key is stored. If the file already exists, the specified key is - appended to the file. Example: /home/user/.ssh/authorized_keys - :type path: str - """ - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) - self.path = kwargs.get('path', None) - - -class VirtualmachinesPropertiesSecurityProfile(Model): - """SecurityProfile - Specifies the security settings for the virtual machine. - - :param enable_tpm: - :type enable_tpm: bool - :param uefi_settings: - :type uefi_settings: ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfileUefiSettings - """ - - _attribute_map = { - 'enable_tpm': {'key': 'enableTPM', 'type': 'bool'}, - 'uefi_settings': {'key': 'uefiSettings', 'type': 'VirtualmachinesPropertiesSecurityProfileUefiSettings'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesSecurityProfile, self).__init__(**kwargs) - self.enable_tpm = kwargs.get('enable_tpm', None) - self.uefi_settings = kwargs.get('uefi_settings', None) - -class VirtualmachinesPropertiesSecurityProfileUefiSettings(Model): - """SecurityProfile - Specifies the security settings for the virtual machine. - - :param secure_boot_enabled: - :type secure_boot_enabled: bool - """ - - _attribute_map = { - 'secure_boot_enabled': {'key': 'secureBootEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesSecurityProfileUefiSettings, self).__init__(**kwargs) - self.secure_boot_enabled = kwargs.get('secure_boot_enabled', None) - -class VirtualmachinesPropertiesStorageProfile(Model): - """StorageProfile - contains information about the disks and storage - information for the virtual machine. - - :param data_disks: adds data disks to the virtual machine - :type data_disks: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileDataDisksItem] - :param image_reference: Which Image to use for the virtual machine - :type image_reference: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileImageReference - :param storagepath_id: Azure ID of the storagepath which is used to store Virtual Machine configuration file. - :type storagepath_id: str - """ - - _attribute_map = { - 'data_disks': {'key': 'dataDisks', 'type': '[VirtualmachinesPropertiesStorageProfileDataDisksItem]'}, - 'image_reference': {'key': 'imageReference', 'type': 'VirtualmachinesPropertiesStorageProfileImageReference'}, - 'os_disk': {'key':'osDisk', 'type': 'VirtualmachinesPropertiesStorageProfileOsDisk'}, - 'storagepath_id': {'key': 'vmConfigStoragePathId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesStorageProfile, self).__init__(**kwargs) - self.data_disks = kwargs.get('data_disks', None) - self.image_reference = kwargs.get('image_reference', None) - self.os_disk = kwargs.get('os_disk', None) - self.storagepath_id = kwargs.get('storagepath_id', None) - - -class VirtualmachinesPropertiesStorageProfileDataDisksItem(Model): - """VirtualmachinesPropertiesStorageProfileDataDisksItem. - - :param id: - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesStorageProfileDataDisksItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class VirtualmachinesPropertiesStorageProfileImageReference(Model): - """Which Image to use for the virtual machine. - - :param id: id - ID of the image - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesStorageProfileImageReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - -class VirtualmachinesPropertiesStorageProfileOsDisk(Model): - """Which Image to use for the virtual machine. - - :param id: Id - Id of the os disk - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesStorageProfileOsDisk, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class VirtualMachineUpdateProperties(Model): - """Defines the resource properties for the update. - - :param hardware_profile: - :type hardware_profile: - ~azure.mgmt.azurestackhci.models.HardwareProfileUpdate - :param storage_profile: - :type storage_profile: - ~azure.mgmt.azurestackhci.models.StorageProfileUpdate - :param network_profile: - :type network_profile: - ~azure.mgmt.azurestackhci.models.NetworkProfileUpdate - """ - - _attribute_map = { - 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfileUpdate'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfileUpdate'}, - 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfileUpdate'}, - } - - def __init__(self, **kwargs): - super(VirtualMachineUpdateProperties, self).__init__(**kwargs) - self.hardware_profile = kwargs.get('hardware_profile', None) - self.storage_profile = kwargs.get('storage_profile', None) - self.network_profile = kwargs.get('network_profile', None) - -class VirtualMachineGuestAgentProfile(Model): - """VirtualMachineGuestAgentProfile - Contains information related - to guest agent. - - :param status: - :type status: str - :param vmuuid: - :type vmuuid: str - :param agent_version: - :type agent_version: str - :type last_status_change: - :type last_status_change: ~datetime.datetime - :param error_details: - :type error_details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'vmuuid': {'key': 'vmUuid', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'last_status_change': {'key': 'lastStatusChange', 'type': 'str'}, - 'error_details': {'key': 'errorDetails', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, - } - - def __init__(self, **kwargs): - super(VirtualMachineGuestAgentProfile, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.vmuuid = kwargs.get('vmuuid', None) - self.agent_version = kwargs.get('agent_version', None) - self.last_status_change = kwargs.get('last_status_change', None) - self.error_details = kwargs.get('error_details', None) - -class VirtualMachineGuestAgentProfileErrorDetail(Model): - """The error detail. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param details: - :type details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] - :param additional_info: - :type additional_info: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, - 'additional_info': {'key': 'additional_info', 'type': '[VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo]'}, - } - - def __init__(self, **kwargs): - super(VirtualMachineGuestAgentProfileErrorDetail, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.additional_info = kwargs.get('additional_info', None) - -class VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo(Model): - """Error additional info. - - :param type: - :type type: str - :param info: - :type info: object - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs): - super(VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) - -class Virtualnetworks(Model): - """The virtualnetworks resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.VirtualnetworksExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualnetworksProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualnetworksExtendedLocation'}, - } - - def __init__(self, **kwargs): - super(Virtualnetworks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - self.extended_location = kwargs.get('extended_location', None) - - -class VirtualnetworksExtendedLocation(Model): - """VirtualnetworksExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksExtendedLocation, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class VirtualnetworksPatch(Model): - """The virtualnetworks resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class VirtualnetworksProperties(Model): - """MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork. - - :param network_type: Type of the network - :type network_type: str - :param dhcp_options: DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network - :type dhcp_options: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesDHCPOptions - :param subnets: Subnet - list of subnets under the virtual network - :type subnets: - list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem] - :param provisioning_state: - :type provisioning_state: str - :param status: MOCVirtualNetworkStatus defines the observed state of - MOCVirtualNetwork - :type status: object - :param vm_switch_name: name of the network switch to be used for VMs - :type vm_switch_name: str - """ - - _attribute_map = { - 'network_type': {'key': 'networkType', 'type': 'str'}, - 'dhcp_options': {'key': 'dhcpOptions', 'type': 'VirtualnetworksPropertiesDHCPOptions'}, - 'subnets': {'key': 'subnets', 'type': '[VirtualnetworksPropertiesSubnetsItem]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'vm_switch_name': {'key': 'vmSwitchName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksProperties, self).__init__(**kwargs) - self.network_type = kwargs.get('network_type', None) - self.dhcp_options = kwargs.get('dhcp_options', None) - self.subnets = kwargs.get('subnets', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.status = kwargs.get('status', None) - self.vm_switch_name = kwargs.get('vm_switch_name', None) - -class VirtualnetworksPropertiesDHCPOptions(Model): - """ - :param dns_servers: The list of DNS servers IP addresses - :type dns_servers: list[str] - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - } - - def __init__(self, **kwargs) -> None: - super(VirtualnetworksPropertiesDHCPOptions, self).__init__(**kwargs) - self.dns_servers = kwargs.get('dns_servers', None) - -class VirtualnetworksPropertiesSubnetsItem(Model): - """Subnet subnet in a virtual network resource. - - :param name: Name - The name of the resource that is unique within a - resource group. This name can be used to access the resource. - :type name: str - :param properties: SubnetProperties - Properties of the subnet. - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemProperties'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItem, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.properties = kwargs.get('properties', None) - - -class VirtualnetworksPropertiesSubnetsItemProperties(Model): - """SubnetProperties - Properties of the subnet. - - :param address_prefix: Cidr for this subnet - IPv4, IPv6 - :type address_prefix: str - :param address_prefixes: AddressPrefixes - List of address prefixes for - the subnet. - :type address_prefixes: list[str] - :param ip_allocation_method: IPAllocationMethod - The IP address - allocation method. Possible values include: 'Static', 'Dynamic' - :type ip_allocation_method: str - :param ip_pools: List of IPs having start, end IP range along with their types - :type ip_pools: list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIPPool] - :param ip_configuration_references: IPConfigurationReferences - list of - IPConfigurationReferences - :type ip_configuration_references: - list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem] - :param route_table: RouteTable for the subnet - :type route_table: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable - :param vlan: Vlan to use for the subnet - :type vlan: int - """ - - _attribute_map = { - 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'ip_allocation_method': {'key': 'ipAllocationMethod', 'type': 'str'}, - 'ip_pools' : {'key': 'ipPools', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIPPool]'}, - 'ip_configuration_references': {'key': 'ipConfigurationReferences', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem]'}, - 'route_table': {'key': 'routeTable', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable'}, - 'vlan': {'key': 'vlan', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemProperties, self).__init__(**kwargs) - self.address_prefix = kwargs.get('address_prefix', None) - self.address_prefixes = kwargs.get('address_prefixes', None) - self.ip_allocation_method = kwargs.get('ip_allocation_method', None) - self.ip_pools = kwargs.get('ip_pools', None) - self.ip_configuration_references = kwargs.get('ip_configuration_references', None) - self.route_table = kwargs.get('route_table', None) - self.vlan = kwargs.get('vlan', None) - - -class VirtualnetworksPropertiesSubnetsItemPropertiesIPPool(Model): - """IPPool - Describe IPPool parameters - - :param ip_pool_type: IPPoolType - :type ip_pool_type: str - :param start: starting range of IP Address - :type start: str - :param end: ending range of IP Address - :type end: str - """ - _attribute_map = { - 'ip_pool_type': {'key': 'ipPoolType', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'end': {'key': 'end', 'type':'str'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemPropertiesIPPool, self).__init__(**kwargs) - self.ip_pool_type = kwargs.get('ip_pool_type', None) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) - - -class VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem(Model): - """IPConfigurationReference - Describes a IPConfiguration under the virtual - network. - - :param id: IPConfigurationID - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'ID', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable(Model): - """RouteTable for the subnet. - - :param id: Etag - Gets a unique read-only string that changes whenever the - resource is updated. - :type id: str - :param name: Name - READ-ONLY; Resource name. - :type name: str - :param properties: RouteTablePropertiesFormat route Table resource. - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties - :param type: Type - READ-ONLY; Resource type. - :type type: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.properties = kwargs.get('properties', None) - self.type = kwargs.get('type', None) - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties(Model): - """RouteTablePropertiesFormat route Table resource. - - :param routes: Routes - Collection of routes contained within a route - table. - :type routes: - list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem] - """ - - _attribute_map = { - 'routes': {'key': 'routes', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem]'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties, self).__init__(**kwargs) - self.routes = kwargs.get('routes', None) - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem(Model): - """Route is associated with a subnet. - - :param name: Name - name of the subnet - :type name: str - :param properties: RoutePropertiesFormat - Properties of the route. - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.properties = kwargs.get('properties', None) - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties(Model): - """RoutePropertiesFormat - Properties of the route. - - :param address_prefix: AddressPrefix - The destination CIDR to which the - route applies. - :type address_prefix: str - :param next_hop_ip_address: NextHopIPAddress - The IP address packets - should be forwarded to. Next hop values are only allowed in routes where - the next hop type is VirtualAppliance. - :type next_hop_ip_address: str - """ - - _attribute_map = { - 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, - 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties, self).__init__(**kwargs) - self.address_prefix = kwargs.get('address_prefix', None) - self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) - -class ArcVmExtensions(Model): - """Describes a Arc VM Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location. - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :ivar system_data: - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensions, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.system_data = kwargs.get('system_data', None) - -class ArcVmExtensionsProperties(Model): - """ArcVmExtensionsProperties describes the properties of an Arc VM Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :param instance_view: The machine extension instance view. - :type instance_view: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceView - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'extension_type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'instanceView', 'type': 'ArcVmExtensionsInstanceView'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsProperties, self).__init__(**kwargs) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.publisher = kwargs.get('publisher', None) - self.extension_type = kwargs.get('extension_type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - self.provisioning_state = None - self.instance_view = kwargs.get('instance_view', None) - -class ArcVmExtensionsInstanceView(Model): - """ArcVmExtensionsInstanceView describes the ArcVmExtension Instance View. - - :param name: The extension name. - :type name: str - :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param status: Instance view status. - :type status: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceViewStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'extension_type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ArcVmExtensionsInstanceViewStatus'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsInstanceView, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.extension_type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.status = kwargs.get('status', None) - -class ArcVmExtensionsInstanceViewStatus(Model): - """Instance view status. - - :param code: The status code. - :type code: str - :param level: The level code. Possible values include: "Info", "Warning", "Error". - :type level: str - :param display_status: The short localizable label for the status. - :type display_status: str - :param message: The detailed status message, including for alerts and error messages. - :type message: str - :param time: The time of the status. - :type time: ~datetime.datetime - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsInstanceViewStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.level = kwargs.get('level', None) - self.display_status = kwargs.get('display_status', None) - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - -class ArcVmExtensionsPatch(Model): - """The ArcVmExtensions patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - -class ResourceUpdate(Model): - """The Update Resource model definition. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ResourceUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - -class ArcVmExtensionsUpdate(ResourceUpdate): - """Describes a Arc Extension update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Describes Arc VM Extension Update Properties. - :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsUpdateProperties'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsUpdate, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - -class ArcVmExtensionsUpdateProperties(Model): - """ArcVmExtensionsUpdateProperties describes the properties of an Arc VM Extension Update. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - """ - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'extension_type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsUpdateProperties, self).__init__(**kwargs) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.publisher = kwargs.get('publisher', None) - self.extension_type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - -class ArcVmExtensionsListResult(Model): - """Describes the ArcVmExtensions List Result. - - :param value: The list of extensions. - :type value: list[~azure.mgmt.azurestackhci.models.ArcVmExtensions] - :param next_link: The uri to fetch the next page of arcvmextensions. Call ListNext() with - this to fetch the next page of extensions. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ArcVmExtensions]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ArcVmExtensionsListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py deleted file mode 100644 index da8ed8904e7..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_models_py3.py +++ /dev/null @@ -1,2691 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from datetime import datetime -from tkinter.messagebox import NO -from typing import Dict, List -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class AvailableOperations(Model): - """Available operations of the service. - - :param value: Collection of available operation details - :type value: list[~azure.mgmt.azurestackhci.models.OperationDetail] - :param next_link: URL client should use to fetch the next page (per server - side paging). - It's null for now, added for future use. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationDetail]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: - super(AvailableOperations, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class Resource(Model): - """Common fields that are returned in the response for all Azure Resource - Manager resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AzureEntityResource(Resource): - """The resource model definition for an Azure Resource Manager resource with - an etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top - level resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class Cluster(TrackedResource): - """Cluster details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning state. Possible values include: - 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' - :vartype provisioning_state: str or - ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar status: Status of the cluster agent. Possible values include: - 'Connected', 'Disconnected', 'Error' - :vartype status: str or ~azure.mgmt.azurestackhci.models.Status - :ivar cloud_id: Unique, immutable resource id. - :vartype cloud_id: str - :param aad_client_id: Required. App id of cluster AAD identity. - :type aad_client_id: str - :param aad_tenant_id: Required. Tenant id of cluster AAD identity. - :type aad_tenant_id: str - :param reported_properties: Properties reported by cluster agent. - :type reported_properties: - ~azure.mgmt.azurestackhci.models.ClusterReportedProperties - :ivar trial_days_remaining: Number of days remaining in the trial period. - :vartype trial_days_remaining: float - :ivar billing_model: Type of billing applied to the resource. - :vartype billing_model: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - 'cloud_id': {'readonly': True}, - 'aad_client_id': {'required': True}, - 'aad_tenant_id': {'required': True}, - 'trial_days_remaining': {'readonly': True}, - 'billing_model': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'cloud_id': {'key': 'properties.cloudId', 'type': 'str'}, - 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, - 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, - 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, - 'trial_days_remaining': {'key': 'properties.trialDaysRemaining', 'type': 'float'}, - 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, - } - - def __init__(self, *, location: str, aad_client_id: str, aad_tenant_id: str, tags=None, system_data=None, reported_properties=None, **kwargs) -> None: - super(Cluster, self).__init__(tags=tags, location=location, **kwargs) - self.system_data = system_data - self.provisioning_state = None - self.status = None - self.cloud_id = None - self.aad_client_id = aad_client_id - self.aad_tenant_id = aad_tenant_id - self.reported_properties = reported_properties - self.trial_days_remaining = None - self.billing_model = None - - -class ClusterNode(Model): - """Cluster node details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Name of the cluster node. - :vartype name: str - :ivar id: Id of the node in the cluster. - :vartype id: float - :ivar manufacturer: Manufacturer of the cluster node hardware. - :vartype manufacturer: str - :ivar model: Model name of the cluster node hardware. - :vartype model: str - :ivar os_name: Operating system running on the cluster node. - :vartype os_name: str - :ivar os_version: Version of the operating system running on the cluster - node. - :vartype os_version: str - :ivar serial_number: Immutable id of the cluster node. - :vartype serial_number: str - :ivar core_count: Number of physical cores on the cluster node. - :vartype core_count: float - :ivar memory_in_gi_b: Total available memory on the cluster node (in GiB). - :vartype memory_in_gi_b: float - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'manufacturer': {'readonly': True}, - 'model': {'readonly': True}, - 'os_name': {'readonly': True}, - 'os_version': {'readonly': True}, - 'serial_number': {'readonly': True}, - 'core_count': {'readonly': True}, - 'memory_in_gi_b': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'float'}, - 'manufacturer': {'key': 'manufacturer', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - 'os_name': {'key': 'osName', 'type': 'str'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'core_count': {'key': 'coreCount', 'type': 'float'}, - 'memory_in_gi_b': {'key': 'memoryInGiB', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(ClusterNode, self).__init__(**kwargs) - self.name = None - self.id = None - self.manufacturer = None - self.model = None - self.os_name = None - self.os_version = None - self.serial_number = None - self.core_count = None - self.memory_in_gi_b = None - - -class ClusterReportedProperties(Model): - """Properties reported by cluster agent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar cluster_name: Name of the on-prem cluster connected to this - resource. - :vartype cluster_name: str - :ivar cluster_id: Unique id generated by the on-prem cluster. - :vartype cluster_id: str - :ivar cluster_version: Version of the cluster software. - :vartype cluster_version: str - :ivar nodes: List of nodes reported by the cluster. - :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] - :ivar last_updated: Last time the cluster reported the data. - :vartype last_updated: datetime - """ - - _validation = { - 'cluster_name': {'readonly': True}, - 'cluster_id': {'readonly': True}, - 'cluster_version': {'readonly': True}, - 'nodes': {'readonly': True}, - 'last_updated': {'readonly': True}, - } - - _attribute_map = { - 'cluster_name': {'key': 'clusterName', 'type': 'str'}, - 'cluster_id': {'key': 'clusterId', 'type': 'str'}, - 'cluster_version': {'key': 'clusterVersion', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': '[ClusterNode]'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs) -> None: - super(ClusterReportedProperties, self).__init__(**kwargs) - self.cluster_name = None - self.cluster_id = None - self.cluster_version = None - self.nodes = None - self.last_updated = None - - -class ClusterUpdate(Model): - """Cluster details to update. - - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(ClusterUpdate, self).__init__(**kwargs) - self.tags = tags - - -class ErrorAdditionalInfo(Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: object - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__(self, **kwargs) -> None: - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__(self, **kwargs) -> None: - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(Model): - """Error response. - - Common error response for all Azure Resource Manager APIs to return error - details for failed operations. (This also follows the OData error response - format.). - - :param error: The error object. - :type error: ~azure.mgmt.azurestackhci.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) - - -class Galleryimages(Model): - """The galleryimages resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: ~azure.mgmt.azurestackhci.models.GalleryimagesProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.GalleryimagesExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'GalleryimagesProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'GalleryimagesExtendedLocation'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: - super(Galleryimages, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - self.extended_location = extended_location - - -class GalleryimagesExtendedLocation(Model): - """GalleryimagesExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: - super(GalleryimagesExtendedLocation, self).__init__(**kwargs) - self.type = type - self.name = name - - -class GalleryimagesPatch(Model): - """The galleryimages resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(GalleryimagesPatch, self).__init__(**kwargs) - self.tags = tags - - -class GalleryimagesProperties(Model): - """GalleryimagesProperties. - - :param storagepath_id: Azure ID of the storagepath which is used to store the Gallery Images. - :type storagepath_id: str - :param image_path: location of the image the gallery image should be - created from - :type image_path: str - :param os_type: operating system type that the gallery image uses. - Expected to be linux or windows - :type os_type: str - :param provisioning_state: - :type provisioning_state: str - :param status: MOCGalleryImageStatus defines the observed state of - MOCGalleryImage - :type status: object - :param identifier: galleryImageIdentifier defines the identity of the gallery image - :type identifier: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesIdentifier - :param version: version of the gallery image. - :type version: ~azure.mgmt.azurestackhci.models.GalleryimagesPropertiesVersion - """ - - _attribute_map = { - 'storagepath_id': {'key': 'containerName', 'type': 'str'}, - 'image_path': {'key': 'imagePath', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'identifier': {'key': 'identifier', 'type': 'GalleryimagesPropertiesIdentifier'}, - 'version': {'key': 'version', 'type': 'GalleryimagesPropertiesVersion'}, - } - - def __init__(self, *, storagepath_id: str=None, image_path: str=None, os_type: str=None, provisioning_state: str=None, status=None,hyper_v_generation: str=None, identifier=None, version=None, **kwargs) -> None: - super(GalleryimagesProperties, self).__init__(**kwargs) - self.storagepath_id = storagepath_id - self.image_path = image_path - self.os_type = os_type - self.provisioning_state = provisioning_state - self.status = status - self.os_type = os_type - self.identifier = identifier - self.version = version - -class GalleryimagesPropertiesIdentifier(Model): - """GalleryimagesPropertiesIdentifier. - - :param offer: The name of the gallery image definition offer - :type offer: str - :param pubilsher: The name of the gallery image definition publisher - :type publisher: str - :param sku: The name of the gallery image definition SKU - :type sku: str - """ - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - } - - def __init__(self, *, offer: str=None, publisher: str=None, sku: str=None,**kwargs) -> None: - super(GalleryimagesPropertiesIdentifier, self).__init__(**kwargs) - self.offer = offer - self.publisher = publisher - self.sku = sku - -class GalleryimagesPropertiesVersion(Model): - """GalleryimagesPropertiesIdentifier. - - :param name: The name of the gallery image version - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None,**kwargs) -> None: - super(GalleryimagesPropertiesVersion, self).__init__(**kwargs) - self.name = name - - -class HardwareProfileUpdate(Model): - """HardwareProfile - Specifies the hardware settings for the virtual machine. - - :param vm_size: - :type vm_size: str - :param processors: number of processors for the virtual machine - :type processors: int - :param memory_mb: RAM in mb for the virtual machine - :type memory_mb: int - """ - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'processors': {'key': 'processors', 'type': 'int'}, - 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, - } - - def __init__(self, *, vm_size: str=None, processors: int=None, memory_mb: int=None, **kwargs) -> None: - super(HardwareProfileUpdate, self).__init__(**kwargs) - self.vm_size = vm_size - self.processors = processors - self.memory_mb = memory_mb - - -class Networkinterfaces(Model): - """The networkinterfaces resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'NetworkinterfacesProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'NetworkinterfacesExtendedLocation'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: - super(Networkinterfaces, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - self.extended_location = extended_location - - -class NetworkinterfacesExtendedLocation(Model): - """NetworkinterfacesExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: - super(NetworkinterfacesExtendedLocation, self).__init__(**kwargs) - self.type = type - self.name = name - - -class NetworkinterfacesPatch(Model): - """The networkinterfaces resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(NetworkinterfacesPatch, self).__init__(**kwargs) - self.tags = tags - - -class NetworkinterfacesProperties(Model): - """MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface. - - :param ip_configurations: IPConfigurations - A list of IPConfigurations of - the network interface. - :type ip_configurations: - list[~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItem] - :param mac_address: MacAddress - The MAC address of the network interface. - :type mac_address: str - :param dns_settings: DNS Settings for the interface - :type dns_settings: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesInterfaceDNSSettings - :param provisioning_state: - :type provisioning_state: str - :param status: MOCNetworkInterfaceStatus defines the observed state of - MOCNetworkInterface - :type status: object - :param resource_name: name of the object to be used in moc - :type resource_name: str - """ - - _attribute_map = { - 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NetworkinterfacesPropertiesIpConfigurationsItem]'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - 'dns_settings': {'key': 'dnsSettings', 'type': 'NetworkinterfacesPropertiesInterfaceDNSSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'resource_name' : {'key': 'resourceName', 'type': 'str'}, - } - - def __init__(self, *, ip_configurations=None, mac_address: str=None, dns_settings=None, provisioning_state: str=None, status=None, **kwargs) -> None: - super(NetworkinterfacesProperties, self).__init__(**kwargs) - self.ip_configurations = ip_configurations - self.mac_address = mac_address - self.dns_settings = dns_settings - self.provisioning_state = provisioning_state - self.status = status - self.resource_name = kwargs.get('resource_name', None) - - -class NetworkinterfacesPropertiesIpConfigurationsItem(Model): - """InterfaceIPConfiguration iPConfiguration in a network interface. - - :param name: Name - The name of the resource that is unique within a - resource group. This name can be used to access the resource. - :type name: str - :param properties: InterfaceIPConfigurationPropertiesFormat properties of - IP configuration. - :type properties: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemProperties'}, - } - - def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: - super(NetworkinterfacesPropertiesIpConfigurationsItem, self).__init__(**kwargs) - self.name = name - self.properties = properties - - -class NetworkinterfacesPropertiesIpConfigurationsItemProperties(Model): - """InterfaceIPConfigurationPropertiesFormat properties of IP configuration. - - :param gateway: Gateway for network interface - :type gateway: str - :param prefix_length: prefixLength for network interface - :type prefix_length: str - :param private_ip_address: PrivateIPAddress - Private IP address of the IP - configuration. - :type private_ip_address: str - :param private_ip_allocation_method: PrivateIPAllocationMethod - The - private IP address allocation method. Possible values include: 'Static', - 'Dynamic' - :type private_ip_allocation_method: str - :param subnet: Subnet - Name of Subnet bound to the IP configuration. - :type subnet: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet - """ - - _attribute_map = { - 'gateway': {'key': 'gateway', 'type': 'str'}, - 'prefix_length': {'key': 'prefixLength', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet'}, - } - - def __init__(self, *, gateway: str=None, prefix_length: str=None, private_ip_address: str=None, private_ip_allocation_method: str=None, subnet=None, **kwargs) -> None: - super(NetworkinterfacesPropertiesIpConfigurationsItemProperties, self).__init__(**kwargs) - self.gateway = gateway - self.prefix_length = prefix_length - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - - -class NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet(Model): - """Subnet - Name of Subnet bound to the IP configuration. - - :param id: ID - The ARM resource id in the form of - /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(NetworkinterfacesPropertiesIpConfigurationsItemPropertiesSubnet, self).__init__(**kwargs) - self.id = id - - -class NetworkinterfacesPropertiesInterfaceDNSSettings(Model): - """ - :param dns_servers: List of DNS server IP Addresses for the interface - :type dns_servers: list[str] - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - } - - def __init__(self, *, dns_servers=None, **kwargs) -> None: - super(NetworkinterfacesPropertiesInterfaceDNSSettings, self).__init__(**kwargs) - self.dns_servers = dns_servers - - -class NetworkProfileUpdate(Model): - """NetworkProfile - describes the network update configuration the virtual - machine. - - :param network_interfaces: NetworkInterfaces - list of network interfaces - to be attached to the virtual machine - :type network_interfaces: - list[~azure.mgmt.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem] - """ - - _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkProfileUpdateNetworkInterfacesItem]'}, - } - - def __init__(self, *, network_interfaces=None, **kwargs) -> None: - super(NetworkProfileUpdate, self).__init__(**kwargs) - self.network_interfaces = network_interfaces - - -class NetworkProfileUpdateNetworkInterfacesItem(Model): - """NetworkProfileUpdateNetworkInterfacesItem. - - :param id: ID - Resource Id - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(NetworkProfileUpdateNetworkInterfacesItem, self).__init__(**kwargs) - self.id = id - - -class OperationDetail(Model): - """Operation detail payload. - - :param name: Name of the operation - :type name: str - :param is_data_action: Indicates whether the operation is a data action - :type is_data_action: bool - :param display: Display of the operation - :type display: ~azure.mgmt.azurestackhci.models.OperationDisplay - :param origin: Origin of the operation - :type origin: str - :param properties: Properties of the operation - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: - super(OperationDetail, self).__init__(**kwargs) - self.name = name - self.is_data_action = is_data_action - self.display = display - self.origin = origin - self.properties = properties - - -class OperationDisplay(Model): - """Operation display payload. - - :param provider: Resource provider of the operation - :type provider: str - :param resource: Resource of the operation - :type resource: str - :param operation: Localized friendly name for the operation - :type operation: str - :param description: Localized friendly description for the operation - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class ProxyResource(Resource): - """The resource model definition for an Azure Resource Manager proxy resource. - It will have everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) - - -class Storagecontainers(Model): - """The storagecontainers resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.StoragecontainersProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.StoragecontainersExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'StoragecontainersProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'StoragecontainersExtendedLocation'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: - super(Storagecontainers, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - self.extended_location = extended_location - - -class StoragecontainersExtendedLocation(Model): - """StoragecontainersExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: - super(StoragecontainersExtendedLocation, self).__init__(**kwargs) - self.type = type - self.name = name - - -class StoragecontainersPatch(Model): - """The storagecontainers resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(StoragecontainersPatch, self).__init__(**kwargs) - self.tags = tags - - -class StoragecontainersProperties(Model): - """StoragecontainersProperties. - - :param path: location of the image the gallery image should be created - from - :type path: str - :param provisioning_state: - :type provisioning_state: str - :param status: MOCStorageContainerStatus defines the observed state of - MOCStorageContainer - :type status: object - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - } - - def __init__(self, *, path: str=None, provisioning_state: str=None, status=None, **kwargs) -> None: - super(StoragecontainersProperties, self).__init__(**kwargs) - self.path = path - self.provisioning_state = provisioning_state - self.status = status - - -class StorageProfileUpdate(Model): - """StorageProfileUpdate. - - :param data_disks: adds data disks to the virtual machine for the update - call - :type data_disks: - list[~azure.mgmt.azurestackhci.models.StorageProfileUpdateDataDisksItem] - """ - - _attribute_map = { - 'data_disks': {'key': 'dataDisks', 'type': '[StorageProfileUpdateDataDisksItem]'}, - } - - def __init__(self, *, data_disks=None, **kwargs) -> None: - super(StorageProfileUpdate, self).__init__(**kwargs) - self.data_disks = data_disks - - -class StorageProfileUpdateDataDisksItem(Model): - """StorageProfileUpdateDataDisksItem. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(StorageProfileUpdateDataDisksItem, self).__init__(**kwargs) - self.name = name - - -class SystemData(Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. - Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - :type created_by_type: str or - ~azure.mgmt.azurestackhci.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the - resource. Possible values include: 'User', 'Application', - 'ManagedIdentity', 'Key' - :type last_modified_by_type: str or - ~azure.mgmt.azurestackhci.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. - :type last_modified_at: datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class Virtualharddisks(Model): - """The virtualharddisks resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualharddisksProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.VirtualharddisksExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualharddisksProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualharddisksExtendedLocation'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: - super(Virtualharddisks, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - self.extended_location = extended_location - - -class VirtualharddisksExtendedLocation(Model): - """VirtualharddisksExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: - super(VirtualharddisksExtendedLocation, self).__init__(**kwargs) - self.type = type - self.name = name - - -class VirtualharddisksPatch(Model): - """The virtualharddisks resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(VirtualharddisksPatch, self).__init__(**kwargs) - self.tags = tags - - -class VirtualharddisksProperties(Model): - """MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk. - - :param block_size_bytes: - :type block_size_bytes: int - :param disk_size_gb: diskSizeGB - size of the disk in GB - :type disk_size_gb: long - :param dynamic: Boolean for enabling dynamic sizing on the virtual hard - disk - :type dynamic: bool - :param logical_sector_bytes: - :type logical_sector_bytes: int - :param physical_sector_bytes: - :type physical_sector_bytes: int - :param storagepath_id: - :type storagepath_id: str - :param provisioning_state: - :type provisioning_state: str - :param status: MOCVirtualHardDiskStatus defines the observed state of - MOCVirtualHardDisk - :type status: object - :param disk_file_format: file format of the hard disk. - Expected to be vhd or vhdx - :type disk_file_format: str - """ - - _attribute_map = { - 'block_size_bytes': {'key': 'blockSizeBytes', 'type': 'int'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'long'}, - 'dynamic': {'key': 'dynamic', 'type': 'bool'}, - 'logical_sector_bytes': {'key': 'logicalSectorBytes', 'type': 'int'}, - 'physical_sector_bytes': {'key': 'physicalSectorBytes', 'type': 'int'}, - 'storagepath_id': {'key': 'containerId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'disk_file_format': {'key': 'diskFileFormat', 'type': 'str'}, - } - - def __init__(self, *, block_size_bytes: int=None, disk_size_gb: int=None, dynamic: bool=None, logical_sector_bytes: int=None, physical_sector_bytes: int=None, storagepath_id: str=None, provisioning_state: str=None, status=None, hyper_v_generation: str=None, disk_file_format: str=None,**kwargs) -> None: - super(VirtualharddisksProperties, self).__init__(**kwargs) - self.block_size_bytes = block_size_bytes - self.disk_size_gb = disk_size_gb - self.dynamic = dynamic - self.logical_sector_bytes = logical_sector_bytes - self.physical_sector_bytes = physical_sector_bytes - self.storagepath_id = storagepath_id - self.provisioning_state = provisioning_state - self.status = status - self.disk_file_format = disk_file_format - - -class Virtualmachines(Model): - """The virtualmachines resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualmachinesProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.VirtualmachinesExtendedLocation - :param identity: - :type identity: - ~azure.mgmt.azurestackhci.models.VirtualmachinesIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualmachinesProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualmachinesExtendedLocation'}, - 'identity': {'key': 'identity', 'type': 'VirtualmachinesIdentity'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, identity=None, **kwargs) -> None: - super(Virtualmachines, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - self.extended_location = extended_location - self.identity = identity - - -class VirtualmachinesExtendedLocation(Model): - """VirtualmachinesExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: - super(VirtualmachinesExtendedLocation, self).__init__(**kwargs) - self.type = type - self.name = name - -class VirtualmachinesIdentity(Model): - """VirtualmachinesIdentity - - :param type: The identity type. - :type type: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, **kwargs) -> None: - super(VirtualmachinesIdentity, self).__init__(**kwargs) - self.type = type - -class VirtualmachinesPatch(Model): - """The virtualmachines resource patch definition. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualMachineUpdateProperties - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineUpdateProperties'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, properties=None, tags=None, **kwargs) -> None: - super(VirtualmachinesPatch, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class VirtualmachinesProperties(Model): - """MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine. - - :param hardware_profile: HardwareProfile - Specifies the hardware settings - for the virtual machine. - :type hardware_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile - :param network_profile: NetworkProfile - describes the network - configuration the virtual machine - :type network_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile - :param os_profile: OsProfile - describes the configuration of the - operating system and sets login data - :type os_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfile - :param security_profile: SecurityProfile - Specifies the security settings - for the virtual machine. - :type security_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile - :param storage_profile: StorageProfile - contains information about the - disks and storage information for the virtual machine - :type storage_profile: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfile - :param provisioning_state: - :type provisioning_state: str - :param status: MOCVirtualMachineStatus defines the observed state of - MOCVirtualMachine - :type status: object - :param guest_agent_profile: GuestAgentProfile - Contains information related - to guest agent. - :type guest_agent_profile: - ~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfile - """ - - _attribute_map = { - 'hardware_profile': {'key': 'hardwareProfile', 'type': 'VirtualmachinesPropertiesHardwareProfile'}, - 'network_profile': {'key': 'networkProfile', 'type': 'VirtualmachinesPropertiesNetworkProfile'}, - 'os_profile': {'key': 'osProfile', 'type': 'VirtualmachinesPropertiesOsProfile'}, - 'security_profile': {'key': 'securityProfile', 'type': 'VirtualmachinesPropertiesSecurityProfile'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualmachinesPropertiesStorageProfile'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'guest_agent_profile': {'key': 'guestAgentProfile', 'type': 'VirtualMachineGuestAgentProfile'}, - } - - def __init__(self, *, hardware_profile=None, network_profile=None, os_profile=None, security_profile=None, storage_profile=None, provisioning_state: str=None, status=None, guest_agent_profile=None, **kwargs) -> None: - super(VirtualmachinesProperties, self).__init__(**kwargs) - self.hardware_profile = hardware_profile - self.network_profile = network_profile - self.os_profile = os_profile - self.security_profile = security_profile - self.storage_profile = storage_profile - self.provisioning_state = provisioning_state - self.status = status - self.guest_agent_profile = guest_agent_profile - -class VirtualmachinesPropertiesHardwareProfile(Model): - """HardwareProfile - Specifies the hardware settings for the virtual machine. - - :param vm_size: - :type vm_size: str - :param processors: number of processors for the virtual machine - :type processors: int - :param memory_mb: RAM in mb for the virtual machine. - :type memory_mb: int - :param dynamic_memory_config: - :type dynamic_memory_config: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig - """ - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'processors': {'key': 'processors', 'type': 'int'}, - 'memory_mb': {'key': 'memoryMB', 'type': 'int'}, - 'dynamic_memory_config': {'key': 'dynamicMemoryConfig', 'type': 'VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig'}, - } - - def __init__( - self, - *, - vm_size = None, - processors = None, - memory_mb = None, - dynamic_memory_config = None, - **kwargs - ): - super(VirtualmachinesPropertiesHardwareProfile, self).__init__(**kwargs) - self.vm_size = vm_size - self.processors = processors - self.memory_mb = memory_mb - self.dynamic_memory_config = dynamic_memory_config - - -class VirtualmachinesPropertiesNetworkProfile(Model): - """NetworkProfile - describes the network configuration the virtual machine. - - :param network_interfaces: NetworkInterfaces - list of network interfaces - to be attached to the virtual machine - :type network_interfaces: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem] - """ - - _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem]'}, - } - - def __init__(self, *, network_interfaces=None, **kwargs) -> None: - super(VirtualmachinesPropertiesNetworkProfile, self).__init__(**kwargs) - self.network_interfaces = network_interfaces - - -class VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem(Model): - """VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem. - - :param id: ID - Resource Id - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem, self).__init__(**kwargs) - self.id = id - - -class VirtualmachinesPropertiesOsProfile(Model): - """OsProfile - describes the configuration of the operating system and sets - login data. - - :param admin_password: AdminPassword - admin password - :type admin_password: str - :param admin_username: AdminUsername - admin username - :type admin_username: str - :param computer_name: ComputerName - name of the compute - :type computer_name: str - :param linux_configuration: LinuxConfiguration - linux specific - configuration values for the virtual machine - :type linux_configuration: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfiguration - :param os_type: OsType - string specifying whether the OS is Linux or - Windows - :type os_type: str - :param windows_configuration: Windows Configuration for the virtual - machine - :type windows_configuration: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfiguration - """ - - _attribute_map = { - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfiguration'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfiguration'}, - } - - def __init__(self, *, admin_password: str=None, admin_username: str=None, computer_name: str=None, linux_configuration=None, os_type: str=None, windows_configuration=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfile, self).__init__(**kwargs) - self.admin_password = admin_password - self.admin_username = admin_username - self.computer_name = computer_name - self.linux_configuration = linux_configuration - self.os_type = os_type - self.windows_configuration = windows_configuration - - -class VirtualmachinesPropertiesOsProfileLinuxConfiguration(Model): - """LinuxConfiguration - linux specific configuration values for the virtual - machine. - - :param disable_password_authentication: DisablePasswordAuthentication - - whether password authentication should be disabled - :type disable_password_authentication: bool - :param ssh: SSH - contains settings related to ssh configuration - :type ssh: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh - :param provision_vm_agent: Whether to provision guest management agent - :type provision_vm_agent: bool - """ - - _attribute_map = { - 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, - 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh'}, - 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, - } - - def __init__(self, *, disable_password_authentication: bool=None, ssh=None, provision_vm_agent=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfileLinuxConfiguration, self).__init__(**kwargs) - self.disable_password_authentication = disable_password_authentication - self.ssh = ssh - self.provision_vm_agent = provision_vm_agent - - -class VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh(Model): - """SSH - contains settings related to ssh configuration. - - :param public_keys: PublicKeys - The list of SSH public keys used to - authenticate with linux based VMs. - :type public_keys: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem] - """ - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem]'}, - } - - def __init__(self, *, public_keys=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh, self).__init__(**kwargs) - self.public_keys = public_keys - - -class VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem(Model): - """VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem. - - :param key_data: KeyData - SSH public key certificate used to authenticate - with the VM through ssh. The key needs to be at least 2048-bit and in - ssh-rsa format.

For creating ssh keys, see [Create SSH keys on - Linux and Mac for Li nux VMs in - Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - :type key_data: str - :param path: Path - Specifies the full path on the created VM where ssh - public key is stored. If the file already exists, the specified key is - appended to the file. Example: /home/user/.ssh/authorized_keys - :type path: str - """ - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__(self, *, key_data: str=None, path: str=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem, self).__init__(**kwargs) - self.key_data = key_data - self.path = path - - -class VirtualmachinesPropertiesOsProfileWindowsConfiguration(Model): - """Windows Configuration for the virtual machine . - - :param enable_automatic_updates: Whether to EnableAutomaticUpdates on the - machine - :type enable_automatic_updates: bool - :param provision_vm_agent: Whether to provision guest management agent - :type provision_vm_agent: bool - :param ssh: AdditionalUnattendContent AdditionalUnattendContent - *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - SSH - :type ssh: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh - :param time_zone: TimeZone for the virtual machine - :type time_zone: str - """ - - _attribute_map = { - 'enable_automatic_updates': {'key': 'enableAutomaticUpdates', 'type': 'bool'}, - 'ssh': {'key': 'ssh', 'type': 'VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, - } - - def __init__(self, *, enable_automatic_updates: bool=None, ssh=None, time_zone: str=None, provision_vm_agent: bool=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfileWindowsConfiguration, self).__init__(**kwargs) - self.enable_automatic_updates = enable_automatic_updates - self.ssh = ssh - self.time_zone = time_zone - self.provision_vm_agent = provision_vm_agent - - -class VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh(Model): - """AdditionalUnattendContent AdditionalUnattendContent - *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - SSH. - - :param public_keys: PublicKeys - The list of SSH public keys used to - authenticate with linux based VMs. - :type public_keys: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem] - """ - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem]'}, - } - - def __init__(self, *, public_keys=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh, self).__init__(**kwargs) - self.public_keys = public_keys - - -class VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem(Model): - """VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem. - - :param key_data: KeyData - SSH public key certificate used to authenticate - with the VM through ssh. The key needs to be at least 2048-bit and in - ssh-rsa format.

For creating ssh keys, see [Create SSH keys on - Linux and Mac for Li nux VMs in - Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - :type key_data: str - :param path: Path - Specifies the full path on the created VM where ssh - public key is stored. If the file already exists, the specified key is - appended to the file. Example: /home/user/.ssh/authorized_keys - :type path: str - """ - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__(self, *, key_data: str=None, path: str=None, **kwargs) -> None: - super(VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem, self).__init__(**kwargs) - self.key_data = key_data - self.path = path - - -class VirtualmachinesPropertiesSecurityProfile(Model): - """SecurityProfile - Specifies the security settings for the virtual machine. - - :param enable_tpm: - :type enable_tpm: bool - :param uefi_settings: - :type uefi_settings: ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesSecurityProfileUefiSettings - """ - - _attribute_map = { - 'enable_tpm': {'key': 'enableTPM', 'type': 'bool'}, - 'uefi_settings': {'key': 'uefiSettings', 'type': 'VirtualmachinesPropertiesSecurityProfileUefiSettings'}, - } - - def __init__(self, *, enable_tpm: bool=None,uefi_settings = None, **kwargs) -> None: - super(VirtualmachinesPropertiesSecurityProfile, self).__init__(**kwargs) - self.enable_tpm = enable_tpm - self.uefi_settings = uefi_settings - -class VirtualmachinesPropertiesSecurityProfileUefiSettings(Model): - """SecurityProfile - Specifies the security settings for the virtual machine. - - :param secure_boot_enabled: - :type secure_boot_enabled: bool - """ - - _attribute_map = { - 'secure_boot_enabled': {'key': 'secureBootEnabled', 'type': 'bool'}, - } - - def __init__(self, *, secure_boot_enabled: bool=None, **kwargs) -> None: - super(VirtualmachinesPropertiesSecurityProfileUefiSettings, self).__init__(**kwargs) - self.secure_boot_enabled = kwargs.get('secure_boot_enabled', None) - -class VirtualmachinesPropertiesStorageProfile(Model): - """StorageProfile - contains information about the disks and storage - information for the virtual machine. - - :param data_disks: adds data disks to the virtual machine - :type data_disks: - list[~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileDataDisksItem] - :param image_reference: Which Image to use for the virtual machine - :type image_reference: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPropertiesStorageProfileImageReference - :param storagepath_id: Azure ID of the storagepath which is used to store Virtual Machine configuration file. - :type storagepath_id: str - """ - - _attribute_map = { - 'data_disks': {'key': 'dataDisks', 'type': '[VirtualmachinesPropertiesStorageProfileDataDisksItem]'}, - 'image_reference': {'key': 'imageReference', 'type': 'VirtualmachinesPropertiesStorageProfileImageReference'}, - 'os_disk': {'key':'osDisk', 'type': 'VirtualmachinesPropertiesStorageProfileOsDisk'}, - 'storagepath_id': {'key': 'vmConfigStoragePathId', 'type': 'str'}, - } - - def __init__(self, *, data_disks=None, os_disk=None, image_reference=None, storagepath_id=None, **kwargs) -> None: - super(VirtualmachinesPropertiesStorageProfile, self).__init__(**kwargs) - self.data_disks = data_disks - self.image_reference = image_reference - self.os_disk = os_disk - self.storagepath_id = storagepath_id - - -class VirtualmachinesPropertiesStorageProfileDataDisksItem(Model): - """VirtualmachinesPropertiesStorageProfileDataDisksItem. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(VirtualmachinesPropertiesStorageProfileDataDisksItem, self).__init__(**kwargs) - self.name = name - - -class VirtualmachinesPropertiesStorageProfileImageReference(Model): - """Which Image to use for the virtual machine. - - :param name: Name - Name of the image - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(VirtualmachinesPropertiesStorageProfileImageReference, self).__init__(**kwargs) - self.name = name - -class VirtualmachinesPropertiesStorageProfileOsDisk(Model): - """Which Image to use for the virtual machine. - - :param id: Id - Id of the os disk - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualmachinesPropertiesStorageProfileOsDisk, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class VirtualMachineUpdateProperties(Model): - """Defines the resource properties for the update. - - :param hardware_profile: - :type hardware_profile: - ~azure.mgmt.azurestackhci.models.HardwareProfileUpdate - :param storage_profile: - :type storage_profile: - ~azure.mgmt.azurestackhci.models.StorageProfileUpdate - :param network_profile: - :type network_profile: - ~azure.mgmt.azurestackhci.models.NetworkProfileUpdate - """ - - _attribute_map = { - 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfileUpdate'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfileUpdate'}, - 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfileUpdate'}, - } - - def __init__(self, *, hardware_profile=None, storage_profile=None, network_profile=None, **kwargs) -> None: - super(VirtualMachineUpdateProperties, self).__init__(**kwargs) - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - -class VirtualMachineGuestAgentProfile(Model): - """VirtualMachineGuestAgentProfile - Contains information related - to guest agent. - - :param status: - :type status: str - :param vmuuid: - :type vmuuid: str - :param agent_version: - :type agent_version: str - :type last_status_change: - :type last_status_change: ~datetime.datetime - :param error_details: - :type error_details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'vmuuid': {'key': 'vmUuid', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'last_status_change': {'key': 'lastStatusChange', 'type': 'str'}, - 'error_details': {'key': 'errorDetails', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, - } - - def __init__(self, *, status: str=None, vmuuid: str=None, agent_version: str=None, last_status_change: str=None, error_details=None, **kwargs) -> None: - super(VirtualMachineGuestAgentProfile, self).__init__(**kwargs) - self.status = status - self.vmuuid = vmuuid - self.agent_version = agent_version - self.last_status_change = last_status_change - self.error_details = error_details - -class VirtualMachineGuestAgentProfileErrorDetail(Model): - """The error detail. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param details: - :type details: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetail] - :param additional_info: - :type additional_info: list[~azure.mgmt.azurestackhci.models.VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[VirtualMachineGuestAgentProfileErrorDetail]'}, - 'additional_info': {'key': 'additional_info', 'type': '[VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo]'}, - } - - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, additional_info=None, **kwargs) -> None: - super(VirtualMachineGuestAgentProfileErrorDetail, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - self.additional_info = additional_info - -class VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo(Model): - """Error additional info. - - :param type: - :type type: str - :param info: - :type info: object - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, *, type: str=None, info=None, **kwargs) -> None: - super(VirtualMachineGuestAgentProfileErrorDetailAdditionalInfo, self).__init__(**kwargs) - self.type = type - self.info = info - -class Virtualnetworks(Model): - """The virtualnetworks resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param system_data: - :type system_data: ~azure.mgmt.azurestackhci.models.SystemData - :param extended_location: - :type extended_location: - ~azure.mgmt.azurestackhci.models.VirtualnetworksExtendedLocation - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualnetworksProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'VirtualnetworksExtendedLocation'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, extended_location=None, **kwargs) -> None: - super(Virtualnetworks, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - self.extended_location = extended_location - - -class VirtualnetworksExtendedLocation(Model): - """VirtualnetworksExtendedLocation. - - :param type: The extended location type. - :type type: str - :param name: The extended location name. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: - super(VirtualnetworksExtendedLocation, self).__init__(**kwargs) - self.type = type - self.name = name - - -class VirtualnetworksPatch(Model): - """The virtualnetworks resource patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(VirtualnetworksPatch, self).__init__(**kwargs) - self.tags = tags - - -class VirtualnetworksProperties(Model): - """MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork. - - :param network_type: Type of the network - :type network_type: str - :param dhcp_options: DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network - :type dhcp_options: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesDHCPOptions - :param subnets: Subnet - list of subnets under the virtual network - :type subnets: - list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem] - :param provisioning_state: - :type provisioning_state: str - :param status: MOCVirtualNetworkStatus defines the observed state of - MOCVirtualNetwork - :type status: object - :param vm_switch_name: name of the network switch to be used for VMs - :type vm_switch_name: str - """ - - _attribute_map = { - 'network_type': {'key': 'networkType', 'type': 'str'}, - 'dhcp_options': {'key': 'dhcpOptions', 'type': 'VirtualnetworksPropertiesDHCPOptions'}, - 'subnets': {'key': 'subnets', 'type': '[VirtualnetworksPropertiesSubnetsItem]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'vm_switch_name': {'key': 'vmSwitchName', 'type': 'str'}, - } - - def __init__(self, *, network_type: str=None, subnets=None, provisioning_state: str=None, status=None, vm_switch_name=None, dhcp_options=None, **kwargs) -> None: - super(VirtualnetworksProperties, self).__init__(**kwargs) - self.network_type = network_type - self.dhcp_options = dhcp_options - self.subnets = subnets - self.provisioning_state = provisioning_state - self.status = status - self.vm_switch_name = vm_switch_name - - -class VirtualnetworksPropertiesDHCPOptions(Model): - """ - :param dns_servers: The list of DNS servers IP addresses - :type dns_servers: list[str] - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - } - - def __init__(self, *, dns_servers=None, **kwargs) -> None: - super(VirtualnetworksPropertiesDHCPOptions, self).__init__(**kwargs) - self.dns_servers = dns_servers - - -class VirtualnetworksPropertiesSubnetsItem(Model): - """Subnet subnet in a virtual network resource. - - :param name: Name - The name of the resource that is unique within a - resource group. This name can be used to access the resource. - :type name: str - :param properties: SubnetProperties - Properties of the subnet. - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemProperties'}, - } - - def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItem, self).__init__(**kwargs) - self.name = name - self.properties = properties - - -class VirtualnetworksPropertiesSubnetsItemProperties(Model): - """SubnetProperties - Properties of the subnet. - - :param address_prefix: Cidr for this subnet - IPv4, IPv6 - :type address_prefix: str - :param address_prefixes: AddressPrefixes - List of address prefixes for - the subnet. - :type address_prefixes: list[str] - :param ip_allocation_method: IPAllocationMethod - The IP address - allocation method. Possible values include: 'Static', 'Dynamic' - :type ip_allocation_method: str - :param ip_pools: List of IPs having start, end IP range along with their types - :type ip_pools: list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIPPool] - :param ip_configuration_references: IPConfigurationReferences - list of - IPConfigurationReferences - :type ip_configuration_references: - list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem] - :param route_table: RouteTable for the subnet - :type route_table: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable - :param vlan: Vlan to use for the subnet - :type vlan: int - """ - - _attribute_map = { - 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'ip_allocation_method': {'key': 'ipAllocationMethod', 'type': 'str'}, - 'ip_pools' : {'key': 'ipPools', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIPPool]'}, - 'ip_configuration_references': {'key': 'ipConfigurationReferences', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem]'}, - 'route_table': {'key': 'routeTable', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable'}, - 'vlan': {'key': 'vlan', 'type': 'int'}, - } - - def __init__(self, *, address_prefix: str=None, address_prefixes=None, ip_allocation_method: str=None, ip_configuration_references=None, route_table=None, vlan: int=None, ip_pools=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemProperties, self).__init__(**kwargs) - self.address_prefix = address_prefix - self.address_prefixes = address_prefixes - self.ip_allocation_method = ip_allocation_method - self.ip_pools = ip_pools - self.ip_configuration_references = ip_configuration_references - self.route_table = route_table - self.vlan = vlan - -class VirtualnetworksPropertiesSubnetsItemPropertiesIPPool(Model): - """IPPool - Describe IPPool parameters - - :param ip_pool_type: IPPoolType - :type ip_pool_type: str - :param start: starting range of IP Address - :type start: str - :param end: ending range of IP Address - :type end: str - """ - _attribute_map = { - 'ip_pool_type': {'key': 'ipPoolType', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'end': {'key': 'end', 'type':'str'}, - } - - def __init__(self, *, ip_pool_type: str=None, start: str=None, end=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemPropertiesIPPool, self).__init__(**kwargs) - self.ip_pool_type = ip_pool_type - self.start = start - self.end = end - -class VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem(Model): - """IPConfigurationReference - Describes a IPConfiguration under the virtual - network. - - :param id: IPConfigurationID - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'ID', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemPropertiesIpConfigurationReferencesItem, self).__init__(**kwargs) - self.id = id - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable(Model): - """RouteTable for the subnet. - - :param id: Etag - Gets a unique read-only string that changes whenever the - resource is updated. - :type id: str - :param name: Name - READ-ONLY; Resource name. - :type name: str - :param properties: RouteTablePropertiesFormat route Table resource. - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties - :param type: Type - READ-ONLY; Resource type. - :type type: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, name: str=None, properties=None, type: str=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTable, self).__init__(**kwargs) - self.id = id - self.name = name - self.properties = properties - self.type = type - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties(Model): - """RouteTablePropertiesFormat route Table resource. - - :param routes: Routes - Collection of routes contained within a route - table. - :type routes: - list[~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem] - """ - - _attribute_map = { - 'routes': {'key': 'routes', 'type': '[VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem]'}, - } - - def __init__(self, *, routes=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTableProperties, self).__init__(**kwargs) - self.routes = routes - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem(Model): - """Route is associated with a subnet. - - :param name: Name - name of the subnet - :type name: str - :param properties: RoutePropertiesFormat - Properties of the route. - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties'}, - } - - def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItem, self).__init__(**kwargs) - self.name = name - self.properties = properties - - -class VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties(Model): - """RoutePropertiesFormat - Properties of the route. - - :param address_prefix: AddressPrefix - The destination CIDR to which the - route applies. - :type address_prefix: str - :param next_hop_ip_address: NextHopIPAddress - The IP address packets - should be forwarded to. Next hop values are only allowed in routes where - the next hop type is VirtualAppliance. - :type next_hop_ip_address: str - """ - - _attribute_map = { - 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, - 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, - } - - def __init__(self, *, address_prefix: str=None, next_hop_ip_address: str=None, **kwargs) -> None: - super(VirtualnetworksPropertiesSubnetsItemPropertiesRouteTablePropertiesRoutesItemProperties, self).__init__(**kwargs) - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address -class VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig(Model): - """VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig. - - :param maximum_memory_mb: - :type maximum_memory_mb: long - :param minimum_memory_mb: - :type minimum_memory_mb: long - :param target_memory_buffer: - :type target_memory_buffer: int - """ - - _attribute_map = { - 'maximum_memory_mb': {'key': 'maximumMemoryMB', 'type': 'long'}, - 'minimum_memory_mb': {'key': 'minimumMemoryMB', 'type': 'long'}, - 'target_memory_buffer': {'key': 'targetMemoryBuffer', 'type': 'int'}, - } - - def __init__( - self, - *, - maximum_memory_mb = None, - minimum_memory_mb = None, - target_memory_buffer = None, - **kwargs - ): - super(VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig, self).__init__(**kwargs) - self.maximum_memory_mb = maximum_memory_mb - self.minimum_memory_mb = minimum_memory_mb - self.target_memory_buffer = target_memory_buffer - -class ArcVmExtensions(Model): - """Describes a Arc VM Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param properties: - :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsProperties - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource Name - :vartype name: str - :ivar type: Resource Type - :vartype type: str - :param location: Required. The resource location. - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :ivar system_data: - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__(self, *, location: str, properties=None, tags=None, system_data=None, **kwargs) -> None: - super(ArcVmExtensions, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.system_data = system_data - -class ArcVmExtensionsProperties(Model): - """ArcVmExtensionsProperties describes the properties of an Arc VM Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :param instance_view: The machine extension instance view. - :type instance_view: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceView - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'extension_type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'instanceView', 'type': 'ArcVmExtensionsInstanceView'}, - } - - def __init__(self, *, location: str=None, force_update_tag: str=None, publisher: str=None, extension_type: str=None, type_handler_version: str=None, enable_automatic_upgrade: str=None, auto_upgrade_minor_version: str=None, settings: object=None, protected_settings: object=None, instance_view: ArcVmExtensionsInstanceView=None, **kwargs) -> None: - super(ArcVmExtensionsProperties, self).__init__(**kwargs) - self.location = location - self.force_update_tag = force_update_tag - self.publisher = publisher - self.extension_type = extension_type - self.type_handler_version = type_handler_version - self.enable_automatic_upgrade = enable_automatic_upgrade - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - self.provisioning_state = None - self.instance_view = instance_view - -class ArcVmExtensionsInstanceView(Model): - """ArcVmExtensionsInstanceView describes the ArcVmExtension Instance View. - - :param name: The extension name. - :type name: str - :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param status: Instance view status. - :type status: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsInstanceViewStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'extension_type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ArcVmExtensionsInstanceViewStatus'}, - } - - def __init__(self, *, name: str=None, extension_type: str=None, type_handler_version: str=None, status: ArcVmExtensionsInstanceViewStatus=None, **kwargs) -> None: - super(ArcVmExtensionsInstanceView, self).__init__(**kwargs) - self.name = name - self.extension_type = extension_type - self.type_handler_version = type_handler_version - self.status = status - -class ArcVmExtensionsInstanceViewStatus(Model): - """Instance view status. - - :param code: The status code. - :type code: str - :param level: The level code. Possible values include: "Info", "Warning", "Error". - :type level: str - :param display_status: The short localizable label for the status. - :type display_status: str - :param message: The detailed status message, including for alerts and error messages. - :type message: str - :param time: The time of the status. - :type time: ~datetime.datetime - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__(self, *, code: str=None, level: str=None, display_status: str=None, message: str=None, time: datetime=None, **kwargs) -> None: - super(ArcVmExtensionsInstanceViewStatus, self).__init__(**kwargs) - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time - -class ArcVmExtensionsPatch(Model): - """The ArcVmExtensions patch definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(ArcVmExtensionsPatch, self).__init__(**kwargs) - self.tags = tags - -class ResourceUpdate(Model): - """The Update Resource model definition. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags: Dict[str,str]=None, **kwargs) -> None: - super(ResourceUpdate, self).__init__(**kwargs) - self.tags = tags - -class ArcVmExtensionsUpdate(ResourceUpdate): - """Describes a Arc VM Extension update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Describes Arc VM Extension Update Properties. - :type properties: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'ArcVmExtensionsUpdateProperties'}, - } - - def __init__(self, *, tags: Dict[str,str]=None, properties: ArcVmExtensionsUpdateProperties=None, **kwargs): - super(ArcVmExtensionsUpdate, self).__init__(tags=tags, **kwargs) - self.properties = properties - self.tags = tags - -class ArcVmExtensionsUpdateProperties(Model): - """ArcVmExtensionsUpdateProperties describes the properties of an Arc VM Extension Update. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param extension_type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - """ - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'extension_type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - } - - def __init__(self, *, force_update_tag: str=None, publisher: str=None, extension_type: str=None, type_handler_version: str=None, enable_automatic_upgrade: bool=None, auto_upgrade_minor_version: bool=None, settings: object=None, protected_settings: object=None, **kwargs) -> None: - super(ArcVmExtensionsUpdateProperties, self).__init__(**kwargs) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.extension_type = extension_type - self.type_handler_version = type_handler_version - self.enable_automatic_upgrade = enable_automatic_upgrade - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - -class ArcVmExtensionsListResult(Model): - """Describes the ArcVmExtensions List Result. - - :param value: The list of extensions. - :type value: list[~azure.mgmt.azurestackhci.models.ArcVmExtensions] - :param next_link: The uri to fetch the next page of arcvmextensions. Call ListNext() with - this to fetch the next page of extensions. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ArcVmExtensions]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, *, value: List["ArcVmExtensions"]=None, next_link: str=None, **kwargs) -> None: - super(ArcVmExtensionsListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py deleted file mode 100644 index f2d6a61540c..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/models/_paged_models.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class GalleryimagesPaged(Paged): - """ - A paging container for iterating over a list of :class:`Galleryimages ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Galleryimages]'} - } - - def __init__(self, *args, **kwargs): - - super(GalleryimagesPaged, self).__init__(*args, **kwargs) -class NetworkinterfacesPaged(Paged): - """ - A paging container for iterating over a list of :class:`Networkinterfaces ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Networkinterfaces]'} - } - - def __init__(self, *args, **kwargs): - - super(NetworkinterfacesPaged, self).__init__(*args, **kwargs) -class VirtualharddisksPaged(Paged): - """ - A paging container for iterating over a list of :class:`Virtualharddisks ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Virtualharddisks]'} - } - - def __init__(self, *args, **kwargs): - - super(VirtualharddisksPaged, self).__init__(*args, **kwargs) -class VirtualmachinesPaged(Paged): - """ - A paging container for iterating over a list of :class:`Virtualmachines ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Virtualmachines]'} - } - - def __init__(self, *args, **kwargs): - - super(VirtualmachinesPaged, self).__init__(*args, **kwargs) -class VirtualnetworksPaged(Paged): - """ - A paging container for iterating over a list of :class:`Virtualnetworks ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Virtualnetworks]'} - } - - def __init__(self, *args, **kwargs): - - super(VirtualnetworksPaged, self).__init__(*args, **kwargs) -class StoragecontainersPaged(Paged): - """ - A paging container for iterating over a list of :class:`Storagecontainers ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Storagecontainers]'} - } - - def __init__(self, *args, **kwargs): - - super(StoragecontainersPaged, self).__init__(*args, **kwargs) -class ClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`Cluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Cluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ClusterPaged, self).__init__(*args, **kwargs) -class ArcVmExtensionsPaged(Paged): - """ - A paging container for iterating over a list of :class:`ArcVmExtensions ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ArcVmExtensions]'} - } - - def __init__(self, *args, **kwargs): - super(ArcVmExtensionsPaged, self).__init__(*args, **kwargs) \ No newline at end of file diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py deleted file mode 100644 index f54f2f2c7cf..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from ._galleryimages_operations import GalleryimagesOperations -from ._networkinterfaces_operations import NetworkinterfacesOperations -from ._operations import Operations -from ._virtualharddisks_operations import VirtualharddisksOperations -from ._virtualmachines_operations import VirtualmachinesOperations -from ._virtualnetworks_operations import VirtualnetworksOperations -from ._storagecontainers_operations import StoragecontainersOperations -from ._clusters_operations import ClustersOperations -from ._arc_vmextensions_operations import ArcVmExtensionsOperations - -__all__ = [ - 'GalleryimagesOperations', - 'NetworkinterfacesOperations', - 'Operations', - 'VirtualharddisksOperations', - 'VirtualmachinesOperations', - 'VirtualnetworksOperations', - 'StoragecontainersOperations', - 'ClustersOperations', - 'ArcVmExtensionsOperations' -] diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py deleted file mode 100644 index 3d6265775a0..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_arc_vmextensions_operations.py +++ /dev/null @@ -1,490 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling -from . import VirtualmachinesOperations as vmops -from .. import models - -class ArcVmExtensionsOperations(object): - """ArcVmExtensionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - self.config = config - self.vmconfig = vmops(client, config, serializer, deserializer) - - def _create_initial( - self, resource_group_name, virtualmachine_name, name, extensionParameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(extensionParameters, 'ArcVmExtensions') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ArcVmExtensions', response) - if response.status_code == 201: - deserialized = self._deserialize('ArcVmExtensions', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, virtualmachine_name, name, extensionParameters, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to create the vm extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the vm extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :param extensionParameters: - :type extensionParameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensions - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the deserialized response - :param operation_config: :ref: `Operation configuration overrides`. - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns ArcVmExtensions or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.ArcVmExtensions] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.ArcVmExtensions]] - :raises: :class:`ErrorResponseException` - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - raw_result = self._create_initial( - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name, - extensionParameters=extensionParameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ArcVmExtensions', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - def _update_initial( - self, resource_group_name, virtualmachine_name, name, extension_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct paramaters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(extension_parameters, 'ArcVmExtensionsUpdate') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200,202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ArcVmExtensions', response) - if response.status_code == 202: - deserialized = self._deserialize('ArcVmExtensions', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - return deserialized - - def update( - self, resource_group_name, virtualmachine_name, name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to update the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :param extension_parameters: Parameters supplied to the Create ArcVmExtension operation. - :type extension_parameters: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsUpdate - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the deserialized response - :param operation_config: :ref: `Operation configuration overrides`. - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns ArcVmExtensions or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.ArcVmExtensions] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.ArcVmExtensions]] - :raises: :class:`ErrorResponseException` - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - raw_result = self._update_initial( - resource_group_name=resource_group_name, - virtualmachine_name=virtualmachine_name, - name=name, - extension_parameters=extension_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ArcVmExtensions', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - def get( - self, resource_group_name, virtualmachine_name, name, custom_headers=None, raw=False, **operation_config): - """The operation to get the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the deserialized response - :param operation_config: :ref: `Operation configuration overrides`. - :return: ArcVmExtensions or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.ArcVmExtensions or ~msrest.pipeline.ClientRawResponse - :raises: :class:`ErrorResponseException` - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ArcVmExtensions", response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - def delete( - self, resource_group_name, virtualmachine_name, name, custom_headers=None, raw=False, **operation_config): - """The operation to delete the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the extension. - :type virtualmachine_name: str - :param name: The name of the virtual machine extension. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the deserialized response - :param operation_config: :ref: `Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`ErrorResponseException` - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3), - 'extensionName': self._serialize.url("name", name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}'} - - def list_by_virtualmachine_name( - self, resource_group_name, virtualmachine_name, custom_headers=None, raw=False, **operation_config): - """The operation to list all the extensions by machine name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtualmachine_name: The name of the virtual machine containing the arcvmextension. - :type virtualmachine_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the deserialized response - :param operation_config: :ref: `Operation configuration overrides`. - :return: An iterator like instance of ArcVmExtensions - :rtype: ~azure.mgmt.azurestackhci.models.ArcVmExtensionsPaged[~azure.mgmt.azurestackhci.models.ArcVmExtensions] - :raises: :class:`ErrorResponseException` - """ - - try: - self._checkIfProvisionVmAgentEnabled(resource_group_name, virtualmachine_name) - self._checkIfGuestVmAgentConnected(resource_group_name, virtualmachine_name) - except Exception as exception: - print("{} : {}".format(type(exception).__name__,exception)) - return - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_virtualmachine_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'name': self._serialize.url("virtualmachine_name", virtualmachine_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ArcVmExtensionsPaged(internal_paging, self._deserialize.dependencies, header_dict) - return deserialized - list_by_virtualmachine_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions'} - - def _checkIfProvisionVmAgentEnabled( - self, resource_group_name, virtualmachine_name): - vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) - if vmObject.properties.os_profile.windows_configuration and vmObject.properties.os_profile.windows_configuration.provision_vm_agent == True: - return - else: - if vmObject.properties.os_profile.linux_configuration and vmObject.properties.os_profile.linux_configuration.provision_vm_agent == True: - return - raise Exception("Guest Management is not enabled for this virtual machine.") - - def _checkIfGuestVmAgentConnected( - self, resource_group_name, virtualmachine_name): - vmObject = self.vmconfig.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachine_name) - if vmObject.properties.guest_agent_profile: - if vmObject.properties.guest_agent_profile.status == models.Status.connected: - return - elif vmObject.properties.guest_agent_profile.status == models.Status.disconnected: - raise Exception("Guest Agent is currently disconnected.") - else: - error_detail = vmObject.properties.guest_agent_profile.error_details[-1] - error_code_and_message = error_detail.code + error_detail.message - raise Exception(error_code_and_message) - else: - raise Exception("Guest Agent is currently disconnected.") diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py deleted file mode 100644 index 9453655810a..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_clusters_operations.py +++ /dev/null @@ -1,432 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class ClustersOperations(object): - """ClustersOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2021-07-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all HCI clusters in a subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Cluster - :rtype: - ~azure.mgmt.azurestackhci.models.ClusterPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """List all HCI clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Cluster - :rtype: - ~azure.mgmt.azurestackhci.models.ClusterPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters'} - - def get( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): - """Get HCI cluster. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Cluster or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Cluster or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Cluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} - - def create( - self, resource_group_name, cluster_name, cluster, custom_headers=None, raw=False, **operation_config): - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :param cluster: Details of the HCI cluster. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Cluster or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Cluster or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(cluster, 'Cluster') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Cluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} - - def update( - self, resource_group_name, cluster_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Cluster or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Cluster or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - cluster = models.ClusterUpdate(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(cluster, 'ClusterUpdate') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Cluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} - - def delete( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): - """Delete an HCI cluster. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the cluster. - :type cluster_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py deleted file mode 100644 index 9c666c5d9ed..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_galleryimages_operations.py +++ /dev/null @@ -1,728 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class GalleryimagesOperations(object): - """GalleryimagesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def retrieve( - self, resource_group_name, galleryimages_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Galleryimages or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Galleryimages or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.retrieve.metadata['galimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - # retry with marketplace gallery image resource type - url = self.retrieve.metadata['marketplacegalimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Galleryimages', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Galleryimages', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - retrieve.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} - - def resourceTypeIsGalImage(self, resource_group_name, galleryimages_name, custom_headers=None, **operation_config): - url = self.resourceTypeIsGalImage.metadata['galimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - return False - else: - return True - resourceTypeIsGalImage.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}'} - - - def _create_or_update_initial( - self, resource_group_name, galleryimages_name, galleryimages, custom_headers=None, raw=False, **operation_config): - # Construct URL - isMarketPlaceImage = False - url = self.create_or_update.metadata['galimageurl'] - if (galleryimages['properties']['identifier'] is not None): - url = self.create_or_update.metadata['marketplacegalimageurl'] - isMarketPlaceImage = True - - - path_format_arguments = {} - if isMarketPlaceImage: - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - else: - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - - body_content = self._serialize.body(galleryimages, 'Galleryimages') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Galleryimages', response) - if response.status_code == 201: - deserialized = self._deserialize('Galleryimages', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, galleryimages_name, galleryimages, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :param galleryimages: - :type galleryimages: ~azure.mgmt.azurestackhci.models.Galleryimages - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Galleryimages or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Galleryimages] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Galleryimages]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - galleryimages_name=galleryimages_name, - galleryimages=galleryimages, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Galleryimages', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} - - def delete( - self, resource_group_name, galleryimages_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - isGalImage = self.resourceTypeIsGalImage(resource_group_name, galleryimages_name, custom_headers, **operation_config) - url = self.update.metadata['galimageurl'] - path_format_arguments = {} - if isGalImage: - # Construct URL - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - else: - url = self.update.metadata['marketplacegalimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} - - def update( - self, resource_group_name, galleryimages_name, tags=None, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param galleryimages_name: - :type galleryimages_name: str - :param tags: Resource tags - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Galleryimages or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Galleryimages or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - galleryimages = models.GalleryimagesPatch(tags=tags) - - isGalImage = self.resourceTypeIsGalImage(resource_group_name, galleryimages_name, custom_headers, **operation_config) - url = self.update.metadata['galimageurl'] - path_format_arguments = {} - if isGalImage: - # Construct URL - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'galleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - else: - url = self.update.metadata['marketplacegalimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'marketplacegalleryimagesName': self._serialize.url("galleryimages_name", galleryimages_name, 'str', max_length=64, min_length=3) - } - - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(galleryimages, 'GalleryimagesPatch') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Galleryimages', response) - if response.status_code == 202: - deserialized = self._deserialize('Galleryimages', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages/{galleryimagesName}', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/{marketplacegalleryimagesName}'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Galleryimages - :rtype: - ~azure.mgmt.azurestackhci.models.GalleryimagesPaged[~azure.mgmt.azurestackhci.models.Galleryimages] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - - url = self.list_by_resource_group.metadata['galimageurl'] - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - def prepare_request_marketplace(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['marketplacegalimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging_marketplace(next_link=None): - request = prepare_request_marketplace(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - - - - deserialzedGal = None - deserialzedMarketplace = None - noGalImages = False - noMarketplaceImages = False - galImageExcpetion = None - marketplaceGalImageException = None - - if raw: - header_dict = {} - try: - deserializedGal = models.GalleryimagesPaged(internal_paging, self._deserialize.dependencies, header_dict) - except Exception as e: - # try marketplace resource - noGalImages = True - galImageExcpetion = e - pass - - try: - deserializedMarketplace = models.GalleryimagesPaged(internal_paging_marketplace, self._deserialize.dependencies, header_dict) - except Exception as e: - # try marketplace resource - marketplaceGalImageException = e - noMarketplaceImages = True - pass - - if (not (noGalImages or noMarketplaceImages)): - allImages = list(deserializedGal) + list(deserializedMarketplace) - return allImages - elif (not noGalImages): - return deserializedGal - elif (not noMarketplaceImages): - return deserializedMarketplace - else: - raise galImageExcpetion - - return deserialized - list_by_resource_group.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryimages', 'marketplacegalimageurl': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """ - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Galleryimages - :rtype: - ~azure.mgmt.azurestackhci.models.GalleryimagesPaged[~azure.mgmt.azurestackhci.models.Galleryimages] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['galimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - def prepare_request_marketplace(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['marketplacegalimageurl'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging_marketplace(next_link=None): - request = prepare_request_marketplace(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - - deserialzedGal = None - deserialzedMarketplace = None - noGalImages = False - noMarketplaceImages = False - galImageExcpetion = None - marketplaceGalImageException = None - - if raw: - header_dict = {} - try: - deserializedGal = models.GalleryimagesPaged(internal_paging, self._deserialize.dependencies, header_dict) - except Exception as e: - # try marketplace resource - noGalImages = True - galImageExcpetion = e - pass - - try: - deserializedMarketplace = models.GalleryimagesPaged(internal_paging_marketplace, self._deserialize.dependencies, header_dict) - except Exception as e: - # try marketplace resource - marketplaceGalImageException = e - noMarketplaceImages = True - pass - - if ((not noGalImages) and not (noMarketplaceImages)): - allImages = list(deserializedGal) + list(deserializedMarketplace) - return allImages - elif (not noGalImages): - return deserializedGal - elif (not noMarketplaceImages): - return deserializedMarketplace - else: - raise galImageExcpetion - - - list_by_subscription.metadata = {'galimageurl': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryimages','marketplacegalimageurl': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/marketplacegalleryimages'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py deleted file mode 100644 index 7451122dc26..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_networkinterfaces_operations.py +++ /dev/null @@ -1,470 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class NetworkinterfacesOperations(object): - """NetworkinterfacesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def retrieve( - self, resource_group_name, networkinterfaces_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Networkinterfaces or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Networkinterfaces or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.retrieve.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Networkinterfaces', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} - - - def _create_or_update_initial( - self, resource_group_name, networkinterfaces_name, networkinterfaces, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(networkinterfaces, 'Networkinterfaces') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Networkinterfaces', response) - if response.status_code == 201: - deserialized = self._deserialize('Networkinterfaces', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, networkinterfaces_name, networkinterfaces, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :param networkinterfaces: - :type networkinterfaces: - ~azure.mgmt.azurestackhci.models.Networkinterfaces - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Networkinterfaces or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Networkinterfaces] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Networkinterfaces]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - networkinterfaces_name=networkinterfaces_name, - networkinterfaces=networkinterfaces, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Networkinterfaces', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} - - def delete( - self, resource_group_name, networkinterfaces_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} - - def update( - self, resource_group_name, networkinterfaces_name, tags=None, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param networkinterfaces_name: - :type networkinterfaces_name: str - :param tags: Resource tags - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Networkinterfaces or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Networkinterfaces or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - networkinterfaces = models.NetworkinterfacesPatch(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'networkinterfacesName': self._serialize.url("networkinterfaces_name", networkinterfaces_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(networkinterfaces, 'NetworkinterfacesPatch') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Networkinterfaces', response) - if response.status_code == 202: - deserialized = self._deserialize('Networkinterfaces', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces/{networkinterfacesName}'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Networkinterfaces - :rtype: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPaged[~azure.mgmt.azurestackhci.models.Networkinterfaces] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.NetworkinterfacesPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkinterfaces'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """ - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Networkinterfaces - :rtype: - ~azure.mgmt.azurestackhci.models.NetworkinterfacesPaged[~azure.mgmt.azurestackhci.models.Networkinterfaces] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.NetworkinterfacesPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkinterfaces'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py deleted file mode 100644 index 90640dfd943..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_operations.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class Operations(object): - """Operations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all available Microsoft.AzureStackHCI provider operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AvailableOperations or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.AvailableOperations or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AvailableOperations', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.AzureStackHCI/operations'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py deleted file mode 100644 index bdb8f7d1221..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_storagecontainers_operations.py +++ /dev/null @@ -1,470 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class StoragecontainersOperations(object): - """StoragecontainersOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def retrieve( - self, resource_group_name, storagecontainers_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Storagecontainers or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Storagecontainers or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.retrieve.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Storagecontainers', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} - - - def _create_or_update_initial( - self, resource_group_name, storagecontainers_name, storagecontainers, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(storagecontainers, 'Storagecontainers') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Storagecontainers', response) - if response.status_code == 201: - deserialized = self._deserialize('Storagecontainers', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, storagecontainers_name, storagecontainers, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :param storagecontainers: - :type storagecontainers: - ~azure.mgmt.azurestackhci.models.Storagecontainers - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Storagecontainers or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Storagecontainers] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Storagecontainers]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - storagecontainers_name=storagecontainers_name, - storagecontainers=storagecontainers, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Storagecontainers', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} - - def delete( - self, resource_group_name, storagecontainers_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} - - def update( - self, resource_group_name, storagecontainers_name, tags=None, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param storagecontainers_name: - :type storagecontainers_name: str - :param tags: Resource tags - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Storagecontainers or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Storagecontainers or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - storagecontainers = models.StoragecontainersPatch(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'storagecontainersName': self._serialize.url("storagecontainers_name", storagecontainers_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(storagecontainers, 'StoragecontainersPatch') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Storagecontainers', response) - if response.status_code == 202: - deserialized = self._deserialize('Storagecontainers', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers/{storagecontainersName}'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Storagecontainers - :rtype: - ~azure.mgmt.azurestackhci.models.StoragecontainersPaged[~azure.mgmt.azurestackhci.models.Storagecontainers] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.StoragecontainersPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storagecontainers'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """ - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Storagecontainers - :rtype: - ~azure.mgmt.azurestackhci.models.StoragecontainersPaged[~azure.mgmt.azurestackhci.models.Storagecontainers] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.StoragecontainersPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storagecontainers'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py deleted file mode 100644 index c3f16cf2dcc..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualharddisks_operations.py +++ /dev/null @@ -1,470 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class VirtualharddisksOperations(object): - """VirtualharddisksOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def retrieve( - self, resource_group_name, virtualharddisks_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Virtualharddisks or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Virtualharddisks or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.retrieve.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Virtualharddisks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} - - - def _create_or_update_initial( - self, resource_group_name, virtualharddisks_name, virtualharddisks, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(virtualharddisks, 'Virtualharddisks') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Virtualharddisks', response) - if response.status_code == 201: - deserialized = self._deserialize('Virtualharddisks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, virtualharddisks_name, virtualharddisks, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :param virtualharddisks: - :type virtualharddisks: - ~azure.mgmt.azurestackhci.models.Virtualharddisks - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Virtualharddisks or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Virtualharddisks] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Virtualharddisks]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtualharddisks_name=virtualharddisks_name, - virtualharddisks=virtualharddisks, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Virtualharddisks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} - - def delete( - self, resource_group_name, virtualharddisks_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} - - def update( - self, resource_group_name, virtualharddisks_name, tags=None, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualharddisks_name: - :type virtualharddisks_name: str - :param tags: Resource tags - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Virtualharddisks or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Virtualharddisks or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - virtualharddisks = models.VirtualharddisksPatch(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualharddisksName': self._serialize.url("virtualharddisks_name", virtualharddisks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(virtualharddisks, 'VirtualharddisksPatch') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Virtualharddisks', response) - if response.status_code == 202: - deserialized = self._deserialize('Virtualharddisks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks/{virtualharddisksName}'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Virtualharddisks - :rtype: - ~azure.mgmt.azurestackhci.models.VirtualharddisksPaged[~azure.mgmt.azurestackhci.models.Virtualharddisks] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VirtualharddisksPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualharddisks'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """ - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Virtualharddisks - :rtype: - ~azure.mgmt.azurestackhci.models.VirtualharddisksPaged[~azure.mgmt.azurestackhci.models.Virtualharddisks] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VirtualharddisksPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualharddisks'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py deleted file mode 100644 index 8e37ff4ffa1..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualmachines_operations.py +++ /dev/null @@ -1,816 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class VirtualmachinesOperations(object): - """VirtualmachinesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def retrieve( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Virtualmachines or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Virtualmachines or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.retrieve.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Virtualmachines', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} - - - def _create_or_update_initial( - self, resource_group_name, virtualmachines_name, virtualmachines, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(virtualmachines, 'Virtualmachines') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Virtualmachines', response) - if response.status_code == 201: - deserialized = self._deserialize('Virtualmachines', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, virtualmachines_name, virtualmachines, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param virtualmachines: - :type virtualmachines: - ~azure.mgmt.azurestackhci.models.Virtualmachines - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Virtualmachines or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Virtualmachines] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Virtualmachines]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtualmachines_name=virtualmachines_name, - virtualmachines=virtualmachines, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Virtualmachines', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} - - def delete( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} - - def update( - self, resource_group_name, virtualmachines_name, properties=None, tags=None, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param properties: - :type properties: - ~azure.mgmt.azurestackhci.models.VirtualMachineUpdateProperties - :param tags: Resource tags - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Virtualmachines or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Virtualmachines or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - virtualmachines = models.VirtualmachinesPatch(properties=properties, tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(virtualmachines, 'VirtualmachinesPatch') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - deserialized = self._deserialize('Virtualmachines', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, response, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} - - - def _start_initial( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.start.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def start( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._start_initial( - resource_group_name=resource_group_name, - virtualmachines_name=virtualmachines_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/start'} - - - def _stop_initial( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.stop.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def stop( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - virtualmachines_name=virtualmachines_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/stop'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Virtualmachines - :rtype: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPaged[~azure.mgmt.azurestackhci.models.Virtualmachines] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VirtualmachinesPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """ - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Virtualmachines - :rtype: - ~azure.mgmt.azurestackhci.models.VirtualmachinesPaged[~azure.mgmt.azurestackhci.models.Virtualmachines] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VirtualmachinesPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualmachines'} - - # def restart( - # self, - # resource_group_name, # type: str - # virtualmachines_name, # type: str - # **kwargs # type: Any - # ): - # # type: (...) -> None - # """stop. - - # :param resource_group_name: The name of the resource group. The name is case insensitive. - # :type resource_group_name: str - # :param virtualmachines_name: - # :type virtualmachines_name: str - # :keyword callable cls: A custom type or function that will be passed the direct response - # :return: None, or the result of cls(response) - # :rtype: None - # :raises: ~azure.core.exceptions.HttpResponseError - # """ - # cls = kwargs.pop('cls', None) # type: ClsType[None] - # error_map = { - # 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - # } - # error_map.update(kwargs.pop('error_map', {})) - # # api_version = "2020-11-01-preview" - # api_version = "2021-07-01-preview" - # accept = "application/json" - - # # Construct URL - # url = self.restart.metadata['url'] # type: ignore - # path_format_arguments = { - # 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - # 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - # 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3), - # } - # url = self._client.format_url(url, **path_format_arguments) - - # # Construct parameters - # query_parameters = {} # type: Dict[str, Any] - # query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # # Construct headers - # header_parameters = {} # type: Dict[str, Any] - # header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - # request = self._client.post(url, query_parameters, header_parameters) - # pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - # response = pipeline_response.http_response - - # if response.status_code not in [200, 202]: - # map_error(status_code=response.status_code, response=response, error_map=error_map) - # error = self._deserialize(models.ErrorResponse, response) - # raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - # if cls: - # return cls(pipeline_response, None, {}) - - # restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/restart'} # type: ignor - - def _restart_initial( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.restart.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualmachinesName': self._serialize.url("virtualmachines_name", virtualmachines_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def restart( - self, resource_group_name, virtualmachines_name, custom_headers=None, raw=False, polling=True, **operation_config): - """restart - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualmachines_name: - :type virtualmachines_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - virtualmachines_name=virtualmachines_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}/restart'} - - - def add_vnic( - self, - resource_group_name, # type: str - virtualmachines_name, # type: str - vnic_names, # type: List[str] - **kwargs # type: Any - ): - virtualmachines = self.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name) - serialized = self._serialize.body(virtualmachines, 'VirtualMachines') - serialized.pop('provisioningState', None) - properties = serialized.get('properties', dict()) - networkProfile = properties.get('networkProfile', dict()) - networkInterfaces = networkProfile.get('networkInterfaces', list()) - for name in vnic_names: - networkInterfaces.append({'id': name}) - networkProfile['networkInterfaces'] = networkInterfaces - properties['networkProfile'] = networkProfile - serialized['properties'] = properties - return self.create_or_update(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name, virtualmachines=serialized) - add_vnic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore - - def remove_vnic( - self, - resource_group_name, # type: str - virtualmachines_name, # type: str - vnic_names, # type: List[str] - **kwargs # type: Any - ): - virtualmachines = self.retrieve(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name) - serialized = self._serialize.body(virtualmachines, 'VirtualMachines') - serialized.pop('provisioningState', None) - properties = serialized.get('properties', dict()) - networkProfile = properties.get('networkProfile', dict()) - networkInterfaces = networkProfile.get('networkInterfaces', list()) - vnics_to_be_removed = set(vnic_names) - new_networkInterfaces = [] - for nic in networkInterfaces: - if nic.get('id') in vnics_to_be_removed: - continue - new_networkInterfaces.append(nic) - networkProfile['networkInterfaces'] = new_networkInterfaces - properties['networkProfile'] = networkProfile - serialized['properties'] = properties - return self.create_or_update(resource_group_name=resource_group_name, virtualmachines_name=virtualmachines_name, virtualmachines=serialized) - remove_vnic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualmachines/{virtualmachinesName}'} # type: ignore diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py deleted file mode 100644 index 8b0a6a5cb51..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/operations/_virtualnetworks_operations.py +++ /dev/null @@ -1,470 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class VirtualnetworksOperations(object): - """VirtualnetworksOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2022-12-15-preview" - - self.config = config - - def retrieve( - self, resource_group_name, virtualnetworks_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Virtualnetworks or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Virtualnetworks or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.retrieve.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Virtualnetworks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - retrieve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} - - - def _create_or_update_initial( - self, resource_group_name, virtualnetworks_name, virtualnetworks, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(virtualnetworks, 'Virtualnetworks') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Virtualnetworks', response) - if response.status_code == 201: - deserialized = self._deserialize('Virtualnetworks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, virtualnetworks_name, virtualnetworks, custom_headers=None, raw=False, polling=True, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :param virtualnetworks: - :type virtualnetworks: - ~azure.mgmt.azurestackhci.models.Virtualnetworks - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Virtualnetworks or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.azurestackhci.models.Virtualnetworks] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.azurestackhci.models.Virtualnetworks]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtualnetworks_name=virtualnetworks_name, - virtualnetworks=virtualnetworks, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Virtualnetworks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} - - def delete( - self, resource_group_name, virtualnetworks_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - polling_method = ARMPolling(lro_delay, **operation_config) - return LROPoller(self._client, response, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} - - def update( - self, resource_group_name, virtualnetworks_name, tags=None, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param virtualnetworks_name: - :type virtualnetworks_name: str - :param tags: Resource tags - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Virtualnetworks or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.azurestackhci.models.Virtualnetworks or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - virtualnetworks = models.VirtualnetworksPatch(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'virtualnetworksName': self._serialize.url("virtualnetworks_name", virtualnetworks_name, 'str', max_length=64, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(virtualnetworks, 'VirtualnetworksPatch') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Virtualnetworks', response) - if response.status_code == 202: - deserialized = self._deserialize('Virtualnetworks', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks/{virtualnetworksName}'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """ - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Virtualnetworks - :rtype: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPaged[~azure.mgmt.azurestackhci.models.Virtualnetworks] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VirtualnetworksPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualnetworks'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """ - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Virtualnetworks - :rtype: - ~azure.mgmt.azurestackhci.models.VirtualnetworksPaged[~azure.mgmt.azurestackhci.models.Virtualnetworks] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VirtualnetworksPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualnetworks'} diff --git a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py b/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py deleted file mode 100644 index 0ec2fae7a62..00000000000 --- a/src/stack-hci-vm/azext_stack_hci_vm/azext_azurestackhci/vendored_sdks/azurestackhci/version.py +++ /dev/null @@ -1,13 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -VERSION = "2020-11-01-preview" - diff --git a/src/stack-hci-vm/linter_exclusions.yml b/src/stack-hci-vm/linter_exclusions.yml deleted file mode 100644 index cc050b12dbb..00000000000 --- a/src/stack-hci-vm/linter_exclusions.yml +++ /dev/null @@ -1,15 +0,0 @@ -stack-hci-vm cluster create: - parameters: - user_assigned_identities: - rule_exclusions: - - option_length_too_long -stack-hci-vm cluster update: - parameters: - user_assigned_identities: - rule_exclusions: - - option_length_too_long -stack-hci-vm cluster extend-software-assurance-benefit: - parameters: - software_assurance_intent: - rule_exclusions: - - option_length_too_long diff --git a/src/stack-hci-vm/setup.cfg b/src/stack-hci-vm/setup.cfg deleted file mode 100644 index 8bfd5a12f85..00000000000 --- a/src/stack-hci-vm/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 - diff --git a/src/stack-hci-vm/setup.py b/src/stack-hci-vm/setup.py deleted file mode 100644 index a7f947a4e77..00000000000 --- a/src/stack-hci-vm/setup.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import sys -from codecs import open -from setuptools import setup, find_packages - -# HISTORY.rst entry. -VERSION = '0.2.9' -try: - from azext_azurestackhci.manual.version import VERSION -except ImportError: - pass - -if '--version' in sys.argv: - index = sys.argv.index('--version') - sys.argv.pop(index) # Removes the '--version' - VERSION = sys.argv.pop(index) # Returns the element after the '--version' -# The version is now ready to use for the setup - -# The full list of classifiers is available at -# https://pypi.python.org/pypi?%3Aaction=list_classifiers -CLASSIFIERS = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'License :: OSI Approved :: MIT License', -] - -DEPENDENCIES = [] - -try: - from azext_azurestackhci.manual.dependency import DEPENDENCIES -except ImportError: - pass - -with open('README.md', 'r', encoding='utf-8') as f: - README = f.read() -with open('HISTORY.rst', 'r', encoding='utf-8') as f: - HISTORY = f.read() - -setup( - name='azurestackhci', - version=VERSION, - description='Microsoft Azure Command-Line Tools AzureStackHCI Extension', - author='Microsoft Corporation', - author_email='azpycli@microsoft.com', - url='https://github.com/Azure/azure-cli-extensions/tree/master/src/azurestackhci', - long_description=README + '\n\n' + HISTORY, - license='MIT', - classifiers=CLASSIFIERS, - packages=find_packages(), - install_requires=DEPENDENCIES, - package_data={'azext_azurestackhci': ['azext_metadata.json']}, -) From 76981eb272873d899e2558d245aa6829f151c0dc Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 11:57:20 -0500 Subject: [PATCH 05/21] Fix URL --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index 2a98a83fb42..ebaa4831171 100644 --- a/src/index.json +++ b/src/index.json @@ -56402,7 +56402,7 @@ ], "stack-hci-vm": [ { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/stack_hci_vm-0.1.2-py3-none-any.whl", + "downloadUrl": "https://hybridaksstorage.z13.web.core.windows.net/SelfServiceVM/CLI/stack_hci_vm-0.1.2-py3-none-any.whl", "filename": "stack_hci_vm-0.1.2-py3-none-any.whl", "metadata": { "azext.isExperimental": true, From 21dac5aed737ebae8e4125c1278c29a2b2e4fefa Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 12:44:53 -0500 Subject: [PATCH 06/21] Lowercase SHA hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index ebaa4831171..50ed22ba978 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", "version": "0.1.2" }, - "sha256Digest": "3A72672F48FCC2765A6B21FCC7282B2801AC4D68ABF0F303815CDDB8095C9E7B" + "sha256Digest": "3a72672f48fcc2765a6b21fcc7282b2801ac4d68abf0f303815cddb8095c9e7b" } ], "staticwebapp": [ From 388d705e3bcce63e3dfc85486494eeb159e3295f Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 14:13:34 -0500 Subject: [PATCH 07/21] Dummy change to restart CI pipeline after updating blob --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index 50ed22ba978..adf34546531 100644 --- a/src/index.json +++ b/src/index.json @@ -56439,7 +56439,7 @@ "license": "MIT", "metadata_version": "2.0", "name": "stack-hci-vm", - "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", + "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, "sha256Digest": "3a72672f48fcc2765a6b21fcc7282b2801ac4d68abf0f303815cddb8095c9e7b" From 8cc4a6cef4a63df547a3338f418be54ae773b919 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 14:22:00 -0500 Subject: [PATCH 08/21] Update hash --- src/index.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.json b/src/index.json index adf34546531..bf8c2787af6 100644 --- a/src/index.json +++ b/src/index.json @@ -56439,10 +56439,10 @@ "license": "MIT", "metadata_version": "2.0", "name": "stack-hci-vm", - "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", + "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", "version": "0.1.2" }, - "sha256Digest": "3a72672f48fcc2765a6b21fcc7282b2801ac4d68abf0f303815cddb8095c9e7b" + "sha256Digest": "a38af3d41086ab44196290d12a84985fedad36b47716035ce7c7fdc4a51040f2" } ], "staticwebapp": [ From c58d3a60441720a3b677ac376d96d004949f832b Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 14:50:16 -0500 Subject: [PATCH 09/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index bf8c2787af6..20e6aacc43d 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", "version": "0.1.2" }, - "sha256Digest": "a38af3d41086ab44196290d12a84985fedad36b47716035ce7c7fdc4a51040f2" + "sha256Digest": "7990c8af8f2308d8604d8cae1c33f1b5c0d2ca2e506ea1b540b8f98349acc92e" } ], "staticwebapp": [ From 0d273cbd14d7bfef7631d39eec62ef0dbaff7e3d Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 14:57:44 -0500 Subject: [PATCH 10/21] Dummy change --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index 20e6aacc43d..a26cf138980 100644 --- a/src/index.json +++ b/src/index.json @@ -56439,7 +56439,7 @@ "license": "MIT", "metadata_version": "2.0", "name": "stack-hci-vm", - "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension", + "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, "sha256Digest": "7990c8af8f2308d8604d8cae1c33f1b5c0d2ca2e506ea1b540b8f98349acc92e" From 2ebfb0e1e33bad76e74a614fea4e1c657f1333e4 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 15:18:28 -0500 Subject: [PATCH 11/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index a26cf138980..fa2b18c2979 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "7990c8af8f2308d8604d8cae1c33f1b5c0d2ca2e506ea1b540b8f98349acc92e" + "sha256Digest": "d41598aba9f05def15bd0bea8e6c8e41419de5b59034bb6f2a65cbc1fd14fc90" } ], "staticwebapp": [ From a6b1ec1aba51023383eb22221009ed2a90190ebe Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 15:40:15 -0500 Subject: [PATCH 12/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index fa2b18c2979..035dc84d9b6 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "d41598aba9f05def15bd0bea8e6c8e41419de5b59034bb6f2a65cbc1fd14fc90" + "sha256Digest": "3867c6fa13dd2b89edf831352b6adf6ada7f831673050e1919830f8561502891" } ], "staticwebapp": [ From a9b0b5e8817c0c99fdeb86dcc7e29b2954528a56 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 16:11:48 -0500 Subject: [PATCH 13/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index 035dc84d9b6..490ef400112 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "3867c6fa13dd2b89edf831352b6adf6ada7f831673050e1919830f8561502891" + "sha256Digest": "56a598d3b9258e1dd57abdbb27060e6462bee3a01790e21fc94b61db421e32a1" } ], "staticwebapp": [ From 6e9f17413b0d71fe677e5841cb8a3a5ec558691c Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 17:08:57 -0500 Subject: [PATCH 14/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index 490ef400112..7f836c8525b 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "56a598d3b9258e1dd57abdbb27060e6462bee3a01790e21fc94b61db421e32a1" + "sha256Digest": "0893975c923c26a60359ea074e8736987e6fd0eb4c53c0d6766de28019a287b2" } ], "staticwebapp": [ From 2964b02b8d84c5751ee5165a66761cb229f71c96 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 17:25:59 -0500 Subject: [PATCH 15/21] Add service_name.json entry --- src/service_name.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/service_name.json b/src/service_name.json index f6887870b84..6d0dd96b70a 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -529,6 +529,11 @@ "AzureServiceName": "Stack HCI", "URL": "https://learn.microsoft.com/azure-stack/hci" }, + { + "Command": "az stack-hci-vm", + "AzureServiceName": "Stack HCI VM", + "URL": "https://learn.microsoft.com/en-us/azure-stack/hci/manage/azure-arc-vm-management-overview" + }, { "Command": "az staticwebapp", "AzureServiceName": "App Services", From 5eef3d6ecca75539bb78b16ef7f569fad5897bdc Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 17:45:00 -0500 Subject: [PATCH 16/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index 7f836c8525b..9e89dd0af02 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "0893975c923c26a60359ea074e8736987e6fd0eb4c53c0d6766de28019a287b2" + "sha256Digest": "95e3dc74b627f0b6beefc31f007233dd10c5b0cecc847f1046bb0309798fc623" } ], "staticwebapp": [ From cf53c4263e247860f359d55a1280e1f775bdd320 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 18:06:34 -0500 Subject: [PATCH 17/21] Update hash after updating metadata --- src/index.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.json b/src/index.json index 9e89dd0af02..ee50e726b72 100644 --- a/src/index.json +++ b/src/index.json @@ -56406,7 +56406,7 @@ "filename": "stack_hci_vm-0.1.2-py3-none-any.whl", "metadata": { "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.3.1", + "azext.minCliCoreVersion": "2.15.0", "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "95e3dc74b627f0b6beefc31f007233dd10c5b0cecc847f1046bb0309798fc623" + "sha256Digest": "a08020148833401fda0c9123778de76fb3ddc1cbd122a1af44cb2b4c85b85617" } ], "staticwebapp": [ From 425da9091ed6665f02fa3e51a954e0589b3dd148 Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 21:42:42 -0500 Subject: [PATCH 18/21] Update hash --- src/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.json b/src/index.json index ee50e726b72..81e4cee9069 100644 --- a/src/index.json +++ b/src/index.json @@ -56442,7 +56442,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "a08020148833401fda0c9123778de76fb3ddc1cbd122a1af44cb2b4c85b85617" + "sha256Digest": "17b2f042e73e3379eb57aa3e660f7d2b8b064d60d11133c38c8dd75bd7b903db" } ], "staticwebapp": [ From c33e7e54a6df9ca82f823ad7190819f2316d87bd Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 22:28:56 -0500 Subject: [PATCH 19/21] Update project_urls --- src/index.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/index.json b/src/index.json index 81e4cee9069..c02623d9647 100644 --- a/src/index.json +++ b/src/index.json @@ -56405,16 +56405,13 @@ "downloadUrl": "https://hybridaksstorage.z13.web.core.windows.net/SelfServiceVM/CLI/stack_hci_vm-0.1.2-py3-none-any.whl", "filename": "stack_hci_vm-0.1.2-py3-none-any.whl", "metadata": { - "azext.isExperimental": true, + "azext.isPreview": true, "azext.minCliCoreVersion": "2.15.0", "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "License :: OSI Approved :: MIT License" ], @@ -56431,7 +56428,7 @@ "description": "DESCRIPTION.rst" }, "project_urls": { - "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/stack-hci-vm" + "Home": "https://msazure.visualstudio.com/msk8s/_git/azstackhci-util?version=GBmain" } } }, @@ -56442,7 +56439,7 @@ "summary": "Microsoft Azure Command-Line Tools AzureStackHCIClient Extension ", "version": "0.1.2" }, - "sha256Digest": "17b2f042e73e3379eb57aa3e660f7d2b8b064d60d11133c38c8dd75bd7b903db" + "sha256Digest": "40de4e8a6fbde3afc3f760b6014ecc4d37e8e0ec72f4ff2a5d009cfadbf9938b" } ], "staticwebapp": [ From e0e9e69ec43b1b4ad08e2fdb80ffe60a742120da Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 22:52:34 -0500 Subject: [PATCH 20/21] Remove python line --- src/index.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.json b/src/index.json index c02623d9647..ef5ebb507a2 100644 --- a/src/index.json +++ b/src/index.json @@ -56411,7 +56411,6 @@ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", - "Programming Language :: Python", "Programming Language :: Python :: 3.8", "License :: OSI Approved :: MIT License" ], From e98e85a404fdc9487e27151a59b2eb81e94dd3aa Mon Sep 17 00:00:00 2001 From: wyatt-troia-msft Date: Wed, 6 Sep 2023 23:01:30 -0500 Subject: [PATCH 21/21] Add back python line --- src/index.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.json b/src/index.json index ef5ebb507a2..c02623d9647 100644 --- a/src/index.json +++ b/src/index.json @@ -56411,6 +56411,7 @@ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", + "Programming Language :: Python", "Programming Language :: Python :: 3.8", "License :: OSI Approved :: MIT License" ],