From 845801b8cffe42d59af4c91d1f41088f49b92b6b Mon Sep 17 00:00:00 2001 From: Jing-song Date: Tue, 19 Mar 2024 17:07:26 +0800 Subject: [PATCH] desktop (#7331) --- src/desktopvirtualization/HISTORY.rst | 4 + .../azext_desktopvirtualization/__init__.py | 58 +- .../azext_desktopvirtualization/_help.py | 27 +- .../{manual/_help.py => _params.py} | 11 +- .../_validators.py => aaz/__init__.py} | 11 +- .../_version.py => aaz/latest/__init__.py} | 13 +- .../desktopvirtualization/__cmd_group.py | 23 + .../latest/desktopvirtualization/__init__.py | 11 + .../applicationgroup/__cmd_group.py | 23 + .../applicationgroup/__init__.py | 16 + .../applicationgroup/_create.py | 327 ++ .../applicationgroup/_delete.py | 143 + .../applicationgroup/_list.py | 460 +++ .../applicationgroup/_show.py | 265 ++ .../applicationgroup/_update.py | 478 +++ .../hostpool/__cmd_group.py | 23 + .../hostpool/__init__.py | 17 + .../desktopvirtualization/hostpool/_create.py | 468 +++ .../desktopvirtualization/hostpool/_delete.py | 150 + .../desktopvirtualization/hostpool/_list.py | 550 +++ .../hostpool/_retrieve_registration_token.py | 175 + .../desktopvirtualization/hostpool/_show.py | 315 ++ .../desktopvirtualization/hostpool/_update.py | 627 ++++ .../workspace/__cmd_group.py | 23 + .../workspace/__init__.py | 16 + .../workspace/_create.py | 309 ++ .../workspace/_delete.py | 143 + .../desktopvirtualization/workspace/_list.py | 420 +++ .../desktopvirtualization/workspace/_show.py | 250 ++ .../workspace/_update.py | 465 +++ .../azext_desktopvirtualization/action.py | 20 - .../azext_metadata.json | 2 +- .../azext_desktopvirtualization/commands.py | 15 + .../azext_desktopvirtualization/custom.py | 28 +- .../generated/__init__.py | 12 - .../generated/_client_factory.py | 27 - .../generated/_help.py | 222 -- .../generated/_params.py | 181 - .../generated/action.py | 88 - .../generated/commands.py | 69 - .../generated/custom.py | 298 -- .../manual/__init__.py | 12 - .../manual/tests/latest/__init__.py | 0 .../test_desktopvirtualization_scenario.py | 107 - .../tests/__init__.py | 118 +- .../tests/latest/__init__.py | 14 +- .../tests/latest/example_steps.py | 260 -- .../tests/latest/recording_processors.py | 27 + .../test_desktopvirtualization_Scenario.yaml | 1293 ------- ...esktopvirtualization_applicationgroup.yaml | 644 ++++ .../test_desktopvirtualization_hostpool.yaml | 611 ++++ .../test_desktopvirtualization_workspace.yaml | 484 +++ .../latest/test_desktopvirtualization.py | 168 + .../test_desktopvirtualization_scenario.py | 189 -- .../vendored_sdks/__init__.py | 12 - .../desktopvirtualization/__init__.py | 19 - .../desktopvirtualization/_configuration.py | 71 - .../_desktop_virtualization_api_client.py | 124 - .../desktopvirtualization/aio/__init__.py | 10 - .../aio/_configuration.py | 67 - .../aio/_desktop_virtualization_api_client.py | 118 - .../aio/operations/__init__.py | 35 - .../_application_groups_operations.py | 442 --- .../operations/_applications_operations.py | 384 --- .../aio/operations/_desktops_operations.py | 234 -- .../aio/operations/_host_pools_operations.py | 493 --- .../aio/operations/_msix_images_operations.py | 127 - .../operations/_msix_packages_operations.py | 388 --- .../aio/operations/_operations.py | 87 - .../operations/_scaling_plans_operations.py | 504 --- .../operations/_session_hosts_operations.py | 315 -- .../_start_menu_items_operations.py | 116 - .../operations/_user_sessions_operations.py | 471 --- .../aio/operations/_workspaces_operations.py | 430 --- .../desktopvirtualization/models/__init__.py | 224 -- ...desktop_virtualization_api_client_enums.py | 213 -- .../desktopvirtualization/models/_models.py | 2702 --------------- .../models/_models_py3.py | 3022 ----------------- .../operations/__init__.py | 35 - .../_application_groups_operations.py | 452 --- .../operations/_applications_operations.py | 393 --- .../operations/_desktops_operations.py | 241 -- .../operations/_host_pools_operations.py | 504 --- .../operations/_msix_images_operations.py | 132 - .../operations/_msix_packages_operations.py | 397 --- .../operations/_operations.py | 92 - .../operations/_scaling_plans_operations.py | 515 --- .../operations/_session_hosts_operations.py | 323 -- .../_start_menu_items_operations.py | 121 - .../operations/_user_sessions_operations.py | 481 --- .../operations/_workspaces_operations.py | 440 --- .../desktopvirtualization/py.typed | 1 - src/desktopvirtualization/setup.py | 20 +- 93 files changed, 7730 insertions(+), 17735 deletions(-) rename src/desktopvirtualization/azext_desktopvirtualization/{manual/_help.py => _params.py} (71%) rename src/desktopvirtualization/azext_desktopvirtualization/{generated/_validators.py => aaz/__init__.py} (55%) rename src/desktopvirtualization/azext_desktopvirtualization/{vendored_sdks/desktopvirtualization/_version.py => aaz/latest/__init__.py} (58%) create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__cmd_group.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__init__.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__cmd_group.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__init__.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_create.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_delete.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_list.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_show.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_update.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__cmd_group.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__init__.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_create.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_delete.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_list.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_retrieve_registration_token.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_show.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_update.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__cmd_group.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__init__.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_create.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_delete.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_list.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_show.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_update.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/action.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/commands.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/_client_factory.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/_help.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/_params.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/action.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/commands.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/generated/custom.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/manual/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/test_desktopvirtualization_scenario.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/example_steps.py create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recording_processors.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_Scenario.yaml create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_applicationgroup.yaml create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_hostpool.yaml create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_workspace.yaml create mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization_scenario.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_configuration.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_desktop_virtualization_api_client.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_configuration.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_desktop_virtualization_api_client.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_application_groups_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_applications_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_desktops_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_images_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_packages_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_scaling_plans_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_session_hosts_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_start_menu_items_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_user_sessions_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_workspaces_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models_py3.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_application_groups_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_applications_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_desktops_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_host_pools_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_images_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_packages_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_scaling_plans_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_session_hosts_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_start_menu_items_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_user_sessions_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_workspaces_operations.py delete mode 100644 src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/py.typed diff --git a/src/desktopvirtualization/HISTORY.rst b/src/desktopvirtualization/HISTORY.rst index 4b1f817e8fc..8421bd0a1cf 100644 --- a/src/desktopvirtualization/HISTORY.rst +++ b/src/desktopvirtualization/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.0.0 +++++++ +*Migrate to aaz commands + 0.2.0 ++++++ * Bump version to 2021-07-12. diff --git a/src/desktopvirtualization/azext_desktopvirtualization/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/__init__.py index d02699c767c..92a5c8c725f 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/__init__.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/__init__.py @@ -1,52 +1,42 @@ -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=unused-import +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader -import azext_desktopvirtualization._help +from azext_desktopvirtualization._help import helps # pylint: disable=unused-import -class DesktopVirtualizationAPIClientCommandsLoader(AzCommandsLoader): +class DesktopvirtualizationCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_desktopvirtualization.generated._client_factory import cf_desktopvirtualization_cl - desktopvirtualization_custom = CliCommandType( - operations_tmpl='azext_desktopvirtualization.custom#{}', - client_factory=cf_desktopvirtualization_cl) - super().__init__(cli_ctx=cli_ctx, custom_command_type=desktopvirtualization_custom) + custom_command_type = CliCommandType( + operations_tmpl='azext_desktopvirtualization.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) def load_command_table(self, args): - from azext_desktopvirtualization.generated.commands import load_command_table - load_command_table(self, args) + from azext_desktopvirtualization.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table try: - from azext_desktopvirtualization.manual.commands import load_command_table as load_command_table_manual - load_command_table_manual(self, args) - except ImportError as e: - if e.name.endswith('manual.commands'): - pass - else: - raise e + 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_desktopvirtualization.generated._params import load_arguments + from azext_desktopvirtualization._params import load_arguments load_arguments(self, command) - try: - from azext_desktopvirtualization.manual._params import load_arguments as load_arguments_manual - load_arguments_manual(self, command) - except ImportError as e: - if e.name.endswith('manual._params'): - pass - else: - raise e -COMMAND_LOADER_CLS = DesktopVirtualizationAPIClientCommandsLoader +COMMAND_LOADER_CLS = DesktopvirtualizationCommandsLoader diff --git a/src/desktopvirtualization/azext_desktopvirtualization/_help.py b/src/desktopvirtualization/azext_desktopvirtualization/_help.py index 9b93f87a6e9..126d5d00714 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/_help.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/_help.py @@ -1,20 +1,11 @@ -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wildcard-import -# pylint: disable=unused-wildcard-import -# pylint: disable=unused-import -from .generated._help import helps # pylint: disable=reimported -try: - from .manual._help import helps # pylint: disable=reimported -except ImportError as e: - if e.name.endswith('manual._help'): - pass - else: - raise e +# 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/desktopvirtualization/azext_desktopvirtualization/manual/_help.py b/src/desktopvirtualization/azext_desktopvirtualization/_params.py similarity index 71% rename from src/desktopvirtualization/azext_desktopvirtualization/manual/_help.py rename to src/desktopvirtualization/azext_desktopvirtualization/_params.py index bd331c2d7c3..cfcec717c9c 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/manual/_help.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/_params.py @@ -1,12 +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 -from knack.help_files import helps -helps['desktopvirtualization'] = """ - type: group - short-summary: Manage desktop virtualization -""" +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/_validators.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/__init__.py similarity index 55% rename from src/desktopvirtualization/azext_desktopvirtualization/generated/_validators.py rename to src/desktopvirtualization/azext_desktopvirtualization/aaz/__init__.py index b33a44c1ebf..5757aea3175 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/_validators.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/__init__.py @@ -1,9 +1,6 @@ -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_version.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/__init__.py similarity index 58% rename from src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_version.py rename to src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/__init__.py index e5754a47ce6..f6acc11aa4e 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_version.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/__init__.py @@ -1,9 +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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa -VERSION = "1.0.0b1" diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__cmd_group.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__cmd_group.py new file mode 100644 index 00000000000..673acd1de50 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__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( + "desktopvirtualization", +) +class __CMDGroup(AAZCommandGroup): + """Manage desktop virtualization. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__init__.py new file mode 100644 index 00000000000..5a9d61963d6 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/__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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__cmd_group.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__cmd_group.py new file mode 100644 index 00000000000..2c80ab0e018 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__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( + "desktopvirtualization applicationgroup", +) +class __CMDGroup(AAZCommandGroup): + """Manage desktop virtualization application group. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/__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 ._update import * diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_create.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_create.py new file mode 100644 index 00000000000..4cb9987eacd --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_create.py @@ -0,0 +1,327 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization applicationgroup create", +) +class Create(AAZCommand): + """Create an application group. + + :example: Create application group + az desktopvirtualization applicationgroup create -g rg -n app-group-name --host-pool-arm-path host-pool-id --application-group-type remoteapp + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/applicationgroups/{}", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the application group", + required=True, + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.location = AAZResourceLocationArg( + help="The geo-location where the resource lives", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.application_group_type = AAZStrArg( + options=["--application-group-type"], + help="Resource type of application group.", + required=True, + enum={"Desktop": "Desktop", "RemoteApp": "RemoteApp"}, + ) + _args_schema.description = AAZStrArg( + options=["--description"], + help="Description of ApplicationGroup.", + ) + _args_schema.friendly_name = AAZStrArg( + options=["--friendly-name"], + help="Friendly name of application group.", + ) + _args_schema.host_pool_arm_path = AAZStrArg( + options=["--host-pool-arm-path"], + help="Host pool arm path of application group.", + required=True, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "ApplicationGroup" + + # define Arg Group "Properties" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ApplicationGroupsCreateOrUpdate(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 ApplicationGroupsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationGroupName", self.ctx.args.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", "2021-07-12", + 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("location", AAZStrType, ".location") + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("applicationGroupType", AAZStrType, ".application_group_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("friendlyName", AAZStrType, ".friendly_name") + properties.set_prop("hostPoolArmPath", AAZStrType, ".host_pool_arm_path", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _schema_on_200_201.kind = AAZStrType() + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.plan = AAZObjectType() + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200_201.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() + + plan = cls._schema_on_200_201.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200_201.properties + properties.application_group_type = AAZStrType( + serialized_name="applicationGroupType", + flags={"required": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_arm_path = AAZStrType( + serialized_name="hostPoolArmPath", + flags={"required": True}, + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.workspace_arm_path = AAZStrType( + serialized_name="workspaceArmPath", + flags={"read_only": True}, + ) + + migration_request = cls._schema_on_200_201.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + sku = cls._schema_on_200_201.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_delete.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_delete.py new file mode 100644 index 00000000000..9ee603970ef --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_delete.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization applicationgroup delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an application group. + + :example: Delete application group + az desktopvirtualization applicationgroup delete -g rg -n app-group-name + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/applicationgroups/{}", "2021-07-12"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the application group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ApplicationGroupsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ApplicationGroupsDelete(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) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationGroupName", self.ctx.args.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", "2021-07-12", + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_list.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_list.py new file mode 100644 index 00000000000..449e306dfa7 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_list.py @@ -0,0 +1,460 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization applicationgroup list", +) +class List(AAZCommand): + """List application groups. + + :example: List application groups + az desktopvirtualization applicationgroup list -g rg + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.desktopvirtualization/applicationgroups", "2021-07-12"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/applicationgroups", "2021-07-12"], + ] + } + + 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.resource_group = AAZResourceGroupNameArg() + _args_schema.filter = AAZStrArg( + options=["--filter"], + help="OData filter expression. Valid properties for filtering are applicationGroupType.", + ) + 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.ApplicationGroupsListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.ApplicationGroupsListBySubscription(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 ApplicationGroupsListByResourceGroup(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.DesktopVirtualization/applicationGroups", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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( + "$filter", self.ctx.args.filter, + ), + **self.serialize_query_param( + "api-version", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.kind = AAZStrType() + _element.location = AAZStrType() + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.value.Element.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.application_group_type = AAZStrType( + serialized_name="applicationGroupType", + flags={"required": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_arm_path = AAZStrType( + serialized_name="hostPoolArmPath", + flags={"required": True}, + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.workspace_arm_path = AAZStrType( + serialized_name="workspaceArmPath", + flags={"read_only": True}, + ) + + migration_request = cls._schema_on_200.value.Element.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class ApplicationGroupsListBySubscription(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.DesktopVirtualization/applicationGroups", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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( + "$filter", self.ctx.args.filter, + ), + **self.serialize_query_param( + "api-version", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.kind = AAZStrType() + _element.location = AAZStrType() + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.value.Element.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.application_group_type = AAZStrType( + serialized_name="applicationGroupType", + flags={"required": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_arm_path = AAZStrType( + serialized_name="hostPoolArmPath", + flags={"required": True}, + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.workspace_arm_path = AAZStrType( + serialized_name="workspaceArmPath", + flags={"read_only": True}, + ) + + migration_request = cls._schema_on_200.value.Element.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_show.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_show.py new file mode 100644 index 00000000000..64d9a8f1068 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_show.py @@ -0,0 +1,265 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization applicationgroup show", +) +class Show(AAZCommand): + """Show an application group. + + :example: Show application group + az desktopvirtualization applicationgroup show -g rg -n app-group-name + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/applicationgroups/{}", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the application group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ApplicationGroupsGet(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 ApplicationGroupsGet(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.DesktopVirtualization/applicationGroups/{applicationGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationGroupName", self.ctx.args.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", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.kind = AAZStrType() + _schema_on_200.location = AAZStrType() + _schema_on_200.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.properties + properties.application_group_type = AAZStrType( + serialized_name="applicationGroupType", + flags={"required": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_arm_path = AAZStrType( + serialized_name="hostPoolArmPath", + flags={"required": True}, + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.workspace_arm_path = AAZStrType( + serialized_name="workspaceArmPath", + flags={"read_only": True}, + ) + + migration_request = cls._schema_on_200.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_update.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_update.py new file mode 100644 index 00000000000..b1ccf3e71fa --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/applicationgroup/_update.py @@ -0,0 +1,478 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization applicationgroup update", +) +class Update(AAZCommand): + """Update an application group. + + :example: Update application group + az desktopvirtualization applicationgroup update -g rg -n app-group-name --tags tag=test + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/applicationgroups/{}", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the application group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.application_group_type = AAZStrArg( + options=["--application-group-type"], + help="Resource type of application group.", + enum={"Desktop": "Desktop", "RemoteApp": "RemoteApp"}, + ) + _args_schema.description = AAZStrArg( + options=["--description"], + help="Description of ApplicationGroup.", + nullable=True, + ) + _args_schema.friendly_name = AAZStrArg( + options=["--friendly-name"], + help="Friendly name of application group.", + nullable=True, + ) + _args_schema.host_pool_arm_path = AAZStrArg( + options=["--host-pool-arm-path"], + help="Host pool arm path of application group.", + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "ApplicationGroup" + + # define Arg Group "Properties" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ApplicationGroupsGet(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.ApplicationGroupsCreateOrUpdate(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 ApplicationGroupsGet(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.DesktopVirtualization/applicationGroups/{applicationGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationGroupName", self.ctx.args.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", "2021-07-12", + 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_application_group_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ApplicationGroupsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationGroupName", self.ctx.args.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", "2021-07-12", + 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_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() + _UpdateHelper._build_schema_application_group_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + 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": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("applicationGroupType", AAZStrType, ".application_group_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("friendlyName", AAZStrType, ".friendly_name") + properties.set_prop("hostPoolArmPath", AAZStrType, ".host_pool_arm_path", typ_kwargs={"flags": {"required": True}}) + + 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_application_group_read = None + + @classmethod + def _build_schema_application_group_read(cls, _schema): + if cls._schema_application_group_read is not None: + _schema.etag = cls._schema_application_group_read.etag + _schema.id = cls._schema_application_group_read.id + _schema.identity = cls._schema_application_group_read.identity + _schema.kind = cls._schema_application_group_read.kind + _schema.location = cls._schema_application_group_read.location + _schema.managed_by = cls._schema_application_group_read.managed_by + _schema.name = cls._schema_application_group_read.name + _schema.plan = cls._schema_application_group_read.plan + _schema.properties = cls._schema_application_group_read.properties + _schema.sku = cls._schema_application_group_read.sku + _schema.tags = cls._schema_application_group_read.tags + _schema.type = cls._schema_application_group_read.type + return + + cls._schema_application_group_read = _schema_application_group_read = AAZObjectType() + + application_group_read = _schema_application_group_read + application_group_read.etag = AAZStrType( + flags={"read_only": True}, + ) + application_group_read.id = AAZStrType( + flags={"read_only": True}, + ) + application_group_read.identity = AAZObjectType() + application_group_read.kind = AAZStrType() + application_group_read.location = AAZStrType() + application_group_read.managed_by = AAZStrType( + serialized_name="managedBy", + ) + application_group_read.name = AAZStrType( + flags={"read_only": True}, + ) + application_group_read.plan = AAZObjectType() + application_group_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + application_group_read.sku = AAZObjectType() + application_group_read.tags = AAZDictType() + application_group_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_application_group_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() + + plan = _schema_application_group_read.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = _schema_application_group_read.properties + properties.application_group_type = AAZStrType( + serialized_name="applicationGroupType", + flags={"required": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_arm_path = AAZStrType( + serialized_name="hostPoolArmPath", + flags={"required": True}, + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.workspace_arm_path = AAZStrType( + serialized_name="workspaceArmPath", + flags={"read_only": True}, + ) + + migration_request = _schema_application_group_read.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + sku = _schema_application_group_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_application_group_read.tags + tags.Element = AAZStrType() + + _schema.etag = cls._schema_application_group_read.etag + _schema.id = cls._schema_application_group_read.id + _schema.identity = cls._schema_application_group_read.identity + _schema.kind = cls._schema_application_group_read.kind + _schema.location = cls._schema_application_group_read.location + _schema.managed_by = cls._schema_application_group_read.managed_by + _schema.name = cls._schema_application_group_read.name + _schema.plan = cls._schema_application_group_read.plan + _schema.properties = cls._schema_application_group_read.properties + _schema.sku = cls._schema_application_group_read.sku + _schema.tags = cls._schema_application_group_read.tags + _schema.type = cls._schema_application_group_read.type + + +__all__ = ["Update"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__cmd_group.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__cmd_group.py new file mode 100644 index 00000000000..531e6ea08b3 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__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( + "desktopvirtualization hostpool", +) +class __CMDGroup(AAZCommandGroup): + """Manage desktop virtualization host pool. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__init__.py new file mode 100644 index 00000000000..c3fb62d806a --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/__init__.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._retrieve_registration_token import * +from ._show import * +from ._update import * diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_create.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_create.py new file mode 100644 index 00000000000..38dab551664 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_create.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( + "desktopvirtualization hostpool create", +) +class Create(AAZCommand): + """Create a host pool. + + :example: Create host pool + az desktopvirtualization hostpool create -g rg -n hostpool-name --friendly-name friendly --host-pool-type Pooled --load-balancer-type BreadthFirst --max-session-limit 999999 --personal-desktop-assignment-type Automatic --preferred-app-group-type Desktop --registration-info expiration-time="yyyy-mm-ddT08:38:08.189Z" registration-token-operation=Update --sso-client-id client --sso-client-secret-key-vault-path https://keyvault/secret --sso-secret-type SharedKey --start-vm-on-connect false + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/hostpools/{}", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the host pool within the specified resource group", + required=True, + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.location = AAZResourceLocationArg( + help="The geo-location where the resource lives", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.custom_rdp_property = AAZStrArg( + options=["--custom-rdp-property"], + help="Custom rdp property of host pool.", + ) + _args_schema.description = AAZStrArg( + options=["--description"], + help="Description of HostPool.", + ) + _args_schema.friendly_name = AAZStrArg( + options=["--friendly-name"], + help="Friendly name of HostPool.", + ) + _args_schema.host_pool_type = AAZStrArg( + options=["--host-pool-type"], + help="Host pool type for desktop.", + required=True, + enum={"BYODesktop": "BYODesktop", "Personal": "Personal", "Pooled": "Pooled"}, + ) + _args_schema.load_balancer_type = AAZStrArg( + options=["--load-balancer-type"], + help="The type of the load balancer.", + required=True, + enum={"BreadthFirst": "BreadthFirst", "DepthFirst": "DepthFirst", "Persistent": "Persistent"}, + ) + _args_schema.max_session_limit = AAZIntArg( + options=["--max-session-limit"], + help="The max session limit of HostPool.", + ) + _args_schema.personal_desktop_assignment_type = AAZStrArg( + options=["--personal-desktop-assignment-type"], + help="PersonalDesktopAssignment type for HostPool.", + enum={"Automatic": "Automatic", "Direct": "Direct"}, + ) + _args_schema.preferred_app_group_type = AAZStrArg( + options=["-t", "--preferred-app-group-type"], + help="The type of preferred application group type, default to desktop application group", + required=True, + enum={"Desktop": "Desktop", "None": "None", "RailApplications": "RailApplications"}, + ) + _args_schema.registration_info = AAZObjectArg( + options=["--registration-info"], + help="The registration info of HostPool.", + ) + _args_schema.ring = AAZIntArg( + options=["--ring"], + help="The ring number of HostPool.", + ) + _args_schema.sso_client_id = AAZStrArg( + options=["--sso-client-id"], + help="ClientId for the registered Relying Party used to issue WVD SSO certificates.", + ) + _args_schema.sso_client_secret_key_vault_path = AAZStrArg( + options=["-p", "--sso-client-secret-key-vault-path"], + help="Path to Azure KeyVault storing the secret used for communication to ADFS.", + ) + _args_schema.sso_secret_type = AAZStrArg( + options=["--sso-secret-type"], + help="The type of single sign on Secret Type.", + enum={"Certificate": "Certificate", "CertificateInKeyVault": "CertificateInKeyVault", "SharedKey": "SharedKey", "SharedKeyInKeyVault": "SharedKeyInKeyVault"}, + ) + _args_schema.ssoadfs_authority = AAZStrArg( + options=["--ssoadfs-authority"], + help="URL to customer ADFS server for signing WVD SSO certificates.", + ) + _args_schema.start_vm_on_connect = AAZBoolArg( + options=["--start-vm-on-connect"], + help="The flag to turn on/off StartVMOnConnect feature.", + ) + _args_schema.validation_environment = AAZBoolArg( + options=["--validation-environment"], + help="Is validation environment.", + ) + _args_schema.vm_template = AAZStrArg( + options=["--vm-template"], + help="VM template for sessionhosts configuration within hostpool.", + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Resource tags.", + ) + + registration_info = cls._args_schema.registration_info + registration_info.expiration_time = AAZDateTimeArg( + options=["expiration-time"], + help="Expiration time of registration token.", + ) + registration_info.registration_token_operation = AAZStrArg( + options=["registration-token-operation"], + help="The type of resetting the token.", + enum={"Delete": "Delete", "None": "None", "Update": "Update"}, + ) + registration_info.token = AAZStrArg( + options=["token"], + help="The registration token base64 encoded string.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "HostPool" + + # define Arg Group "Properties" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HostPoolsCreateOrUpdate(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 HostPoolsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "hostPoolName", self.ctx.args.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", "2021-07-12", + 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("location", AAZStrType, ".location") + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("customRdpProperty", AAZStrType, ".custom_rdp_property") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("friendlyName", AAZStrType, ".friendly_name") + properties.set_prop("hostPoolType", AAZStrType, ".host_pool_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("loadBalancerType", AAZStrType, ".load_balancer_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("maxSessionLimit", AAZIntType, ".max_session_limit") + properties.set_prop("personalDesktopAssignmentType", AAZStrType, ".personal_desktop_assignment_type") + properties.set_prop("preferredAppGroupType", AAZStrType, ".preferred_app_group_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("registrationInfo", AAZObjectType, ".registration_info") + properties.set_prop("ring", AAZIntType, ".ring") + properties.set_prop("ssoClientId", AAZStrType, ".sso_client_id") + properties.set_prop("ssoClientSecretKeyVaultPath", AAZStrType, ".sso_client_secret_key_vault_path") + properties.set_prop("ssoSecretType", AAZStrType, ".sso_secret_type") + properties.set_prop("ssoadfsAuthority", AAZStrType, ".ssoadfs_authority") + properties.set_prop("startVMOnConnect", AAZBoolType, ".start_vm_on_connect") + properties.set_prop("validationEnvironment", AAZBoolType, ".validation_environment") + properties.set_prop("vmTemplate", AAZStrType, ".vm_template") + + registration_info = _builder.get(".properties.registrationInfo") + if registration_info is not None: + registration_info.set_prop("expirationTime", AAZStrType, ".expiration_time") + registration_info.set_prop("registrationTokenOperation", AAZStrType, ".registration_token_operation") + registration_info.set_prop("token", AAZStrType, ".token") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _schema_on_200_201.kind = AAZStrType() + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.plan = AAZObjectType() + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200_201.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() + + plan = cls._schema_on_200_201.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200_201.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + flags={"read_only": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.custom_rdp_property = AAZStrType( + serialized_name="customRdpProperty", + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_type = AAZStrType( + serialized_name="hostPoolType", + flags={"required": True}, + ) + properties.load_balancer_type = AAZStrType( + serialized_name="loadBalancerType", + flags={"required": True}, + ) + properties.max_session_limit = AAZIntType( + serialized_name="maxSessionLimit", + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.personal_desktop_assignment_type = AAZStrType( + serialized_name="personalDesktopAssignmentType", + ) + properties.preferred_app_group_type = AAZStrType( + serialized_name="preferredAppGroupType", + flags={"required": True}, + ) + properties.registration_info = AAZObjectType( + serialized_name="registrationInfo", + ) + properties.ring = AAZIntType() + properties.sso_client_id = AAZStrType( + serialized_name="ssoClientId", + ) + properties.sso_client_secret_key_vault_path = AAZStrType( + serialized_name="ssoClientSecretKeyVaultPath", + ) + properties.sso_secret_type = AAZStrType( + serialized_name="ssoSecretType", + ) + properties.ssoadfs_authority = AAZStrType( + serialized_name="ssoadfsAuthority", + ) + properties.start_vm_on_connect = AAZBoolType( + serialized_name="startVMOnConnect", + ) + properties.validation_environment = AAZBoolType( + serialized_name="validationEnvironment", + ) + properties.vm_template = AAZStrType( + serialized_name="vmTemplate", + ) + + application_group_references = cls._schema_on_200_201.properties.application_group_references + application_group_references.Element = AAZStrType() + + migration_request = cls._schema_on_200_201.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + registration_info = cls._schema_on_200_201.properties.registration_info + registration_info.expiration_time = AAZStrType( + serialized_name="expirationTime", + ) + registration_info.registration_token_operation = AAZStrType( + serialized_name="registrationTokenOperation", + ) + registration_info.token = AAZStrType() + + sku = cls._schema_on_200_201.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_delete.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_delete.py new file mode 100644 index 00000000000..06b0613e92c --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_delete.py @@ -0,0 +1,150 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization hostpool delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a host pool. + + :example: Delete host pool + az desktopvirtualization hostpool delete -g rg -n hostpool-name + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/hostpools/{}", "2021-07-12"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the host pool within the specified resource group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.force = AAZBoolArg( + options=["--force"], + help="Force flag to delete sessionHost.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HostPoolsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class HostPoolsDelete(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) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "hostPoolName", self.ctx.args.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( + "force", self.ctx.args.force, + ), + **self.serialize_query_param( + "api-version", "2021-07-12", + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_list.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_list.py new file mode 100644 index 00000000000..c082616552d --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_list.py @@ -0,0 +1,550 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization hostpool list", +) +class List(AAZCommand): + """List host pools. + + :example: List host pool + az desktopvirtualization hostpool list -g rg + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.desktopvirtualization/hostpools", "2021-07-12"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/hostpools", "2021-07-12"], + ] + } + + 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.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + if condition_0: + self.HostPoolsList(ctx=self.ctx)() + if condition_1: + self.HostPoolsListByResourceGroup(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 HostPoolsList(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.DesktopVirtualization/hostPools", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.kind = AAZStrType() + _element.location = AAZStrType() + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.value.Element.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + flags={"read_only": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.custom_rdp_property = AAZStrType( + serialized_name="customRdpProperty", + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_type = AAZStrType( + serialized_name="hostPoolType", + flags={"required": True}, + ) + properties.load_balancer_type = AAZStrType( + serialized_name="loadBalancerType", + flags={"required": True}, + ) + properties.max_session_limit = AAZIntType( + serialized_name="maxSessionLimit", + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.personal_desktop_assignment_type = AAZStrType( + serialized_name="personalDesktopAssignmentType", + ) + properties.preferred_app_group_type = AAZStrType( + serialized_name="preferredAppGroupType", + flags={"required": True}, + ) + properties.registration_info = AAZObjectType( + serialized_name="registrationInfo", + ) + properties.ring = AAZIntType() + properties.sso_client_id = AAZStrType( + serialized_name="ssoClientId", + ) + properties.sso_client_secret_key_vault_path = AAZStrType( + serialized_name="ssoClientSecretKeyVaultPath", + ) + properties.sso_secret_type = AAZStrType( + serialized_name="ssoSecretType", + ) + properties.ssoadfs_authority = AAZStrType( + serialized_name="ssoadfsAuthority", + ) + properties.start_vm_on_connect = AAZBoolType( + serialized_name="startVMOnConnect", + ) + properties.validation_environment = AAZBoolType( + serialized_name="validationEnvironment", + ) + properties.vm_template = AAZStrType( + serialized_name="vmTemplate", + ) + + application_group_references = cls._schema_on_200.value.Element.properties.application_group_references + application_group_references.Element = AAZStrType() + + migration_request = cls._schema_on_200.value.Element.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + registration_info = cls._schema_on_200.value.Element.properties.registration_info + registration_info.expiration_time = AAZStrType( + serialized_name="expirationTime", + ) + registration_info.registration_token_operation = AAZStrType( + serialized_name="registrationTokenOperation", + ) + registration_info.token = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class HostPoolsListByResourceGroup(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.DesktopVirtualization/hostPools", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.kind = AAZStrType() + _element.location = AAZStrType() + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.value.Element.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + flags={"read_only": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.custom_rdp_property = AAZStrType( + serialized_name="customRdpProperty", + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_type = AAZStrType( + serialized_name="hostPoolType", + flags={"required": True}, + ) + properties.load_balancer_type = AAZStrType( + serialized_name="loadBalancerType", + flags={"required": True}, + ) + properties.max_session_limit = AAZIntType( + serialized_name="maxSessionLimit", + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.personal_desktop_assignment_type = AAZStrType( + serialized_name="personalDesktopAssignmentType", + ) + properties.preferred_app_group_type = AAZStrType( + serialized_name="preferredAppGroupType", + flags={"required": True}, + ) + properties.registration_info = AAZObjectType( + serialized_name="registrationInfo", + ) + properties.ring = AAZIntType() + properties.sso_client_id = AAZStrType( + serialized_name="ssoClientId", + ) + properties.sso_client_secret_key_vault_path = AAZStrType( + serialized_name="ssoClientSecretKeyVaultPath", + ) + properties.sso_secret_type = AAZStrType( + serialized_name="ssoSecretType", + ) + properties.ssoadfs_authority = AAZStrType( + serialized_name="ssoadfsAuthority", + ) + properties.start_vm_on_connect = AAZBoolType( + serialized_name="startVMOnConnect", + ) + properties.validation_environment = AAZBoolType( + serialized_name="validationEnvironment", + ) + properties.vm_template = AAZStrType( + serialized_name="vmTemplate", + ) + + application_group_references = cls._schema_on_200.value.Element.properties.application_group_references + application_group_references.Element = AAZStrType() + + migration_request = cls._schema_on_200.value.Element.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + registration_info = cls._schema_on_200.value.Element.properties.registration_info + registration_info.expiration_time = AAZStrType( + serialized_name="expirationTime", + ) + registration_info.registration_token_operation = AAZStrType( + serialized_name="registrationTokenOperation", + ) + registration_info.token = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_retrieve_registration_token.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_retrieve_registration_token.py new file mode 100644 index 00000000000..1466c066ec9 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_retrieve_registration_token.py @@ -0,0 +1,175 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization hostpool retrieve-registration-token", +) +class RetrieveRegistrationToken(AAZCommand): + """Registration token of the host pool. + + :example: Registration token of the host pool. + az desktopvirtualization hostpool retrieve-registration-token -n hostpool-name -g rg + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/hostpools/{}/retrieveregistrationtoken", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the host pool within the specified resource group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HostPoolsRetrieveRegistrationToken(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 HostPoolsRetrieveRegistrationToken(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.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "hostPoolName", self.ctx.args.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", "2021-07-12", + 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.expiration_time = AAZStrType( + serialized_name="expirationTime", + ) + _schema_on_200.registration_token_operation = AAZStrType( + serialized_name="registrationTokenOperation", + ) + _schema_on_200.token = AAZStrType() + + return cls._schema_on_200 + + +class _RetrieveRegistrationTokenHelper: + """Helper class for RetrieveRegistrationToken""" + + +__all__ = ["RetrieveRegistrationToken"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_show.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_show.py new file mode 100644 index 00000000000..d52c4f1404f --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_show.py @@ -0,0 +1,315 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization hostpool show", +) +class Show(AAZCommand): + """Show a host pool. + + :example: Show host pool + az desktopvirtualization hostpool show -g rg -n hostpool-name + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/hostpools/{}", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the host pool within the specified resource group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HostPoolsGet(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 HostPoolsGet(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.DesktopVirtualization/hostPools/{hostPoolName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "hostPoolName", self.ctx.args.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", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.kind = AAZStrType() + _schema_on_200.location = AAZStrType() + _schema_on_200.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + flags={"read_only": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.custom_rdp_property = AAZStrType( + serialized_name="customRdpProperty", + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_type = AAZStrType( + serialized_name="hostPoolType", + flags={"required": True}, + ) + properties.load_balancer_type = AAZStrType( + serialized_name="loadBalancerType", + flags={"required": True}, + ) + properties.max_session_limit = AAZIntType( + serialized_name="maxSessionLimit", + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.personal_desktop_assignment_type = AAZStrType( + serialized_name="personalDesktopAssignmentType", + ) + properties.preferred_app_group_type = AAZStrType( + serialized_name="preferredAppGroupType", + flags={"required": True}, + ) + properties.registration_info = AAZObjectType( + serialized_name="registrationInfo", + ) + properties.ring = AAZIntType() + properties.sso_client_id = AAZStrType( + serialized_name="ssoClientId", + ) + properties.sso_client_secret_key_vault_path = AAZStrType( + serialized_name="ssoClientSecretKeyVaultPath", + ) + properties.sso_secret_type = AAZStrType( + serialized_name="ssoSecretType", + ) + properties.ssoadfs_authority = AAZStrType( + serialized_name="ssoadfsAuthority", + ) + properties.start_vm_on_connect = AAZBoolType( + serialized_name="startVMOnConnect", + ) + properties.validation_environment = AAZBoolType( + serialized_name="validationEnvironment", + ) + properties.vm_template = AAZStrType( + serialized_name="vmTemplate", + ) + + application_group_references = cls._schema_on_200.properties.application_group_references + application_group_references.Element = AAZStrType() + + migration_request = cls._schema_on_200.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + registration_info = cls._schema_on_200.properties.registration_info + registration_info.expiration_time = AAZStrType( + serialized_name="expirationTime", + ) + registration_info.registration_token_operation = AAZStrType( + serialized_name="registrationTokenOperation", + ) + registration_info.token = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_update.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_update.py new file mode 100644 index 00000000000..362f3913b27 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/hostpool/_update.py @@ -0,0 +1,627 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization hostpool update", +) +class Update(AAZCommand): + """Update a host pool. + + :example: Update host pool + az desktopvirtualization hostpool update -g rg -n hostpool-name --tags tag=test + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/hostpools/{}", "2021-07-12"], + ] + } + + 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.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the host pool within the specified resource group", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.custom_rdp_property = AAZStrArg( + options=["--custom-rdp-property"], + help="Custom rdp property of host pool.", + nullable=True, + ) + _args_schema.description = AAZStrArg( + options=["--description"], + help="Description of HostPool.", + nullable=True, + ) + _args_schema.friendly_name = AAZStrArg( + options=["--friendly-name"], + help="Friendly name of HostPool.", + nullable=True, + ) + _args_schema.load_balancer_type = AAZStrArg( + options=["--load-balancer-type"], + help="The type of the load balancer.", + enum={"BreadthFirst": "BreadthFirst", "DepthFirst": "DepthFirst", "Persistent": "Persistent"}, + ) + _args_schema.max_session_limit = AAZIntArg( + options=["--max-session-limit"], + help="The max session limit of HostPool.", + nullable=True, + ) + _args_schema.personal_desktop_assignment_type = AAZStrArg( + options=["--personal-desktop-assignment-type"], + help="PersonalDesktopAssignment type for HostPool.", + nullable=True, + enum={"Automatic": "Automatic", "Direct": "Direct"}, + ) + _args_schema.preferred_app_group_type = AAZStrArg( + options=["-t", "--preferred-app-group-type"], + help="The type of preferred application group type, default to desktop application group", + enum={"Desktop": "Desktop", "None": "None", "RailApplications": "RailApplications"}, + ) + _args_schema.registration_info = AAZObjectArg( + options=["--registration-info"], + help="The registration info of HostPool.", + nullable=True, + ) + _args_schema.ring = AAZIntArg( + options=["--ring"], + help="The ring number of HostPool.", + nullable=True, + ) + _args_schema.sso_client_id = AAZStrArg( + options=["--sso-client-id"], + help="ClientId for the registered Relying Party used to issue WVD SSO certificates.", + nullable=True, + ) + _args_schema.sso_client_secret_key_vault_path = AAZStrArg( + options=["-p", "--sso-client-secret-key-vault-path"], + help="Path to Azure KeyVault storing the secret used for communication to ADFS.", + nullable=True, + ) + _args_schema.sso_secret_type = AAZStrArg( + options=["--sso-secret-type"], + help="The type of single sign on Secret Type.", + nullable=True, + enum={"Certificate": "Certificate", "CertificateInKeyVault": "CertificateInKeyVault", "SharedKey": "SharedKey", "SharedKeyInKeyVault": "SharedKeyInKeyVault"}, + ) + _args_schema.ssoadfs_authority = AAZStrArg( + options=["--ssoadfs-authority"], + help="URL to customer ADFS server for signing WVD SSO certificates.", + nullable=True, + ) + _args_schema.start_vm_on_connect = AAZBoolArg( + options=["--start-vm-on-connect"], + help="The flag to turn on/off StartVMOnConnect feature.", + nullable=True, + ) + _args_schema.validation_environment = AAZBoolArg( + options=["--validation-environment"], + help="Is validation environment.", + nullable=True, + ) + _args_schema.vm_template = AAZStrArg( + options=["--vm-template"], + help="VM template for sessionhosts configuration within hostpool.", + nullable=True, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Resource tags.", + nullable=True, + ) + + registration_info = cls._args_schema.registration_info + registration_info.expiration_time = AAZDateTimeArg( + options=["expiration-time"], + help="Expiration time of registration token.", + nullable=True, + ) + registration_info.registration_token_operation = AAZStrArg( + options=["registration-token-operation"], + help="The type of resetting the token.", + nullable=True, + enum={"Delete": "Delete", "None": "None", "Update": "Update"}, + ) + registration_info.token = AAZStrArg( + options=["token"], + help="The registration token base64 encoded string.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "HostPool" + + # define Arg Group "Properties" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HostPoolsGet(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.HostPoolsCreateOrUpdate(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 HostPoolsGet(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.DesktopVirtualization/hostPools/{hostPoolName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "hostPoolName", self.ctx.args.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", "2021-07-12", + 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_host_pool_read(cls._schema_on_200) + + return cls._schema_on_200 + + class HostPoolsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "hostPoolName", self.ctx.args.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", "2021-07-12", + 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_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() + _UpdateHelper._build_schema_host_pool_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + 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": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("customRdpProperty", AAZStrType, ".custom_rdp_property") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("friendlyName", AAZStrType, ".friendly_name") + properties.set_prop("loadBalancerType", AAZStrType, ".load_balancer_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("maxSessionLimit", AAZIntType, ".max_session_limit") + properties.set_prop("personalDesktopAssignmentType", AAZStrType, ".personal_desktop_assignment_type") + properties.set_prop("preferredAppGroupType", AAZStrType, ".preferred_app_group_type", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("registrationInfo", AAZObjectType, ".registration_info") + properties.set_prop("ring", AAZIntType, ".ring") + properties.set_prop("ssoClientId", AAZStrType, ".sso_client_id") + properties.set_prop("ssoClientSecretKeyVaultPath", AAZStrType, ".sso_client_secret_key_vault_path") + properties.set_prop("ssoSecretType", AAZStrType, ".sso_secret_type") + properties.set_prop("ssoadfsAuthority", AAZStrType, ".ssoadfs_authority") + properties.set_prop("startVMOnConnect", AAZBoolType, ".start_vm_on_connect") + properties.set_prop("validationEnvironment", AAZBoolType, ".validation_environment") + properties.set_prop("vmTemplate", AAZStrType, ".vm_template") + + registration_info = _builder.get(".properties.registrationInfo") + if registration_info is not None: + registration_info.set_prop("expirationTime", AAZStrType, ".expiration_time") + registration_info.set_prop("registrationTokenOperation", AAZStrType, ".registration_token_operation") + registration_info.set_prop("token", AAZStrType, ".token") + + 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_host_pool_read = None + + @classmethod + def _build_schema_host_pool_read(cls, _schema): + if cls._schema_host_pool_read is not None: + _schema.etag = cls._schema_host_pool_read.etag + _schema.id = cls._schema_host_pool_read.id + _schema.identity = cls._schema_host_pool_read.identity + _schema.kind = cls._schema_host_pool_read.kind + _schema.location = cls._schema_host_pool_read.location + _schema.managed_by = cls._schema_host_pool_read.managed_by + _schema.name = cls._schema_host_pool_read.name + _schema.plan = cls._schema_host_pool_read.plan + _schema.properties = cls._schema_host_pool_read.properties + _schema.sku = cls._schema_host_pool_read.sku + _schema.tags = cls._schema_host_pool_read.tags + _schema.type = cls._schema_host_pool_read.type + return + + cls._schema_host_pool_read = _schema_host_pool_read = AAZObjectType() + + host_pool_read = _schema_host_pool_read + host_pool_read.etag = AAZStrType( + flags={"read_only": True}, + ) + host_pool_read.id = AAZStrType( + flags={"read_only": True}, + ) + host_pool_read.identity = AAZObjectType() + host_pool_read.kind = AAZStrType() + host_pool_read.location = AAZStrType() + host_pool_read.managed_by = AAZStrType( + serialized_name="managedBy", + ) + host_pool_read.name = AAZStrType( + flags={"read_only": True}, + ) + host_pool_read.plan = AAZObjectType() + host_pool_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + host_pool_read.sku = AAZObjectType() + host_pool_read.tags = AAZDictType() + host_pool_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_host_pool_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() + + plan = _schema_host_pool_read.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = _schema_host_pool_read.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + flags={"read_only": True}, + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.custom_rdp_property = AAZStrType( + serialized_name="customRdpProperty", + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.host_pool_type = AAZStrType( + serialized_name="hostPoolType", + flags={"required": True}, + ) + properties.load_balancer_type = AAZStrType( + serialized_name="loadBalancerType", + flags={"required": True}, + ) + properties.max_session_limit = AAZIntType( + serialized_name="maxSessionLimit", + ) + properties.migration_request = AAZObjectType( + serialized_name="migrationRequest", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + properties.personal_desktop_assignment_type = AAZStrType( + serialized_name="personalDesktopAssignmentType", + ) + properties.preferred_app_group_type = AAZStrType( + serialized_name="preferredAppGroupType", + flags={"required": True}, + ) + properties.registration_info = AAZObjectType( + serialized_name="registrationInfo", + ) + properties.ring = AAZIntType() + properties.sso_client_id = AAZStrType( + serialized_name="ssoClientId", + ) + properties.sso_client_secret_key_vault_path = AAZStrType( + serialized_name="ssoClientSecretKeyVaultPath", + ) + properties.sso_secret_type = AAZStrType( + serialized_name="ssoSecretType", + ) + properties.ssoadfs_authority = AAZStrType( + serialized_name="ssoadfsAuthority", + ) + properties.start_vm_on_connect = AAZBoolType( + serialized_name="startVMOnConnect", + ) + properties.validation_environment = AAZBoolType( + serialized_name="validationEnvironment", + ) + properties.vm_template = AAZStrType( + serialized_name="vmTemplate", + ) + + application_group_references = _schema_host_pool_read.properties.application_group_references + application_group_references.Element = AAZStrType() + + migration_request = _schema_host_pool_read.properties.migration_request + migration_request.migration_path = AAZStrType( + serialized_name="migrationPath", + ) + migration_request.operation = AAZStrType() + + registration_info = _schema_host_pool_read.properties.registration_info + registration_info.expiration_time = AAZStrType( + serialized_name="expirationTime", + ) + registration_info.registration_token_operation = AAZStrType( + serialized_name="registrationTokenOperation", + ) + registration_info.token = AAZStrType() + + sku = _schema_host_pool_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_host_pool_read.tags + tags.Element = AAZStrType() + + _schema.etag = cls._schema_host_pool_read.etag + _schema.id = cls._schema_host_pool_read.id + _schema.identity = cls._schema_host_pool_read.identity + _schema.kind = cls._schema_host_pool_read.kind + _schema.location = cls._schema_host_pool_read.location + _schema.managed_by = cls._schema_host_pool_read.managed_by + _schema.name = cls._schema_host_pool_read.name + _schema.plan = cls._schema_host_pool_read.plan + _schema.properties = cls._schema_host_pool_read.properties + _schema.sku = cls._schema_host_pool_read.sku + _schema.tags = cls._schema_host_pool_read.tags + _schema.type = cls._schema_host_pool_read.type + + +__all__ = ["Update"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__cmd_group.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__cmd_group.py new file mode 100644 index 00000000000..66d2317a7e6 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__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( + "desktopvirtualization workspace", +) +class __CMDGroup(AAZCommandGroup): + """Manage desktop virtualization workspace. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/__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 ._update import * diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_create.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_create.py new file mode 100644 index 00000000000..3f6fb346505 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_create.py @@ -0,0 +1,309 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization workspace create", +) +class Create(AAZCommand): + """Create a workspace. + + :example: Create workspace + az desktopvirtualization workspace create -g rg -n workspace-name --friendly-name friendly + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/workspaces/{}", "2021-07-12"], + ] + } + + 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.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the workspace", + required=True, + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.location = AAZResourceLocationArg( + help="The geo-location where the resource lives", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.application_group_references = AAZListArg( + options=["--application-group-references"], + help="List of application group resource Ids.", + ) + _args_schema.description = AAZStrArg( + options=["--description"], + help="Description of Workspace.", + ) + _args_schema.friendly_name = AAZStrArg( + options=["--friendly-name"], + help="Friendly name of Workspace.", + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Resource tags.", + ) + + application_group_references = cls._args_schema.application_group_references + application_group_references.Element = AAZStrArg() + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Workspace" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.WorkspacesCreateOrUpdate(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 WorkspacesCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + **self.serialize_url_param( + "workspaceName", self.ctx.args.name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-07-12", + 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("location", AAZStrType, ".location") + _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("applicationGroupReferences", AAZListType, ".application_group_references") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("friendlyName", AAZStrType, ".friendly_name") + + application_group_references = _builder.get(".properties.applicationGroupReferences") + if application_group_references is not None: + application_group_references.set_elements(AAZStrType, ".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _schema_on_200_201.kind = AAZStrType() + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.plan = AAZObjectType() + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200_201.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() + + plan = cls._schema_on_200_201.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200_201.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + + application_group_references = cls._schema_on_200_201.properties.application_group_references + application_group_references.Element = AAZStrType() + + sku = cls._schema_on_200_201.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_delete.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_delete.py new file mode 100644 index 00000000000..d8ac4eeb6e8 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_delete.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization workspace delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a workspace. + + :example: Delete workspace + az desktopvirtualization workspace delete -g rg -n workspace-name + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/workspaces/{}", "2021-07-12"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return 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.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the workspace", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.WorkspacesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class WorkspacesDelete(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) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + **self.serialize_url_param( + "workspaceName", self.ctx.args.name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-07-12", + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_list.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_list.py new file mode 100644 index 00000000000..fca321182e8 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_list.py @@ -0,0 +1,420 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization workspace list", +) +class List(AAZCommand): + """List workspaces. + + :example: List workspaces + az desktopvirtualization workspace list -g rg + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.desktopvirtualization/workspaces", "2021-07-12"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/workspaces", "2021-07-12"], + ] + } + + 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.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + if condition_0: + self.WorkspacesListBySubscription(ctx=self.ctx)() + if condition_1: + self.WorkspacesListByResourceGroup(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 WorkspacesListBySubscription(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.DesktopVirtualization/workspaces", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.kind = AAZStrType() + _element.location = AAZStrType() + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.value.Element.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + + application_group_references = cls._schema_on_200.value.Element.properties.application_group_references + application_group_references.Element = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class WorkspacesListByResourceGroup(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.DesktopVirtualization/workspaces", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.kind = AAZStrType() + _element.location = AAZStrType() + _element.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.value.Element.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + + application_group_references = cls._schema_on_200.value.Element.properties.application_group_references + application_group_references.Element = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_show.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_show.py new file mode 100644 index 00000000000..6306ab5fdd2 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_show.py @@ -0,0 +1,250 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization workspace show", +) +class Show(AAZCommand): + """Show a workspace. + + :example: Show workspace + az desktopvirtualization workspace show -g rg -n workspace-name + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/workspaces/{}", "2021-07-12"], + ] + } + + 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.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the workspace", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.WorkspacesGet(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 WorkspacesGet(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.DesktopVirtualization/workspaces/{workspaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + **self.serialize_url_param( + "workspaceName", self.ctx.args.name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-07-12", + 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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.kind = AAZStrType() + _schema_on_200.location = AAZStrType() + _schema_on_200.managed_by = AAZStrType( + serialized_name="managedBy", + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _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() + + plan = cls._schema_on_200.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = cls._schema_on_200.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + + application_group_references = cls._schema_on_200.properties.application_group_references + application_group_references.Element = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + 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/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_update.py b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_update.py new file mode 100644 index 00000000000..d335dd5dbdf --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/aaz/latest/desktopvirtualization/workspace/_update.py @@ -0,0 +1,465 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "desktopvirtualization workspace update", +) +class Update(AAZCommand): + """Update a workspace. + + :example: Update workspace + az desktopvirtualization workspace update -g rg -n workspace-name --tags tag=test + """ + + _aaz_info = { + "version": "2021-07-12", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.desktopvirtualization/workspaces/{}", "2021-07-12"], + ] + } + + 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.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the workspace", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + max_length=64, + min_length=3, + ), + ) + _args_schema.application_group_references = AAZListArg( + options=["--application-group-references"], + help="List of application group resource Ids.", + nullable=True, + ) + _args_schema.description = AAZStrArg( + options=["--description"], + help="Description of Workspace.", + nullable=True, + ) + _args_schema.friendly_name = AAZStrArg( + options=["--friendly-name"], + help="Friendly name of Workspace.", + nullable=True, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Resource tags.", + nullable=True, + ) + + application_group_references = cls._args_schema.application_group_references + application_group_references.Element = AAZStrArg( + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Workspace" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.WorkspacesGet(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.WorkspacesCreateOrUpdate(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 WorkspacesGet(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.DesktopVirtualization/workspaces/{workspaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + **self.serialize_url_param( + "workspaceName", self.ctx.args.name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-07-12", + 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_workspace_read(cls._schema_on_200) + + return cls._schema_on_200 + + class WorkspacesCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + **self.serialize_url_param( + "workspaceName", self.ctx.args.name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-07-12", + 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_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() + _UpdateHelper._build_schema_workspace_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + 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("applicationGroupReferences", AAZListType, ".application_group_references") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("friendlyName", AAZStrType, ".friendly_name") + + application_group_references = _builder.get(".properties.applicationGroupReferences") + if application_group_references is not None: + application_group_references.set_elements(AAZStrType, ".") + + 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_workspace_read = None + + @classmethod + def _build_schema_workspace_read(cls, _schema): + if cls._schema_workspace_read is not None: + _schema.etag = cls._schema_workspace_read.etag + _schema.id = cls._schema_workspace_read.id + _schema.identity = cls._schema_workspace_read.identity + _schema.kind = cls._schema_workspace_read.kind + _schema.location = cls._schema_workspace_read.location + _schema.managed_by = cls._schema_workspace_read.managed_by + _schema.name = cls._schema_workspace_read.name + _schema.plan = cls._schema_workspace_read.plan + _schema.properties = cls._schema_workspace_read.properties + _schema.sku = cls._schema_workspace_read.sku + _schema.tags = cls._schema_workspace_read.tags + _schema.type = cls._schema_workspace_read.type + return + + cls._schema_workspace_read = _schema_workspace_read = AAZObjectType() + + workspace_read = _schema_workspace_read + workspace_read.etag = AAZStrType( + flags={"read_only": True}, + ) + workspace_read.id = AAZStrType( + flags={"read_only": True}, + ) + workspace_read.identity = AAZObjectType() + workspace_read.kind = AAZStrType() + workspace_read.location = AAZStrType() + workspace_read.managed_by = AAZStrType( + serialized_name="managedBy", + ) + workspace_read.name = AAZStrType( + flags={"read_only": True}, + ) + workspace_read.plan = AAZObjectType() + workspace_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + workspace_read.sku = AAZObjectType() + workspace_read.tags = AAZDictType() + workspace_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_workspace_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() + + plan = _schema_workspace_read.plan + plan.name = AAZStrType( + flags={"required": True}, + ) + plan.product = AAZStrType( + flags={"required": True}, + ) + plan.promotion_code = AAZStrType( + serialized_name="promotionCode", + ) + plan.publisher = AAZStrType( + flags={"required": True}, + ) + plan.version = AAZStrType() + + properties = _schema_workspace_read.properties + properties.application_group_references = AAZListType( + serialized_name="applicationGroupReferences", + ) + properties.cloud_pc_resource = AAZBoolType( + serialized_name="cloudPcResource", + flags={"read_only": True}, + ) + properties.description = AAZStrType() + properties.friendly_name = AAZStrType( + serialized_name="friendlyName", + ) + properties.object_id = AAZStrType( + serialized_name="objectId", + flags={"read_only": True}, + ) + + application_group_references = _schema_workspace_read.properties.application_group_references + application_group_references.Element = AAZStrType() + + sku = _schema_workspace_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_workspace_read.tags + tags.Element = AAZStrType() + + _schema.etag = cls._schema_workspace_read.etag + _schema.id = cls._schema_workspace_read.id + _schema.identity = cls._schema_workspace_read.identity + _schema.kind = cls._schema_workspace_read.kind + _schema.location = cls._schema_workspace_read.location + _schema.managed_by = cls._schema_workspace_read.managed_by + _schema.name = cls._schema_workspace_read.name + _schema.plan = cls._schema_workspace_read.plan + _schema.properties = cls._schema_workspace_read.properties + _schema.sku = cls._schema_workspace_read.sku + _schema.tags = cls._schema_workspace_read.tags + _schema.type = cls._schema_workspace_read.type + + +__all__ = ["Update"] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/action.py b/src/desktopvirtualization/azext_desktopvirtualization/action.py deleted file mode 100644 index 9b3d0a8a78c..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/action.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. -# -------------------------------------------------------------------------- -# pylint: disable=wildcard-import -# pylint: disable=unused-wildcard-import - -from .generated.action import * # noqa: F403 -try: - from .manual.action import * # noqa: F403 -except ImportError as e: - if e.name.endswith('manual.action'): - pass - else: - raise e diff --git a/src/desktopvirtualization/azext_desktopvirtualization/azext_metadata.json b/src/desktopvirtualization/azext_desktopvirtualization/azext_metadata.json index 3695b0d7077..a3b0ca7605e 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/azext_metadata.json +++ b/src/desktopvirtualization/azext_desktopvirtualization/azext_metadata.json @@ -1,3 +1,3 @@ { - "azext.minCliCoreVersion": "2.15.0" + "azext.minCliCoreVersion": "2.55.0" } \ No newline at end of file diff --git a/src/desktopvirtualization/azext_desktopvirtualization/commands.py b/src/desktopvirtualization/azext_desktopvirtualization/commands.py new file mode 100644 index 00000000000..b0d842e4993 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/commands.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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 + pass diff --git a/src/desktopvirtualization/azext_desktopvirtualization/custom.py b/src/desktopvirtualization/azext_desktopvirtualization/custom.py index 885447229d6..86df1e48ef5 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/custom.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/custom.py @@ -1,20 +1,14 @@ -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # 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 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 +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- -from .generated.custom import * # noqa: F403 -try: - from .manual.custom import * # noqa: F403 -except ImportError as e: - if e.name.endswith('manual.custom'): - pass - else: - raise e +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/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/desktopvirtualization/azext_desktopvirtualization/generated/_client_factory.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/_client_factory.py deleted file mode 100644 index 5cff18afe4f..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/_client_factory.py +++ /dev/null @@ -1,27 +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_desktopvirtualization_cl(cli_ctx, *_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from ..vendored_sdks.desktopvirtualization import DesktopVirtualizationAPIClient - return get_mgmt_service_client(cli_ctx, DesktopVirtualizationAPIClient) - - -def cf_workspace(cli_ctx, *_): - return cf_desktopvirtualization_cl(cli_ctx).workspaces - - -def cf_application_group(cli_ctx, *_): - return cf_desktopvirtualization_cl(cli_ctx).application_groups - - -def cf_host_pool(cli_ctx, *_): - return cf_desktopvirtualization_cl(cli_ctx).host_pools diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/_help.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/_help.py deleted file mode 100644 index 9ce5f6c5839..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/_help.py +++ /dev/null @@ -1,222 +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['desktopvirtualization'] = ''' - type: group - short-summary: Manage Desktop Virtualization -''' - -helps['desktopvirtualization workspace'] = """ - type: group - short-summary: desktopvirtualization workspace -""" - -helps['desktopvirtualization workspace list'] = """ - type: command - short-summary: List workspaces in subscription. - examples: - - name: Workspace_ListByResourceGroup - text: |- - az desktopvirtualization workspace list --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization workspace show'] = """ - type: command - short-summary: Get a workspace. - examples: - - name: Workspace_Get - text: |- - az desktopvirtualization workspace show --resource-group "MyResourceGroup" --name "MyWorkspace" -""" - -helps['desktopvirtualization workspace create'] = """ - type: command - short-summary: Create a workspace. - examples: - - name: Workspace_Create - text: |- - az desktopvirtualization workspace create --resource-group "MyResourceGroup" --location "centralus" \ ---description "des1" --friendly-name "friendly" --tags tag1="value1" tag2="value2" --name "MyWorkspace" -""" - -helps['desktopvirtualization workspace update'] = """ - type: command - short-summary: Update a workspace. - examples: - - name: Workspace_Update - text: |- - az desktopvirtualization workspace update --resource-group "MyResourceGroup" --description "des1" \ ---friendly-name "friendly" --tags tag1="value1" tag2="value2" --name "MyWorkspace" -""" - -helps['desktopvirtualization workspace delete'] = """ - type: command - short-summary: Remove a workspace. - examples: - - name: Workspace_Delete - text: |- - az desktopvirtualization workspace delete --resource-group "MyResourceGroup" --name "MyWorkspace" -""" - -helps['desktopvirtualization applicationgroup'] = """ - type: group - short-summary: desktopvirtualization applicationgroup -""" - -helps['desktopvirtualization applicationgroup list'] = """ - type: command - short-summary: List applicationGroups in subscription. - examples: - - name: ApplicationGroup_ListByResourceGroup - text: |- - az desktopvirtualization applicationgroup list --filter "applicationGroupType eq \'RailApplication\'" \ ---resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization applicationgroup show'] = """ - type: command - short-summary: Get an application group. - examples: - - name: ApplicationGroup_Get - text: |- - az desktopvirtualization applicationgroup show --name "MyApplicationGroup" --resource-group \ -"MyResourceGroup" -""" - -helps['desktopvirtualization applicationgroup create'] = """ - type: command - short-summary: Create an applicationGroup. - examples: - - name: ApplicationGroup_Create - text: |- - az desktopvirtualization applicationgroup create --location "centralus" --description "des1" \ ---application-group-type "RemoteApp" --friendly-name "friendly" --host-pool-arm-path "/subscriptions/daefabc0-95b4-48b3\ --b645-8a753a63c4fa/resourceGroups/MyResourceGroup/providers/Microsoft.DesktopVirtualization/hostPools/MyHostPool" \ ---tags tag1="value1" tag2="value2" --name "MyApplicationGroup" --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization applicationgroup update'] = """ - type: command - short-summary: Update an applicationGroup. - examples: - - name: ApplicationGroups_Update - text: |- - az desktopvirtualization applicationgroup update --description "des1" --friendly-name "friendly" --tags \ -tag1="value1" tag2="value2" --name "MyApplicationGroup" --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization applicationgroup delete'] = """ - type: command - short-summary: Remove an applicationGroup. - examples: - - name: ApplicationGroup_Delete - text: |- - az desktopvirtualization applicationgroup delete --name "MyApplicationGroup" --resource-group \ -"MyResourceGroup" -""" - -helps['desktopvirtualization hostpool'] = """ - type: group - short-summary: desktopvirtualization hostpool -""" - -helps['desktopvirtualization hostpool list'] = """ - type: command - short-summary: List hostPools in subscription. - examples: - - name: HostPool_ListByResourceGroup - text: |- - az desktopvirtualization hostpool list --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization hostpool show'] = """ - type: command - short-summary: Get a host pool. - examples: - - name: HostPool_Get - text: |- - az desktopvirtualization hostpool show --name "MyHostPool" --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization hostpool create'] = """ - type: command - short-summary: Create a host pool. - parameters: - - name: --registration-info - short-summary: The registration info of HostPool. - long-summary: | - Usage: --registration-info expiration-time=XX token=XX registration-token-operation=XX - - expiration-time: Expiration time of registration token. - token: The registration token base64 encoded string. - registration-token-operation: The type of resetting the token. - - name: --host-pool-type - short-summary: HostPool type for desktop. - long-summary: | - Personal: Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType = Direct) or upon connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to their assigned SessionHost. - Pooled: Users get a new (random) SessionHost every time it connects to the HostPool. - BYODesktop: Users assign their own machines, load balancing logic remains the same as Personal. --personal-desktop-ssignment-type must be Direct. - examples: - - name: HostPool_Create - text: |- - az desktopvirtualization hostpool create --location "centralus" --description "des1" --friendly-name \ -"friendly" --host-pool-type "Pooled" --load-balancer-type "BreadthFirst" --max-session-limit 999999 \ ---personal-desktop-assignment-type "Automatic" --preferred-app-group-type "Desktop" \ ---registration-info expiration-time="2020-10-01T14:01:54.9571247Z" registration-token-operation="Update" \ ---sso-client-id "client" --sso-client-secret-key-vault-path "https://keyvault/secret" --sso-secret-type "SharedKey" \ ---ssoadfs-authority "https://adfs" --start-vm-on-connect false --vm-template "{json:json}" --tags tag1="value1" \ -tag2="value2" --name "MyHostPool" --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization hostpool update'] = """ - type: command - short-summary: Update a host pool. - parameters: - - name: --registration-info - short-summary: The registration info of HostPool. - long-summary: | - Usage: --registration-info expiration-time=XX registration-token-operation=XX - - expiration-time: Expiration time of registration token. - registration-token-operation: The type of resetting the token. - examples: - - name: HostPool_Update - text: |- - az desktopvirtualization hostpool update --description "des1" --friendly-name "friendly" \ ---load-balancer-type "BreadthFirst" --max-session-limit 999999 --personal-desktop-assignment-type "Automatic" \ ---registration-info expiration-time="2020-10-01T15:01:54.9571247Z" registration-token-operation="Update" \ ---sso-client-id "client" --sso-client-secret-key-vault-path "https://keyvault/secret" --sso-secret-type "SharedKey" \ ---ssoadfs-authority "https://adfs" --start-vm-on-connect false --vm-template "{json:json}" --tags tag1="value1" \ -tag2="value2" --name "MyHostPool" --resource-group "MyResourceGroup" -""" - -helps['desktopvirtualization hostpool delete'] = """ - type: command - short-summary: Remove a host pool. - examples: - - name: HostPool_Delete - text: |- - az desktopvirtualization hostpool delete --force true --name "MyHostPool" --resource-group \ -"MyResourceGroup" -""" - -helps['desktopvirtualization hostpool retrieve-registration-token'] = """ - type: command - short-summary: Registration token of the host pool. - examples: - - name: HostPools_RetrieveRegistrationToken_Post - text: |- - az desktopvirtualization hostpool retrieve-registration-token --name "MyHostPool" --resource-group \ -"MyResourceGroup" -""" diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/_params.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/_params.py deleted file mode 100644 index 3555695ba32..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/_params.py +++ /dev/null @@ -1,181 +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, - get_enum_type, - resource_group_name_type, - get_location_type -) -from azure.cli.core.commands.validators import get_default_location_from_resource_group -from azext_desktopvirtualization.action import ( - AddDesktopvirtualizationHostpoolCreateRegistrationInfo, - AddDesktopvirtualizationHostpoolUpdateRegistrationInfo -) - - -def load_arguments(self, _): - - with self.argument_context('desktopvirtualization workspace list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('desktopvirtualization workspace show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('workspace_name', options_list=['--name', '-n'], - help='The name of the workspace', id_part='name') - - with self.argument_context('desktopvirtualization workspace create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('workspace_name', options_list=['--name', '-n'], - help='The name of the workspace') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('description', help='Description of Workspace.') - c.argument('friendly_name', help='Friendly name of Workspace.') - c.argument('application_group_references', nargs='+', help='List of applicationGroup resource Ids.') - - with self.argument_context('desktopvirtualization workspace update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('workspace_name', options_list=['--name', '-n'], - help='The name of the workspace', id_part='name') - c.argument('tags', tags_type) - c.argument('description', help='Description of Workspace.') - c.argument('friendly_name', help='Friendly name of Workspace.') - c.argument('application_group_references', nargs='+', help='List of applicationGroup links.') - - with self.argument_context('desktopvirtualization workspace delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('workspace_name', options_list=['--name', '-n'], - help='The name of the workspace', id_part='name') - - with self.argument_context('desktopvirtualization applicationgroup list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('filter', help='OData filter expression. Valid properties for filtering are applicationGroupType.') - - with self.argument_context('desktopvirtualization applicationgroup show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('application_group_name', options_list=['--name', '-n'], - help='The name of the application group', id_part='name') - - with self.argument_context('desktopvirtualization applicationgroup create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('application_group_name', options_list=['--name', '-n'], help='The name of the application group') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('description', help='Description of ApplicationGroup.') - c.argument('friendly_name', help='Friendly name of ApplicationGroup.') - c.argument('host_pool_arm_path', help='HostPool arm path of ApplicationGroup.') - c.argument('application_group_type', arg_type=get_enum_type(['RemoteApp', 'Desktop']), - help='Resource Type of ApplicationGroup.') - - with self.argument_context('desktopvirtualization applicationgroup update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('application_group_name', options_list=['--name', '-n'], - help='The name of the application group', id_part='name') - c.argument('tags', tags_type) - c.argument('description', help='Description of ApplicationGroup.') - c.argument('friendly_name', help='Friendly name of ApplicationGroup.') - - with self.argument_context('desktopvirtualization applicationgroup delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('application_group_name', options_list=['--name', '-n'], - help='The name of the application group', id_part='name') - - with self.argument_context('desktopvirtualization hostpool list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('desktopvirtualization hostpool show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('host_pool_name', options_list=['--name', '-n'], - help='The name of the host pool within the specified resource group', id_part='name') - - with self.argument_context('desktopvirtualization hostpool create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('host_pool_name', options_list=['--name', '-n'], - help='The name of the host pool within the specified resource group') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('friendly_name', help='Friendly name of HostPool.') - c.argument('description', help='Description of HostPool.') - c.argument('host_pool_type', arg_type=get_enum_type(['Personal', 'Pooled', 'BYODesktop']), - help='HostPool type for desktop.') - c.argument('personal_desktop_assignment_type', arg_type=get_enum_type(['Automatic', 'Direct']), - help='PersonalDesktopAssignment type for HostPool.') - c.argument('custom_rdp_property', help='Custom rdp property of HostPool.') - c.argument('max_session_limit', type=int, help='The max session limit of HostPool.') - c.argument('load_balancer_type', arg_type=get_enum_type(['BreadthFirst', 'DepthFirst', 'Persistent']), - help='The type of the load balancer.') - c.argument('ring', type=int, help='The ring number of HostPool.') - c.argument('validation_environment', arg_type=get_three_state_flag(), help='Is validation environment.') - c.argument('registration_info', action=AddDesktopvirtualizationHostpoolCreateRegistrationInfo, nargs='+', - help='The registration info of HostPool.') - c.argument('vm_template', help='VM template for sessionhosts configuration within hostpool.') - c.argument('ssoadfs_authority', help='URL to customer ADFS server for signing WVD SSO certificates.') - c.argument('sso_client_id', - help='ClientId for the registered Relying Party used to issue WVD SSO certificates.') - c.argument('sso_client_secret_key_vault_path', options_list=['--sso-client-secret-key-vault-path', '-p'], - help='Path to Azure KeyVault storing the secret used for communication to ADFS.') - c.argument('sso_secret_type', - arg_type=get_enum_type(['SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault']), - help='The type of single sign on Secret Type.') - c.argument('preferred_app_group_type', options_list=['--preferred-app-group-type', '-t'], - arg_type=get_enum_type(['None', 'Desktop', 'RailApplications']), - help='The type of preferred application group type, default to Desktop Application Group') - c.argument('start_vm_on_connect', arg_type=get_three_state_flag(), - help='The flag to turn on/off StartVMOnConnect feature.') - - with self.argument_context('desktopvirtualization hostpool update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('host_pool_name', options_list=['--name', '-n'], - help='The name of the host pool within the specified resource group', id_part='name') - c.argument('tags', tags_type) - c.argument('friendly_name', help='Friendly name of HostPool.') - c.argument('description', help='Description of HostPool.') - c.argument('custom_rdp_property', help='Custom rdp property of HostPool.') - c.argument('max_session_limit', type=int, help='The max session limit of HostPool.') - c.argument('personal_desktop_assignment_type', arg_type=get_enum_type(['Automatic', 'Direct']), - help='PersonalDesktopAssignment type for HostPool.') - c.argument('load_balancer_type', arg_type=get_enum_type(['BreadthFirst', 'DepthFirst', 'Persistent']), - help='The type of the load balancer.') - c.argument('ring', type=int, help='The ring number of HostPool.') - c.argument('validation_environment', arg_type=get_three_state_flag(), help='Is validation environment.') - c.argument('registration_info', action=AddDesktopvirtualizationHostpoolUpdateRegistrationInfo, nargs='+', - help='The registration info of HostPool.') - c.argument('vm_template', help='VM template for sessionhosts configuration within hostpool.') - c.argument('ssoadfs_authority', help='URL to customer ADFS server for signing WVD SSO certificates.') - c.argument('sso_client_id', - help='ClientId for the registered Relying Party used to issue WVD SSO certificates.') - c.argument('sso_client_secret_key_vault_path', options_list=['--sso-client-secret-key-vault-path', '-p'], - help='Path to Azure KeyVault storing the secret used for communication to ADFS.') - c.argument('sso_secret_type', - arg_type=get_enum_type(['SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault']), - help='The type of single sign on Secret Type.') - c.argument('preferred_app_group_type', options_list=['--preferred-app-group-type', '-t'], - arg_type=get_enum_type(['None', 'Desktop', 'RailApplications']), - help='The type of preferred application group type, default to Desktop Application Group') - c.argument('start_vm_on_connect', arg_type=get_three_state_flag(), - help='The flag to turn on/off StartVMOnConnect feature.') - - with self.argument_context('desktopvirtualization hostpool delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('host_pool_name', options_list=['--name', '-n'], - help='The name of the host pool within the specified resource group', id_part='name') - c.argument('force', arg_type=get_three_state_flag(), help='Force flag to delete sessionHost.') - - with self.argument_context('desktopvirtualization hostpool retrieve-registration-token') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('host_pool_name', options_list=['--name', '-n'], - help='The name of the host pool within the specified resource group', id_part='name') diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/action.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/action.py deleted file mode 100644 index 0809997bc6a..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/action.py +++ /dev/null @@ -1,88 +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 - -# pylint: disable=no-self-use - - -import argparse -from collections import defaultdict -from azure.cli.core.azclierror import ArgumentUsageError, InvalidArgumentValueError - - -class AddDesktopvirtualizationHostpoolCreateRegistrationInfo(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.registration_info = 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 ArgumentUsageError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - - if kl == 'expiration-time': - d['expiration_time'] = v[0] - - elif kl == 'token': - d['token'] = v[0] - - elif kl == 'registration-token-operation': - d['registration_token_operation'] = v[0] - - else: - raise InvalidArgumentValueError( - 'Unsupported Key {} is provided for parameter registration-info. All possible keys are:' - ' expiration-time, token, registration-token-operation'.format(k) - ) - - return d - - -class AddDesktopvirtualizationHostpoolUpdateRegistrationInfo(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.registration_info = 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 ArgumentUsageError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - - if kl == 'expiration-time': - d['expiration_time'] = v[0] - - elif kl == 'registration-token-operation': - d['registration_token_operation'] = v[0] - - else: - raise InvalidArgumentValueError( - 'Unsupported Key {} is provided for parameter registration-info. All possible keys are:' - ' expiration-time, registration-token-operation'.format(k) - ) - - return d diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/commands.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/commands.py deleted file mode 100644 index 0c97fa2ca46..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/commands.py +++ /dev/null @@ -1,69 +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 -# pylint: disable=bad-continuation -# pylint: disable=line-too-long - -from azure.cli.core.commands import CliCommandType -from azext_desktopvirtualization.generated._client_factory import ( - cf_workspace, - cf_application_group, - cf_host_pool, -) - - -desktopvirtualization_application_group = CliCommandType( - operations_tmpl='azext_desktopvirtualization.vendored_sdks.desktopvirtualization.operations._application_groups_operations#ApplicationGroupsOperations.{}', - client_factory=cf_application_group, -) - - -desktopvirtualization_host_pool = CliCommandType( - operations_tmpl='azext_desktopvirtualization.vendored_sdks.desktopvirtualization.operations._host_pools_operations#HostPoolsOperations.{}', - client_factory=cf_host_pool, -) - - -desktopvirtualization_workspace = CliCommandType( - operations_tmpl='azext_desktopvirtualization.vendored_sdks.desktopvirtualization.operations._workspaces_operations#WorkspacesOperations.{}', - client_factory=cf_workspace, -) - - -def load_command_table(self, _): - - with self.command_group('desktopvirtualization applicationgroup', desktopvirtualization_application_group, - client_factory=cf_application_group) as g: - g.custom_command('list', 'desktopvirtualization_applicationgroup_list') - g.custom_show_command('show', 'desktopvirtualization_applicationgroup_show') - g.custom_command('create', 'desktopvirtualization_applicationgroup_create') - g.custom_command('update', 'desktopvirtualization_applicationgroup_update') - g.custom_command('delete', 'desktopvirtualization_applicationgroup_delete') - - with self.command_group('desktopvirtualization hostpool', desktopvirtualization_host_pool, - client_factory=cf_host_pool) as g: - g.custom_command('list', 'desktopvirtualization_hostpool_list') - g.custom_show_command('show', 'desktopvirtualization_hostpool_show') - g.custom_command('create', 'desktopvirtualization_hostpool_create') - g.custom_command('update', 'desktopvirtualization_hostpool_update') - g.custom_command('delete', 'desktopvirtualization_hostpool_delete') - g.custom_command('retrieve-registration-token', 'desktopvirtualization_hostpool_retrieve_registration_token') - - with self.command_group('desktopvirtualization workspace', desktopvirtualization_workspace, - client_factory=cf_workspace) as g: - g.custom_command('list', 'desktopvirtualization_workspace_list') - g.custom_show_command('show', 'desktopvirtualization_workspace_show') - g.custom_command('create', 'desktopvirtualization_workspace_create') - g.custom_command('update', 'desktopvirtualization_workspace_update') - g.custom_command('delete', 'desktopvirtualization_workspace_delete') - - with self.command_group('desktopvirtualization'): - pass diff --git a/src/desktopvirtualization/azext_desktopvirtualization/generated/custom.py b/src/desktopvirtualization/azext_desktopvirtualization/generated/custom.py deleted file mode 100644 index 7822e072a64..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/generated/custom.py +++ /dev/null @@ -1,298 +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 - -import json - - -def desktopvirtualization_workspace_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 desktopvirtualization_workspace_show(client, - resource_group_name, - workspace_name): - return client.get(resource_group_name=resource_group_name, - workspace_name=workspace_name) - - -def desktopvirtualization_workspace_create(client, - resource_group_name, - workspace_name, - location=None, - tags=None, - description=None, - friendly_name=None, - application_group_references=None): - workspace = {} - if location is not None: - workspace['location'] = location - if tags is not None: - workspace['tags'] = tags - if description is not None: - workspace['description'] = description - if friendly_name is not None: - workspace['friendly_name'] = friendly_name - if application_group_references is not None: - workspace['application_group_references'] = application_group_references - return client.create_or_update(resource_group_name=resource_group_name, - workspace_name=workspace_name, - workspace=workspace) - - -def desktopvirtualization_workspace_update(client, - resource_group_name, - workspace_name, - tags=None, - description=None, - friendly_name=None, - application_group_references=None): - workspace = {} - if tags is not None: - workspace['tags'] = tags - if description is not None: - workspace['description'] = description - if friendly_name is not None: - workspace['friendly_name'] = friendly_name - if application_group_references is not None: - workspace['application_group_references'] = application_group_references - return client.update(resource_group_name=resource_group_name, - workspace_name=workspace_name, - workspace=workspace) - - -def desktopvirtualization_workspace_delete(client, - resource_group_name, - workspace_name): - return client.delete(resource_group_name=resource_group_name, - workspace_name=workspace_name) - - -def desktopvirtualization_applicationgroup_list(client, - resource_group_name=None, - filter=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name, - filter=filter) - return client.list_by_subscription(filter=filter) - - -def desktopvirtualization_applicationgroup_show(client, - resource_group_name, - application_group_name): - return client.get(resource_group_name=resource_group_name, - application_group_name=application_group_name) - - -def desktopvirtualization_applicationgroup_create(client, - resource_group_name, - application_group_name, - host_pool_arm_path, - application_group_type, - location=None, - tags=None, - description=None, - friendly_name=None): - application_group = {} - if location is not None: - application_group['location'] = location - if tags is not None: - application_group['tags'] = tags - if description is not None: - application_group['description'] = description - if friendly_name is not None: - application_group['friendly_name'] = friendly_name - application_group['host_pool_arm_path'] = host_pool_arm_path - application_group['application_group_type'] = application_group_type - return client.create_or_update(resource_group_name=resource_group_name, - application_group_name=application_group_name, - application_group=application_group) - - -def desktopvirtualization_applicationgroup_update(client, - resource_group_name, - application_group_name, - tags=None, - description=None, - friendly_name=None): - application_group = {} - if tags is not None: - application_group['tags'] = tags - if description is not None: - application_group['description'] = description - if friendly_name is not None: - application_group['friendly_name'] = friendly_name - return client.update(resource_group_name=resource_group_name, - application_group_name=application_group_name, - application_group=application_group) - - -def desktopvirtualization_applicationgroup_delete(client, - resource_group_name, - application_group_name): - return client.delete(resource_group_name=resource_group_name, - application_group_name=application_group_name) - - -def desktopvirtualization_hostpool_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() - - -def desktopvirtualization_hostpool_show(client, - resource_group_name, - host_pool_name): - return client.get(resource_group_name=resource_group_name, - host_pool_name=host_pool_name) - - -def desktopvirtualization_hostpool_create(client, - resource_group_name, - host_pool_name, - host_pool_type, - load_balancer_type, - preferred_app_group_type, - location=None, - tags=None, - friendly_name=None, - description=None, - personal_desktop_assignment_type=None, - custom_rdp_property=None, - max_session_limit=None, - ring=None, - validation_environment=None, - registration_info=None, - vm_template=None, - ssoadfs_authority=None, - sso_client_id=None, - sso_client_secret_key_vault_path=None, - sso_secret_type=None, - start_vm_on_connect=None): - host_pool = { - 'host_pool_type': host_pool_type, - 'load_balancer_type': load_balancer_type, - 'preferred_app_group_type': preferred_app_group_type - } - if location is not None: - host_pool['location'] = location - if tags is not None: - host_pool['tags'] = tags - if friendly_name is not None: - host_pool['friendly_name'] = friendly_name - if description is not None: - host_pool['description'] = description - if personal_desktop_assignment_type is not None: - host_pool['personal_desktop_assignment_type'] = personal_desktop_assignment_type - if custom_rdp_property is not None: - host_pool['custom_rdp_property'] = custom_rdp_property - if max_session_limit is not None: - host_pool['max_session_limit'] = max_session_limit - if ring is not None: - host_pool['ring'] = ring - if validation_environment is not None: - host_pool['validation_environment'] = validation_environment - if registration_info is not None: - host_pool['registration_info'] = registration_info - if vm_template is not None: - host_pool['vm_template'] = vm_template - if ssoadfs_authority is not None: - host_pool['ssoadfs_authority'] = ssoadfs_authority - if sso_client_id is not None: - host_pool['sso_client_id'] = sso_client_id - if sso_client_secret_key_vault_path is not None: - host_pool['sso_client_secret_key_vault_path'] = sso_client_secret_key_vault_path - if sso_secret_type is not None: - host_pool['sso_secret_type'] = sso_secret_type - if start_vm_on_connect is not None: - host_pool['start_vm_on_connect'] = start_vm_on_connect - return client.create_or_update(resource_group_name=resource_group_name, - host_pool_name=host_pool_name, - host_pool=host_pool) - - -def desktopvirtualization_hostpool_update(client, - resource_group_name, - host_pool_name, - tags=None, - friendly_name=None, - description=None, - custom_rdp_property=None, - max_session_limit=None, - personal_desktop_assignment_type=None, - load_balancer_type=None, - ring=None, - validation_environment=None, - registration_info=None, - vm_template=None, - ssoadfs_authority=None, - sso_client_id=None, - sso_client_secret_key_vault_path=None, - sso_secret_type=None, - preferred_app_group_type=None, - start_vm_on_connect=None): - host_pool = {} - if tags is not None: - host_pool['tags'] = tags - if friendly_name is not None: - host_pool['friendly_name'] = friendly_name - if description is not None: - host_pool['description'] = description - if custom_rdp_property is not None: - host_pool['custom_rdp_property'] = custom_rdp_property - if max_session_limit is not None: - host_pool['max_session_limit'] = max_session_limit - if personal_desktop_assignment_type is not None: - host_pool['personal_desktop_assignment_type'] = personal_desktop_assignment_type - if load_balancer_type is not None: - host_pool['load_balancer_type'] = load_balancer_type - if ring is not None: - host_pool['ring'] = ring - if validation_environment is not None: - host_pool['validation_environment'] = validation_environment - if registration_info is not None: - host_pool['registration_info'] = registration_info - if vm_template is not None: - host_pool['vm_template'] = vm_template - if ssoadfs_authority is not None: - host_pool['ssoadfs_authority'] = ssoadfs_authority - if sso_client_id is not None: - host_pool['sso_client_id'] = sso_client_id - if sso_client_secret_key_vault_path is not None: - host_pool['sso_client_secret_key_vault_path'] = sso_client_secret_key_vault_path - if sso_secret_type is not None: - host_pool['sso_secret_type'] = sso_secret_type - if preferred_app_group_type is not None: - host_pool['preferred_app_group_type'] = preferred_app_group_type - if start_vm_on_connect is not None: - host_pool['start_vm_on_connect'] = start_vm_on_connect - return client.update(resource_group_name=resource_group_name, - host_pool_name=host_pool_name, - host_pool=host_pool) - - -def desktopvirtualization_hostpool_delete(client, - resource_group_name, - host_pool_name, - force=None): - return client.delete(resource_group_name=resource_group_name, - host_pool_name=host_pool_name, - force=force) - - -def desktopvirtualization_hostpool_retrieve_registration_token(client, - resource_group_name, - host_pool_name): - return client.retrieve_registration_token(resource_group_name=resource_group_name, - host_pool_name=host_pool_name) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/manual/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/manual/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/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/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/test_desktopvirtualization_scenario.py b/src/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/test_desktopvirtualization_scenario.py deleted file mode 100644 index 5be58fe5fef..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/manual/tests/latest/test_desktopvirtualization_scenario.py +++ /dev/null @@ -1,107 +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.testsdk.checkers import JMESPathCheck, JMESPathCheckExists - - -# EXAMPLE: /HostPools/get/HostPool_List -def step__hostpools_get_hostpool_list(test, rg): - test.cmd('az desktopvirtualization hostpool list ' - '-g ""', - checks=[ - JMESPathCheckExists('[?name==\'{}\']'.format( - test.kwargs["myHostPool"])), - ]) - - -# EXAMPLE: /ApplicationGroups/put/ApplicationGroup_Create -def step__applicationgroups_put_applicationgroup_create(test, rg): - test.cmd('az desktopvirtualization applicationgroup create ' - '--location "centralus" ' - '--description "des1" ' - '--application-group-type "RemoteApp" ' - '--friendly-name "friendly" ' - '--host-pool-arm-path "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.DesktopVir' - 'tualization/hostPools/{myHostPool}" ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myApplicationGroup}" ' - '--resource-group "{rg}"', - checks=[ - JMESPathCheck('name', test.kwargs["myApplicationGroup"]), - JMESPathCheck('tags.tag1', 'value1'), - JMESPathCheck('tags.tag2', 'value2'), - ]) - - -# EXAMPLE: /ApplicationGroups/get/ApplicationGroup_ListByResourceGroup -def step__applicationgroups_get_applicationgroup_listbyresourcegroup(test, rg): - test.cmd('az desktopvirtualization applicationgroup list ' - '--filter "applicationGroupType eq \'RailApplication\'" ' - '--resource-group "{rg}"', - checks=[ - JMESPathCheckExists('[?name==\'{}\']'.format( - test.kwargs["myApplicationGroup"])), - ]) - - -# EXAMPLE: /ApplicationGroups/patch/ApplicationGroups_Update -def step__applicationgroups_patch_applicationgroups_update(test, rg): - test.cmd('az desktopvirtualization applicationgroup update ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--tags tag1="value3" tag2="value4" ' - '--name "{myApplicationGroup}" ' - '--resource-group "{rg}"', - checks=[ - JMESPathCheck('name', test.kwargs["myApplicationGroup"]), - JMESPathCheck('tags.tag1', 'value3'), - JMESPathCheck('tags.tag2', 'value4'), - ]) - - -# EXAMPLE: /Workspaces/put/Workspace_Create -def step__workspaces_put_workspace_create(test, rg): - test.cmd('az desktopvirtualization workspace create ' - '--resource-group "{rg}" ' - '--location "centralus" ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myWorkspace}"', - checks=[ - JMESPathCheck('name', test.kwargs["myWorkspace"]), - JMESPathCheck('tags.tag1', 'value1'), - JMESPathCheck('tags.tag2', 'value2'), - ]) - - -# EXAMPLE: /Workspaces/get/Workspace_Get -def step__workspaces_get_workspace_get(test, rg): - test.cmd('az desktopvirtualization workspace show ' - '--resource-group "{rg}" ' - '--name "{myWorkspace}"', - checks=[ - JMESPathCheck('name', test.kwargs["myWorkspace"]), - ]) - - -# EXAMPLE: /Workspaces/patch/Workspace_Update -def step__workspaces_patch_workspace_update(test, rg): - test.cmd('az desktopvirtualization workspace update ' - '--resource-group "{rg}" ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--tags tag1="value3" tag2="value4" ' - '--name "{myWorkspace}"', - checks=[ - JMESPathCheck('name', test.kwargs["myWorkspace"]), - JMESPathCheck('tags.tag1', 'value3'), - JMESPathCheck('tags.tag2', 'value4'), - ]) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/tests/__init__.py index 70488e93851..5757aea3175 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/tests/__init__.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/__init__.py @@ -1,116 +1,6 @@ -# 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 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]) +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/__init__.py index c9cfdc73e77..5757aea3175 100644 --- a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/__init__.py +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/__init__.py @@ -1,12 +1,6 @@ -# 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 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__) +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/example_steps.py b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/example_steps.py deleted file mode 100644 index 3727d86266a..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/example_steps.py +++ /dev/null @@ -1,260 +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: /HostPools/put/HostPool_Create -@try_manual -def step_hostpool_create(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool create ' - '--location "centralus" ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--host-pool-type "Pooled" ' - '--load-balancer-type "BreadthFirst" ' - '--max-session-limit 999999 ' - '--personal-desktop-assignment-type "Automatic" ' - '--preferred-app-group-type "Desktop" ' - '--registration-info expiration-time="2022-03-26T05:38:08.189Z" registration-token-operation="Update" ' - '--sso-client-id "client" ' - '--sso-client-secret-key-vault-path "https://keyvault/secret" ' - '--sso-secret-type "SharedKey" ' - '--start-vm-on-connect false ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myHostPool}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /HostPools/get/HostPool_Get -@try_manual -def step_hostpool_show(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool show ' - '--name "{myHostPool}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /HostPools/get/HostPool_List -@try_manual -def step_hostpool_list(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool list ' - '-g ""', - checks=checks) - - -# EXAMPLE: /HostPools/get/HostPool_ListByResourceGroup -@try_manual -def step_hostpool_list2(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /HostPools/patch/HostPool_Update -@try_manual -def step_hostpool_update(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool update ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--load-balancer-type "BreadthFirst" ' - '--max-session-limit 999999 ' - '--personal-desktop-assignment-type "Automatic" ' - '--registration-info expiration-time="2022-03-26T05:38:08.190Z" registration-token-operation="Update" ' - '--sso-client-id "client" ' - '--sso-client-secret-key-vault-path "https://keyvault/secret" ' - '--sso-secret-type "SharedKey" ' - '--start-vm-on-connect false ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myHostPool}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /HostPools/post/HostPools_RetrieveRegistrationToken_Post -@try_manual -def step_hostpool_retrieve_registration_token(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool retrieve-registration-token ' - '--name "{myHostPool}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /ApplicationGroups/put/ApplicationGroup_Create -@try_manual -def step_applicationgroup_create(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization applicationgroup create ' - '--location "centralus" ' - '--description "des1" ' - '--application-group-type "RemoteApp" ' - '--friendly-name "friendly" ' - '--host-pool-arm-path "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.DesktopVir' - 'tualization/hostPools/{myHostPool}" ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myApplicationGroup}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /ApplicationGroups/get/ApplicationGroup_Get -@try_manual -def step_applicationgroup_show(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization applicationgroup show ' - '--name "{myApplicationGroup}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /ApplicationGroups/get/ApplicationGroup_List -@try_manual -def step_applicationgroup_list(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization applicationgroup list ' - '--filter "applicationGroupType eq \'RailApplication\'" ' - '-g ""', - checks=checks) - - -# EXAMPLE: /ApplicationGroups/get/ApplicationGroup_ListByResourceGroup -@try_manual -def step_applicationgroup_list2(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization applicationgroup list ' - '--filter "applicationGroupType eq \'RailApplication\'" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /ApplicationGroups/patch/ApplicationGroups_Update -@try_manual -def step_applicationgroup_update(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization applicationgroup update ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myApplicationGroup}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /ApplicationGroups/delete/ApplicationGroup_Delete -@try_manual -def step_applicationgroup_delete(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization applicationgroup delete ' - '--name "{myApplicationGroup}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /HostPools/delete/HostPool_Delete -@try_manual -def step_hostpool_delete(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization hostpool delete ' - '--force true ' - '--name "{myHostPool}" ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /Workspaces/put/Workspace_Create -@try_manual -def step_workspace_create(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization workspace create ' - '--resource-group "{rg}" ' - '--location "centralus" ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myWorkspace}"', - checks=checks) - - -# EXAMPLE: /Workspaces/get/Workspace_Get -@try_manual -def step_workspace_show(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization workspace show ' - '--resource-group "{rg}" ' - '--name "{myWorkspace}"', - checks=checks) - - -# EXAMPLE: /Workspaces/get/Workspace_ListByResourceGroup -@try_manual -def step_workspace_list(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization workspace list ' - '--resource-group "{rg}"', - checks=checks) - - -# EXAMPLE: /Workspaces/get/Workspace_ListBySubscription -@try_manual -def step_workspace_list2(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization workspace list ' - '-g ""', - checks=checks) - - -# EXAMPLE: /Workspaces/patch/Workspace_Update -@try_manual -def step_workspace_update(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization workspace update ' - '--resource-group "{rg}" ' - '--description "des1" ' - '--friendly-name "friendly" ' - '--tags tag1="value1" tag2="value2" ' - '--name "{myWorkspace}"', - checks=checks) - - -# EXAMPLE: /Workspaces/delete/Workspace_Delete -@try_manual -def step_workspace_delete(test, checks=None): - if checks is None: - checks = [] - test.cmd('az desktopvirtualization workspace delete ' - '--resource-group "{rg}" ' - '--name "{myWorkspace}"', - checks=checks) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recording_processors.py b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recording_processors.py new file mode 100644 index 00000000000..b41e36a895c --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recording_processors.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from azure.cli.testsdk.scenario_tests import RecordingProcessor + + +class TokenReplacer(RecordingProcessor): + + def process_response(self, response): + import json + + body = response['body']['string'] + + json_body = json.loads(body) + if json_body and 'properties' in json_body: + if json_body['properties'] and 'registrationInfo' in json_body['properties']: + if json_body['properties']['registrationInfo'] and 'token' in json_body['properties']['registrationInfo']: + json_body['properties']['registrationInfo']['token'] = None + if json_body and 'token' in json_body: + json_body['token'] = None + response['body']['string'] = json.dumps(json_body) + + return response diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_Scenario.yaml b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_Scenario.yaml deleted file mode 100644 index c5fefe0c9ea..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_Scenario.yaml +++ /dev/null @@ -1,1293 +0,0 @@ -interactions: -- request: - body: '{"location": "centralus", "tags": {"tag1": "value1", "tag2": "value2"}, - "properties": {"friendlyName": "friendly", "description": "des1", "hostPoolType": - "Pooled", "personalDesktopAssignmentType": "Automatic", "maxSessionLimit": 999999, - "loadBalancerType": "BreadthFirst", "registrationInfo": {"expirationTime": "2022-03-26T05:38:08.189Z", - "registrationTokenOperation": "Update"}, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": - "https://keyvault/secret", "ssoSecretType": "SharedKey", "preferredAppGroupType": - "Desktop", "startVMOnConnect": false}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool create - Connection: - - keep-alive - Content-Length: - - '557' - Content-Type: - - application/json - ParameterSetName: - - --location --description --friendly-name --host-pool-type --load-balancer-type - --max-session-limit --personal-desktop-assignment-type --preferred-app-group-type - --registration-info --sso-client-id --sso-client-secret-key-vault-path --sso-secret-type - --start-vm-on-connect --tags --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1?api-version=2021-07-12 - response: - body: - string: '{"name":"hostPool1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","type":"Microsoft.DesktopVirtualization/hostpools","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:06.97Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:06.97Z"},"properties":{"friendlyName":"friendly","description":"des1","hostPoolType":"Pooled","personalDesktopAssignmentType":null,"applicationGroupReferences":[],"customRdpProperty":"drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;use - multimon:i:1;","maxSessionLimit":999999,"loadBalancerType":"BreadthFirst","validationEnvironment":false,"ring":null,"registrationInfo":{"expirationTime":"2022-03-26T05:38:08.189Z","token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IkZDMTBFOUQzNUQ4MEFCMjQyMTM2MTJBMDIwQjA3Q0U2Q0UxODRGMDAiLCJ0eXAiOiJKV1QifQ.eyJSZWdpc3RyYXRpb25JZCI6ImRkYzM2OWIzLTdkYzUtNDU3Ni1iODQyLWQxZGQzNDhmOTY3ZiIsIkJyb2tlclVyaSI6Imh0dHBzOi8vcmRicm9rZXItZy11cy1yMC53dmQubWljcm9zb2Z0LmNvbS8iLCJEaWFnbm9zdGljc1VyaSI6Imh0dHBzOi8vcmRkaWFnbm9zdGljcy1nLXVzLXIwLnd2ZC5taWNyb3NvZnQuY29tLyIsIkVuZHBvaW50UG9vbElkIjoiOThkMmE5ZmMtNzE4MC00N2UzLWFiZGItMTFkZTRiNzQ2MjgwIiwiR2xvYmFsQnJva2VyVXJpIjoiaHR0cHM6Ly9yZGJyb2tlci53dmQubWljcm9zb2Z0LmNvbS8iLCJHZW9ncmFwaHkiOiJVUyIsIkdsb2JhbEJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLnd2ZC5taWNyb3NvZnQuY29tLyIsIkJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwiRGlhZ25vc3RpY3NSZXNvdXJjZUlkVXJpIjoiaHR0cHM6Ly9yZGRpYWdub3N0aWNzLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwibmJmIjoxNjQ4MjA1ODg5LCJleHAiOjE2NDgyNzMwODgsImlzcyI6IlJESW5mcmFUb2tlbk1hbmFnZXIiLCJhdWQiOiJSRG1pIn0.FUSeOEn60nIO8SsEuZY-OfWLFg-9YYpwAEU3UN0frLg3-Qg5JcE7VgEqTip5tH0FL7QIUBAYLB4jTTDZDXk7qNlCjZYjoOTYDX6NTvf8je2eSW67XQaiDTAV978ZgcXOVWdzQ7W10sq27L-RXTpRfvjlrkaq_o_bTB6KFfwDAIbtXkM8fwkbKAP0i9f2imS5_Fd8fOz5P9T7epOP4HMeWCU13ECsHkdm63BGAgY-br6M6R80rcUqs73nydHNmMGPTFp-__St1_PP-zu7t5NOp_1irq3o-IGSdn7EE2SpPrkTsX8pNsUgIuQChzVo-okwV0tlCrMzQfd5fVbMGvz_2w","registrationTokenOperation":"Update"},"vmTemplate":null,"preferredAppGroupType":"Desktop","migrationRequest":null,"cloudPcResource":false,"startVMOnConnect":false,"ssoadfsAuthority":null,"ssoClientId":"client","ssoClientSecretKeyVaultPath":"https://keyvault/secret","ssoSecretType":"SharedKey","objectId":"98d2a9fc-7180-47e3-abdb-11de4b746280"}}' - headers: - cache-control: - - no-cache - content-length: - - '2702' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:11 GMT - expires: - - '-1' - location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1 - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 9a64e2f7-dac5-4511-8d8d-ab2650128206 - x-ms-lamport-ts: - - '2230668881' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdFBvb2wx - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool show - Connection: - - keep-alive - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1?api-version=2021-07-12 - response: - body: - string: '{"name":"hostPool1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","type":"Microsoft.DesktopVirtualization/hostpools","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:06.97Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:06.97Z"},"properties":{"friendlyName":"friendly","description":"des1","hostPoolType":"Pooled","personalDesktopAssignmentType":null,"applicationGroupReferences":[],"customRdpProperty":"drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;use - multimon:i:1;","maxSessionLimit":999999,"loadBalancerType":"BreadthFirst","validationEnvironment":false,"ring":null,"registrationInfo":null,"vmTemplate":null,"preferredAppGroupType":"Desktop","migrationRequest":null,"cloudPcResource":false,"startVMOnConnect":false,"ssoadfsAuthority":null,"ssoClientId":"client","ssoClientSecretKeyVaultPath":"https://keyvault/secret","ssoSecretType":"SharedKey","objectId":"98d2a9fc-7180-47e3-abdb-11de4b746280"}}' - headers: - cache-control: - - no-cache - content-length: - - '1367' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=bd0dfb948b4e67ff60a11cd6e169712e6848609ad034c4789ebdf993fcec41fb;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=bd0dfb948b4e67ff60a11cd6e169712e6848609ad034c4789ebdf993fcec41fb;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 8e68dd0d-14dd-4cf5-941e-0d392fb9bc5a - x-ms-lamport-ts: - - '2230671816' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdFBvb2wx - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool list - Connection: - - keep-alive - ParameterSetName: - - -g - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DesktopVirtualization/hostPools?api-version=2021-07-12 - response: - body: - string: '{"value":[{"name":"hostPool1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","type":"Microsoft.DesktopVirtualization/hostpools","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:06.97Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:06.97Z"},"properties":{"friendlyName":"friendly","description":"des1","hostPoolType":"Pooled","personalDesktopAssignmentType":null,"applicationGroupReferences":[],"customRdpProperty":"drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;use - multimon:i:1;","maxSessionLimit":999999,"loadBalancerType":"BreadthFirst","validationEnvironment":false,"ring":null,"registrationInfo":null,"vmTemplate":null,"preferredAppGroupType":"Desktop","migrationRequest":null,"cloudPcResource":false,"startVMOnConnect":false,"ssoadfsAuthority":null,"ssoClientId":"client","ssoClientSecretKeyVaultPath":"https://keyvault/secret","ssoSecretType":"SharedKey","objectId":"98d2a9fc-7180-47e3-abdb-11de4b746280"}}],"nextLink":null}' - headers: - cache-control: - - no-cache - content-length: - - '1395' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:12 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 87dcdee2-4472-43ae-a553-651fe8a0d1e5 - x-ms-lamport-ts: - - '2230668919' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkw - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools?api-version=2021-07-12 - response: - body: - string: '{"value":[{"name":"hostPool1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","type":"Microsoft.DesktopVirtualization/hostpools","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:06.97Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:06.97Z"},"properties":{"friendlyName":"friendly","description":"des1","hostPoolType":"Pooled","personalDesktopAssignmentType":null,"applicationGroupReferences":[],"customRdpProperty":"drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;use - multimon:i:1;","maxSessionLimit":999999,"loadBalancerType":"BreadthFirst","validationEnvironment":false,"ring":null,"registrationInfo":null,"vmTemplate":null,"preferredAppGroupType":"Desktop","migrationRequest":null,"cloudPcResource":false,"startVMOnConnect":false,"ssoadfsAuthority":null,"ssoClientId":"client","ssoClientSecretKeyVaultPath":"https://keyvault/secret","ssoSecretType":"SharedKey","objectId":"98d2a9fc-7180-47e3-abdb-11de4b746280"}}],"nextLink":null}' - headers: - cache-control: - - no-cache - content-length: - - '1395' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:14 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=5bde0dce94ac9acedf03c8b0a127ccf1e68e66d9ab570e773ec681a4fa4a0459;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=5bde0dce94ac9acedf03c8b0a127ccf1e68e66d9ab570e773ec681a4fa4a0459;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - d2f9b66f-dcb6-40a8-a2ed-6f915c47c1ee - x-ms-lamport-ts: - - '2230668391' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92Mw== - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"tags": {"tag1": "value1", "tag2": "value2"}, "properties": {"friendlyName": - "friendly", "description": "des1", "maxSessionLimit": 999999, "personalDesktopAssignmentType": - "Automatic", "loadBalancerType": "BreadthFirst", "registrationInfo": {"expirationTime": - "2022-03-26T05:38:08.190Z", "registrationTokenOperation": "Update"}, "ssoClientId": - "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", "ssoSecretType": - "SharedKey", "startVMOnConnect": false}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool update - Connection: - - keep-alive - Content-Length: - - '470' - Content-Type: - - application/json - ParameterSetName: - - --description --friendly-name --load-balancer-type --max-session-limit --personal-desktop-assignment-type - --registration-info --sso-client-id --sso-client-secret-key-vault-path --sso-secret-type - --start-vm-on-connect --tags --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1?api-version=2021-07-12 - response: - body: - string: '{"name":"hostPool1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","type":"Microsoft.DesktopVirtualization/hostpools","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:06.97Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:06.97Z"},"properties":{"friendlyName":"friendly","description":"des1","hostPoolType":"Pooled","personalDesktopAssignmentType":null,"applicationGroupReferences":[],"customRdpProperty":"drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;use - multimon:i:1;","maxSessionLimit":999999,"loadBalancerType":"BreadthFirst","validationEnvironment":false,"ring":null,"registrationInfo":{"expirationTime":"2022-03-26T05:38:08.19Z","token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IkZDMTBFOUQzNUQ4MEFCMjQyMTM2MTJBMDIwQjA3Q0U2Q0UxODRGMDAiLCJ0eXAiOiJKV1QifQ.eyJSZWdpc3RyYXRpb25JZCI6ImY2YjY5NDgzLWIwNGMtNDJkYS1iNzc5LWZhNTk5MGQ5NjE3MiIsIkJyb2tlclVyaSI6Imh0dHBzOi8vcmRicm9rZXItZy11cy1yMC53dmQubWljcm9zb2Z0LmNvbS8iLCJEaWFnbm9zdGljc1VyaSI6Imh0dHBzOi8vcmRkaWFnbm9zdGljcy1nLXVzLXIwLnd2ZC5taWNyb3NvZnQuY29tLyIsIkVuZHBvaW50UG9vbElkIjoiOThkMmE5ZmMtNzE4MC00N2UzLWFiZGItMTFkZTRiNzQ2MjgwIiwiR2xvYmFsQnJva2VyVXJpIjoiaHR0cHM6Ly9yZGJyb2tlci53dmQubWljcm9zb2Z0LmNvbS8iLCJHZW9ncmFwaHkiOiJVUyIsIkdsb2JhbEJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLnd2ZC5taWNyb3NvZnQuY29tLyIsIkJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwiRGlhZ25vc3RpY3NSZXNvdXJjZUlkVXJpIjoiaHR0cHM6Ly9yZGRpYWdub3N0aWNzLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwibmJmIjoxNjQ4MjA1ODk4LCJleHAiOjE2NDgyNzMwODgsImlzcyI6IlJESW5mcmFUb2tlbk1hbmFnZXIiLCJhdWQiOiJSRG1pIn0.c38gT-gx5ZszVcCeFvMc2RuL2pZhVXWmn5EMmZOqj-EGqLCm5okUNbpUqev1VZ0pxD4WGGVYgN2iwCucUnMCwI2wzdwQGmEcdJIfVQVmDJMQR8pe8TUCUi6qIvBJ6HbcktlFCCuBEvBLmCTu_rHPNkB6AArAyu-SX5V8K1aIBh21Q9-CE7B9hMl4MT-EBRAaYFETQGvgMr5ZEZLbBaIRr_RW_Fw65AXPk6Q92LeUQr8UVJV6H83lCHUgeh1PeRFyUM3324fEU22oXW-VCymmT9gms8wxdDUf36hjtKi3NONJpfhqVjz0NcK3F3_g3kqWHwGsXmD7ol6Z_uHYSg7JPg","registrationTokenOperation":"Update"},"vmTemplate":null,"preferredAppGroupType":"Desktop","migrationRequest":null,"cloudPcResource":false,"startVMOnConnect":false,"ssoadfsAuthority":null,"ssoClientId":"client","ssoClientSecretKeyVaultPath":"https://keyvault/secret","ssoSecretType":"SharedKey","objectId":"98d2a9fc-7180-47e3-abdb-11de4b746280"}}' - headers: - cache-control: - - no-cache - content-length: - - '2701' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:22 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=f0ee6f21aa7c58c32dab1b39eddd97e2640f8772649e883d33a25aaa012e3a21;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=f0ee6f21aa7c58c32dab1b39eddd97e2640f8772649e883d33a25aaa012e3a21;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 4f2c11e4-a8a4-4530-b460-9175442d8659 - x-ms-lamport-ts: - - '2230671327' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdFBvb2wx - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool retrieve-registration-token - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/retrieveRegistrationToken?api-version=2021-07-12 - response: - body: - string: '{"expirationTime":"2022-03-26T05:38:08.19Z","token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IkZDMTBFOUQzNUQ4MEFCMjQyMTM2MTJBMDIwQjA3Q0U2Q0UxODRGMDAiLCJ0eXAiOiJKV1QifQ.eyJSZWdpc3RyYXRpb25JZCI6ImY2YjY5NDgzLWIwNGMtNDJkYS1iNzc5LWZhNTk5MGQ5NjE3MiIsIkJyb2tlclVyaSI6Imh0dHBzOi8vcmRicm9rZXItZy11cy1yMC53dmQubWljcm9zb2Z0LmNvbS8iLCJEaWFnbm9zdGljc1VyaSI6Imh0dHBzOi8vcmRkaWFnbm9zdGljcy1nLXVzLXIwLnd2ZC5taWNyb3NvZnQuY29tLyIsIkVuZHBvaW50UG9vbElkIjoiOThkMmE5ZmMtNzE4MC00N2UzLWFiZGItMTFkZTRiNzQ2MjgwIiwiR2xvYmFsQnJva2VyVXJpIjoiaHR0cHM6Ly9yZGJyb2tlci53dmQubWljcm9zb2Z0LmNvbS8iLCJHZW9ncmFwaHkiOiJVUyIsIkdsb2JhbEJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLnd2ZC5taWNyb3NvZnQuY29tLyIsIkJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwiRGlhZ25vc3RpY3NSZXNvdXJjZUlkVXJpIjoiaHR0cHM6Ly9yZGRpYWdub3N0aWNzLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwibmJmIjoxNjQ4MjA1ODk4LCJleHAiOjE2NDgyNzMwODgsImlzcyI6IlJESW5mcmFUb2tlbk1hbmFnZXIiLCJhdWQiOiJSRG1pIn0.c38gT-gx5ZszVcCeFvMc2RuL2pZhVXWmn5EMmZOqj-EGqLCm5okUNbpUqev1VZ0pxD4WGGVYgN2iwCucUnMCwI2wzdwQGmEcdJIfVQVmDJMQR8pe8TUCUi6qIvBJ6HbcktlFCCuBEvBLmCTu_rHPNkB6AArAyu-SX5V8K1aIBh21Q9-CE7B9hMl4MT-EBRAaYFETQGvgMr5ZEZLbBaIRr_RW_Fw65AXPk6Q92LeUQr8UVJV6H83lCHUgeh1PeRFyUM3324fEU22oXW-VCymmT9gms8wxdDUf36hjtKi3NONJpfhqVjz0NcK3F3_g3kqWHwGsXmD7ol6Z_uHYSg7JPg","resetToken":false,"registrationTokenOperation":"None"}' - headers: - cache-control: - - no-cache - content-length: - - '1355' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:23 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=faf4dec0e866a78a704d6f50882bec16fc24fe887063009bbdffd2526cac326f;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=faf4dec0e866a78a704d6f50882bec16fc24fe887063009bbdffd2526cac326f;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 2cc3eb4a-262e-430c-8f80-cee4e3ce9207 - x-ms-lamport-ts: - - '2230669020' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdFBvb2wx - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"location": "centralus", "tags": {"tag1": "value1", "tag2": "value2"}, - "properties": {"description": "des1", "friendlyName": "friendly", "hostPoolArmPath": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1", - "applicationGroupType": "RemoteApp"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization applicationgroup create - Connection: - - keep-alive - Content-Length: - - '340' - Content-Type: - - application/json - ParameterSetName: - - --location --description --application-group-type --friendly-name --host-pool-arm-path - --tags --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1?api-version=2021-07-12 - response: - body: - string: '{"name":"applicationGroup1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1","type":"Microsoft.DesktopVirtualization/applicationgroups","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":"RemoteApp","systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:28.22Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:28.22Z"},"properties":{"hostPoolArmPath":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","workspaceArmPath":null,"description":"des1","friendlyName":"friendly","applicationGroupType":"RemoteApp","migrationRequest":null,"cloudPcResource":false,"objectId":"e58986fa-1105-40c4-81c8-5342c265c07a"}}' - headers: - cache-control: - - no-cache - content-length: - - '946' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:32 GMT - expires: - - '-1' - location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1 - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=7370067215f49a50b9568dd2af2b20f273b5ad9b4ce5a0042e2457ca35096ce0;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=7370067215f49a50b9568dd2af2b20f273b5ad9b4ce5a0042e2457ca35096ce0;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 714a6500-6fd6-4b8d-a703-34fa888dac2b - x-ms-lamport-ts: - - '2230669037' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBsaWNhdGlvbkdyb3VwMQ== - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization applicationgroup show - Connection: - - keep-alive - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1?api-version=2021-07-12 - response: - body: - string: '{"name":"applicationGroup1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1","type":"Microsoft.DesktopVirtualization/applicationgroups","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":"RemoteApp","systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:28.22Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:28.22Z"},"properties":{"hostPoolArmPath":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","workspaceArmPath":null,"description":"des1","friendlyName":"friendly","applicationGroupType":"RemoteApp","migrationRequest":null,"cloudPcResource":false,"objectId":"e58986fa-1105-40c4-81c8-5342c265c07a"}}' - headers: - cache-control: - - no-cache - content-length: - - '946' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:32 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 3520eae9-61de-4781-bf39-22278b4b87bf - x-ms-lamport-ts: - - '2230669173' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBsaWNhdGlvbkdyb3VwMQ== - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization applicationgroup list - Connection: - - keep-alive - ParameterSetName: - - --filter -g - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DesktopVirtualization/applicationGroups?api-version=2021-07-12&$filter=applicationGroupType%20eq%20%27RailApplication%27 - response: - body: - string: '{"value":[{"name":"applicationGroup1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1","type":"Microsoft.DesktopVirtualization/applicationgroups","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":"RemoteApp","systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:28.22Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:28.22Z"},"properties":{"hostPoolArmPath":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","workspaceArmPath":null,"description":"des1","friendlyName":"friendly","applicationGroupType":"RemoteApp","migrationRequest":null,"cloudPcResource":false,"objectId":"e58986fa-1105-40c4-81c8-5342c265c07a"}}],"nextLink":null}' - headers: - cache-control: - - no-cache - content-length: - - '974' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=bd0dfb948b4e67ff60a11cd6e169712e6848609ad034c4789ebdf993fcec41fb;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=bd0dfb948b4e67ff60a11cd6e169712e6848609ad034c4789ebdf993fcec41fb;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 026d3c71-4747-4ff7-98a8-8a643abc1528 - x-ms-lamport-ts: - - '2230672097' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkw - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization applicationgroup list - Connection: - - keep-alive - ParameterSetName: - - --filter --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationGroups?api-version=2021-07-12&$filter=applicationGroupType%20eq%20%27RailApplication%27 - response: - body: - string: '{"value":[{"name":"applicationGroup1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1","type":"Microsoft.DesktopVirtualization/applicationgroups","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":"RemoteApp","systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:28.22Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:28.22Z"},"properties":{"hostPoolArmPath":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","workspaceArmPath":null,"description":"des1","friendlyName":"friendly","applicationGroupType":"RemoteApp","migrationRequest":null,"cloudPcResource":false,"objectId":"e58986fa-1105-40c4-81c8-5342c265c07a"}}],"nextLink":null}' - headers: - cache-control: - - no-cache - content-length: - - '974' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:35 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=f0ee6f21aa7c58c32dab1b39eddd97e2640f8772649e883d33a25aaa012e3a21;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=f0ee6f21aa7c58c32dab1b39eddd97e2640f8772649e883d33a25aaa012e3a21;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - d2d705d8-3bc0-43a1-a735-bd56d47188f0 - x-ms-lamport-ts: - - '2230671513' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92Mw== - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"tags": {"tag1": "value1", "tag2": "value2"}, "properties": {"description": - "des1", "friendlyName": "friendly"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization applicationgroup update - Connection: - - keep-alive - Content-Length: - - '113' - Content-Type: - - application/json - ParameterSetName: - - --description --friendly-name --tags --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1?api-version=2021-07-12 - response: - body: - string: '{"name":"applicationGroup1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1","type":"Microsoft.DesktopVirtualization/applicationgroups","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":"RemoteApp","systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:28.22Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:36.79Z"},"properties":{"hostPoolArmPath":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","workspaceArmPath":null,"description":"des1","friendlyName":"friendly","applicationGroupType":"RemoteApp","migrationRequest":null,"cloudPcResource":false,"objectId":"e58986fa-1105-40c4-81c8-5342c265c07a"}}' - headers: - cache-control: - - no-cache - content-length: - - '946' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:40 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=bd0dfb948b4e67ff60a11cd6e169712e6848609ad034c4789ebdf993fcec41fb;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=bd0dfb948b4e67ff60a11cd6e169712e6848609ad034c4789ebdf993fcec41fb;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - a5d532db-dd3e-4b99-9977-8f95d7bebf0c - x-ms-lamport-ts: - - '2230672137' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBsaWNhdGlvbkdyb3VwMQ== - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization applicationgroup delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1?api-version=2021-07-12 - response: - body: - string: '{"name":"applicationGroup1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/applicationgroups/applicationGroup1","type":"Microsoft.DesktopVirtualization/applicationgroups","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":"RemoteApp","systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:28.22Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:36.79Z"},"properties":{"hostPoolArmPath":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","workspaceArmPath":null,"description":"des1","friendlyName":"friendly","applicationGroupType":"RemoteApp","migrationRequest":null,"cloudPcResource":false,"objectId":"e58986fa-1105-40c4-81c8-5342c265c07a"}}' - headers: - cache-control: - - no-cache - content-length: - - '946' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:58:49 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 6ac00f0f-b1ba-4d8b-81cf-caa56b612668 - x-ms-lamport-ts: - - '2230669349' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBsaWNhdGlvbkdyb3VwMQ== - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization hostpool delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --force --name --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1?api-version=2021-07-12&force=true - response: - body: - string: '{"name":"hostPool1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1","type":"Microsoft.DesktopVirtualization/hostpools","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:58:06.97Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:58:06.97Z"},"properties":{"friendlyName":"friendly","description":"des1","hostPoolType":"Pooled","personalDesktopAssignmentType":null,"applicationGroupReferences":[],"customRdpProperty":"drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;use - multimon:i:1;","maxSessionLimit":999999,"loadBalancerType":"BreadthFirst","validationEnvironment":false,"ring":null,"registrationInfo":{"expirationTime":"2022-03-26T05:38:08.19Z","token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IkZDMTBFOUQzNUQ4MEFCMjQyMTM2MTJBMDIwQjA3Q0U2Q0UxODRGMDAiLCJ0eXAiOiJKV1QifQ.eyJSZWdpc3RyYXRpb25JZCI6ImY2YjY5NDgzLWIwNGMtNDJkYS1iNzc5LWZhNTk5MGQ5NjE3MiIsIkJyb2tlclVyaSI6Imh0dHBzOi8vcmRicm9rZXItZy11cy1yMC53dmQubWljcm9zb2Z0LmNvbS8iLCJEaWFnbm9zdGljc1VyaSI6Imh0dHBzOi8vcmRkaWFnbm9zdGljcy1nLXVzLXIwLnd2ZC5taWNyb3NvZnQuY29tLyIsIkVuZHBvaW50UG9vbElkIjoiOThkMmE5ZmMtNzE4MC00N2UzLWFiZGItMTFkZTRiNzQ2MjgwIiwiR2xvYmFsQnJva2VyVXJpIjoiaHR0cHM6Ly9yZGJyb2tlci53dmQubWljcm9zb2Z0LmNvbS8iLCJHZW9ncmFwaHkiOiJVUyIsIkdsb2JhbEJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLnd2ZC5taWNyb3NvZnQuY29tLyIsIkJyb2tlclJlc291cmNlSWRVcmkiOiJodHRwczovL3JkYnJva2VyLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwiRGlhZ25vc3RpY3NSZXNvdXJjZUlkVXJpIjoiaHR0cHM6Ly9yZGRpYWdub3N0aWNzLWctdXMtcjAud3ZkLm1pY3Jvc29mdC5jb20vIiwibmJmIjoxNjQ4MjA1ODk4LCJleHAiOjE2NDgyNzMwODgsImlzcyI6IlJESW5mcmFUb2tlbk1hbmFnZXIiLCJhdWQiOiJSRG1pIn0.c38gT-gx5ZszVcCeFvMc2RuL2pZhVXWmn5EMmZOqj-EGqLCm5okUNbpUqev1VZ0pxD4WGGVYgN2iwCucUnMCwI2wzdwQGmEcdJIfVQVmDJMQR8pe8TUCUi6qIvBJ6HbcktlFCCuBEvBLmCTu_rHPNkB6AArAyu-SX5V8K1aIBh21Q9-CE7B9hMl4MT-EBRAaYFETQGvgMr5ZEZLbBaIRr_RW_Fw65AXPk6Q92LeUQr8UVJV6H83lCHUgeh1PeRFyUM3324fEU22oXW-VCymmT9gms8wxdDUf36hjtKi3NONJpfhqVjz0NcK3F3_g3kqWHwGsXmD7ol6Z_uHYSg7JPg","registrationTokenOperation":"None"},"vmTemplate":null,"preferredAppGroupType":"Desktop","migrationRequest":null,"cloudPcResource":false,"startVMOnConnect":false,"ssoadfsAuthority":null,"ssoClientId":"client","ssoClientSecretKeyVaultPath":"https://keyvault/secret","ssoSecretType":"SharedKey","objectId":"98d2a9fc-7180-47e3-abdb-11de4b746280"}}' - headers: - cache-control: - - no-cache - content-length: - - '2699' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:01 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - db013750-5109-4d0d-922e-c99768a31233 - x-ms-lamport-ts: - - '2230669473' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdFBvb2wx - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"location": "centralus", "tags": {"tag1": "value1", "tag2": "value2"}, - "properties": {"description": "des1", "friendlyName": "friendly"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization workspace create - Connection: - - keep-alive - Content-Length: - - '138' - Content-Type: - - application/json - ParameterSetName: - - --resource-group --location --description --friendly-name --tags --name - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1?api-version=2021-07-12 - response: - body: - string: '{"name":"workspace1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1","type":"Microsoft.DesktopVirtualization/workspaces","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:59:10.15Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:59:10.15Z"},"properties":{"description":"des1","friendlyName":"friendly","applicationGroupReferences":[],"cloudPcResource":false,"publicNetworkAccess":null,"objectId":"5b6de428-d34f-4dbe-b6a3-d10b0d3738f0"}}' - headers: - cache-control: - - no-cache - content-length: - - '724' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:13 GMT - expires: - - '-1' - location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1 - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=5bde0dce94ac9acedf03c8b0a127ccf1e68e66d9ab570e773ec681a4fa4a0459;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=5bde0dce94ac9acedf03c8b0a127ccf1e68e66d9ab570e773ec681a4fa4a0459;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 1ede60a7-2886-42b3-96e5-291070453ba8 - x-ms-lamport-ts: - - '2230669361' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZTE= - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization workspace show - Connection: - - keep-alive - ParameterSetName: - - --resource-group --name - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1?api-version=2021-07-12 - response: - body: - string: '{"name":"workspace1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1","type":"Microsoft.DesktopVirtualization/workspaces","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:59:10.15Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:59:10.15Z"},"properties":{"description":"des1","friendlyName":"friendly","applicationGroupReferences":[],"cloudPcResource":false,"publicNetworkAccess":null,"objectId":"5b6de428-d34f-4dbe-b6a3-d10b0d3738f0"}}' - headers: - cache-control: - - no-cache - content-length: - - '724' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:14 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=f0ee6f21aa7c58c32dab1b39eddd97e2640f8772649e883d33a25aaa012e3a21;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=f0ee6f21aa7c58c32dab1b39eddd97e2640f8772649e883d33a25aaa012e3a21;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - ec37bc87-a5d2-49db-99a8-b4d2e3e5de21 - x-ms-lamport-ts: - - '2230672279' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZTE= - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization workspace list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces?api-version=2021-07-12 - response: - body: - string: '{"value":[{"name":"workspace1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1","type":"Microsoft.DesktopVirtualization/workspaces","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:59:10.15Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:59:10.15Z"},"properties":{"description":"des1","friendlyName":"friendly","applicationGroupReferences":[],"cloudPcResource":false,"publicNetworkAccess":null,"objectId":"5b6de428-d34f-4dbe-b6a3-d10b0d3738f0"}}],"nextLink":null}' - headers: - cache-control: - - no-cache - content-length: - - '752' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:15 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=8709cede3dff6cc96c3687614f6f6d07d26f1b7354152bf58fb5a84fbfd96a8a;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=8709cede3dff6cc96c3687614f6f6d07d26f1b7354152bf58fb5a84fbfd96a8a;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 1c5362d8-f3fc-46b1-af86-12d6ab9f3db6 - x-ms-lamport-ts: - - '2230672780' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92Mw== - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization workspace list - Connection: - - keep-alive - ParameterSetName: - - -g - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DesktopVirtualization/workspaces?api-version=2021-07-12 - response: - body: - string: '{"value":[{"name":"workspace1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1","type":"Microsoft.DesktopVirtualization/workspaces","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:59:10.15Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:59:10.15Z"},"properties":{"description":"des1","friendlyName":"friendly","applicationGroupReferences":[],"cloudPcResource":false,"publicNetworkAccess":null,"objectId":"5b6de428-d34f-4dbe-b6a3-d10b0d3738f0"}}],"nextLink":null}' - headers: - cache-control: - - no-cache - content-length: - - '752' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:16 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=607acc0b60c99d398a1b4a887b17d42dc08c6889973dd3e1514cc34bb8598dbf;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=607acc0b60c99d398a1b4a887b17d42dc08c6889973dd3e1514cc34bb8598dbf;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 732a7cf4-034c-48da-92e3-a8303000dc4a - x-ms-lamport-ts: - - '2230672563' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkw - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"tags": {"tag1": "value1", "tag2": "value2"}, "properties": {"description": - "des1", "friendlyName": "friendly"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization workspace update - Connection: - - keep-alive - Content-Length: - - '113' - Content-Type: - - application/json - ParameterSetName: - - --resource-group --description --friendly-name --tags --name - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1?api-version=2021-07-12 - response: - body: - string: '{"name":"workspace1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1","type":"Microsoft.DesktopVirtualization/workspaces","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":{"createdBy":"zelinwang@microsoft.com","createdByType":"User","createdAt":"2022-03-25T10:59:10.15Z","lastModifiedBy":"zelinwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-25T10:59:21.30Z"},"properties":{"description":"des1","friendlyName":"friendly","applicationGroupReferences":[],"cloudPcResource":false,"publicNetworkAccess":null,"objectId":"5b6de428-d34f-4dbe-b6a3-d10b0d3738f0"}}' - headers: - cache-control: - - no-cache - content-length: - - '724' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:26 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=dfef65d5d005decdf16ca6c5670ca470d3b3147889c1170e73f46a07f21ca5ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - 3e712508-c56e-4392-85b7-0c3904d27e6f - x-ms-lamport-ts: - - '2230669971' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZTE= - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - desktopvirtualization workspace delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --resource-group --name - User-Agent: - - AZURECLI/2.34.1 azsdk-python-mgmt-desktopvirtualization/1.0.0b1 Python/3.9.5 - (Windows-10-10.0.19044-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1?api-version=2021-07-12 - response: - body: - string: '{"name":"workspace1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace1","type":"Microsoft.DesktopVirtualization/workspaces","location":"centralus","tags":{"tag1":"value1","tag2":"value2"},"kind":null,"systemData":null,"properties":{"description":"des1","friendlyName":"friendly","applicationGroupReferences":[],"cloudPcResource":false,"publicNetworkAccess":null,"objectId":"5b6de428-d34f-4dbe-b6a3-d10b0d3738f0"}}' - headers: - cache-control: - - no-cache - content-length: - - '514' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 25 Mar 2022 10:59:31 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - set-cookie: - - ARRAffinity=7370067215f49a50b9568dd2af2b20f273b5ad9b4ce5a0042e2457ca35096ce0;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - - ARRAffinitySameSite=7370067215f49a50b9568dd2af2b20f273b5ad9b4ce5a0042e2457ca35096ce0;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-correlation-id: - - eaa85797-77ab-4060-a209-a18cc51fa6a5 - x-ms-lamport-ts: - - '2230670025' - x-ms-opsarmpath64: - - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL2NsaXRlc3Q3ZzNpcm5jZHRxM3JrMzVsZHlwYTZobWh1NDd2eXF4YmZla3ZiNndpZnFtNjRscWF5Z3l5NHdjenpuM2l1dTRlbW92My9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZTE= - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-powered-by: - - ASP.NET - x-rate-limit-limit: - - '0' - x-rate-limit-remaining: - - '9223372036854775807' - x-rate-limit-reset: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_applicationgroup.yaml b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_applicationgroup.yaml new file mode 100644 index 00000000000..1bb5e234954 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_applicationgroup.yaml @@ -0,0 +1,644 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool create + Connection: + - keep-alive + ParameterSetName: + - --name -g --description --friendly-name --host-pool-type --load-balancer-type + --max-session-limit --personal-desktop-assignment-type --preferred-app-group-type + --registration-info --sso-client-id --sso-client-secret-key-vault-path --sso-secret-type + --start-vm-on-connect + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001", + "name": "test_desktopvirtualization_applicationgroup_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "centralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_desktopvirtualization_applicationgroup", "date": "2024-03-01T02:58:45Z", + "module": "desktopvirtualization"}, "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '488' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: FC89C3C4643244A194EA60FA7E125295 Ref B: TYO201100113017 Ref C: 2024-03-01T02:58:48Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"description": "test", "friendlyName": + "friendly", "hostPoolType": "Pooled", "loadBalancerType": "BreadthFirst", "maxSessionLimit": + 999999, "personalDesktopAssignmentType": "Automatic", "preferredAppGroupType": + "Desktop", "registrationInfo": {"expirationTime": "2024-03-05T06:38:08.189Z", + "registrationTokenOperation": "Update"}, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": + "https://keyvault/secret", "ssoSecretType": "SharedKey", "startVMOnConnect": + false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool create + Connection: + - keep-alive + Content-Length: + - '511' + Content-Type: + - application/json + ParameterSetName: + - --name -g --description --friendly-name --host-pool-type --load-balancer-type + --max-session-limit --personal-desktop-assignment-type --preferred-app-group-type + --registration-info --sso-client-id --sso-client-secret-key-vault-path --sso-secret-type + --start-vm-on-connect + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002?api-version=2021-07-12 + response: + body: + string: '{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": null, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:58:49.78Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:58:49.78Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": {"expirationTime": + "2024-03-05T06:38:08.189Z", "token": null, "registrationTokenOperation": "Update"}, + "vmTemplate": null, "preferredAppGroupType": "Desktop", "migrationRequest": + null, "cloudPcResource": false, "startVMOnConnect": false, "ssoadfsAuthority": + null, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", + "ssoSecretType": "SharedKey", "objectId": "3a5c45e9-6680-43f6-bc54-fa5fb62617f8"}}' + headers: + cache-control: + - no-cache + content-length: + - '1596' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:51 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002 + pragma: + - no-cache + set-cookie: + - ARRAffinity=bfb6d68afc38e295e465fa6926b0da6265f60eaf3bbbf914428aa5e9ada70f10;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=bfb6d68afc38e295e465fa6926b0da6265f60eaf3bbbf914428aa5e9ada70f10;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 19cc9c33-f7c4-4313-86de-1dcd66f1ca52 + x-ms-lamport-ts: + - '5614211824' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dy9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfanJ2djRj + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: A60F9DB665444B32B843E9FE0DCBA592 Ref B: TYO201100114009 Ref C: 2024-03-01T02:58:48Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup create + Connection: + - keep-alive + ParameterSetName: + - -g -n --host-pool-arm-path --application-group-type + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001", + "name": "test_desktopvirtualization_applicationgroup_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "centralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_desktopvirtualization_applicationgroup", "date": "2024-03-01T02:58:45Z", + "module": "desktopvirtualization", "Creator": "v-jingszhang@microsoft.com", + "DateCreated": "2024-03-01T02:58:48Z"}, "properties": {"provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 0376AB65395543CB84AF18E2998B7C43 Ref B: TYO201100117019 Ref C: 2024-03-01T02:58:52Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"applicationGroupType": "RemoteApp", + "hostPoolArmPath": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup create + Connection: + - keep-alive + Content-Length: + - '286' + Content-Type: + - application/json + ParameterSetName: + - -g -n --host-pool-arm-path --application-group-type + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationGroups/appgroup000003?api-version=2021-07-12 + response: + body: + string: '{"name": "appgroup000003", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003", + "type": "Microsoft.DesktopVirtualization/applicationgroups", "location": "centralus", + "tags": null, "kind": "RemoteApp", "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:58:53.69Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:58:53.69Z"}, "properties": {"hostPoolArmPath": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "workspaceArmPath": null, "description": null, "friendlyName": null, "applicationGroupType": + "RemoteApp", "migrationRequest": null, "cloudPcResource": false, "showInFeed": + null, "objectId": "7fcca6fe-11c5-48ef-8a5a-18c5dbce8f0d"}}' + headers: + cache-control: + - no-cache + content-length: + - '1050' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:54 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003 + pragma: + - no-cache + set-cookie: + - ARRAffinity=8709cede3dff6cc96c3687614f6f6d07d26f1b7354152bf58fb5a84fbfd96a8a;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=8709cede3dff6cc96c3687614f6f6d07d26f1b7354152bf58fb5a84fbfd96a8a;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 4da9f456-9429-40c9-bc2b-f4e78a58b80d + x-ms-lamport-ts: + - '5614210502' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dy9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBncm91cHk1c213MzY= + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: E395AE7769FD4EBB88644BE3A2197EE4 Ref B: TYO201100113009 Ref C: 2024-03-01T02:58:52Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationGroups/appgroup000003?api-version=2021-07-12 + response: + body: + string: '{"name": "appgroup000003", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003", + "type": "Microsoft.DesktopVirtualization/applicationgroups", "location": "centralus", + "tags": null, "kind": "RemoteApp", "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:58:53.69Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:58:53.69Z"}, "properties": {"hostPoolArmPath": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "workspaceArmPath": null, "description": null, "friendlyName": null, "applicationGroupType": + "RemoteApp", "migrationRequest": null, "cloudPcResource": false, "showInFeed": + null, "objectId": "7fcca6fe-11c5-48ef-8a5a-18c5dbce8f0d"}}' + headers: + cache-control: + - no-cache + content-length: + - '1050' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:56 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=4c87a3fd2d13fe8deabf01a0da1890a3564e836c7c9f153e312617237a9297d0;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=4c87a3fd2d13fe8deabf01a0da1890a3564e836c7c9f153e312617237a9297d0;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 055c0a2d-5712-4d47-8881-45898677a818 + x-ms-lamport-ts: + - '5614210312' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dy9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBncm91cHk1c213MzY= + x-msedge-ref: + - 'Ref A: 2CFB9D792A484583A53294CCF95F5087 Ref B: TYO201100113033 Ref C: 2024-03-01T02:58:55Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: '{"kind": "RemoteApp", "location": "centralus", "properties": {"applicationGroupType": + "RemoteApp", "hostPoolArmPath": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002"}, + "tags": {"tag": "test"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup update + Connection: + - keep-alive + Content-Length: + - '332' + Content-Type: + - application/json + ParameterSetName: + - -g -n --tags + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationGroups/appgroup000003?api-version=2021-07-12 + response: + body: + string: '{"name": "appgroup000003", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003", + "type": "Microsoft.DesktopVirtualization/applicationgroups", "location": "centralus", + "tags": {"tag": "test"}, "kind": "RemoteApp", "systemData": {"createdBy": + "v-jingszhang@microsoft.com", "createdByType": "User", "createdAt": "2024-03-01T02:58:53.69Z", + "lastModifiedBy": "v-jingszhang@microsoft.com", "lastModifiedByType": "User", + "lastModifiedAt": "2024-03-01T02:58:56.97Z"}, "properties": {"hostPoolArmPath": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "workspaceArmPath": null, "description": null, "friendlyName": null, "applicationGroupType": + "RemoteApp", "migrationRequest": null, "cloudPcResource": false, "showInFeed": + null, "objectId": "7fcca6fe-11c5-48ef-8a5a-18c5dbce8f0d"}}' + headers: + cache-control: + - no-cache + content-length: + - '1061' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:58 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=dc0afb88b06f8acee5b9f72ac727a3520876ed062d9dd904b77e346206763032;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=dc0afb88b06f8acee5b9f72ac727a3520876ed062d9dd904b77e346206763032;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 1de82d12-52e4-41f4-9a13-af07261a6e75 + x-ms-lamport-ts: + - '5614211925' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dy9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBncm91cHk1c213MzY= + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-msedge-ref: + - 'Ref A: 8F929FBD01044EB69DDC2F33CC3BD643 Ref B: TYO201100113033 Ref C: 2024-03-01T02:58:56Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationGroups/appgroup000003?api-version=2021-07-12 + response: + body: + string: '{"name": "appgroup000003", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003", + "type": "Microsoft.DesktopVirtualization/applicationgroups", "location": "centralus", + "tags": {"tag": "test"}, "kind": "RemoteApp", "systemData": {"createdBy": + "v-jingszhang@microsoft.com", "createdByType": "User", "createdAt": "2024-03-01T02:58:53.69Z", + "lastModifiedBy": "v-jingszhang@microsoft.com", "lastModifiedByType": "User", + "lastModifiedAt": "2024-03-01T02:58:56.97Z"}, "properties": {"hostPoolArmPath": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "workspaceArmPath": null, "description": null, "friendlyName": null, "applicationGroupType": + "RemoteApp", "migrationRequest": null, "cloudPcResource": false, "showInFeed": + null, "objectId": "7fcca6fe-11c5-48ef-8a5a-18c5dbce8f0d"}}' + headers: + cache-control: + - no-cache + content-length: + - '1061' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:58:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5d35a7442639fc0711921e32334a8850533656dd03cc677a5addc467ce0ffbe1;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=5d35a7442639fc0711921e32334a8850533656dd03cc677a5addc467ce0ffbe1;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 56df3bcb-2f1a-41d6-8ded-a852f4185e62 + x-ms-lamport-ts: + - '5614212025' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dy9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBncm91cHk1c213MzY= + x-msedge-ref: + - 'Ref A: 80218CA0EB6544369C32BAAAA1C9B3FB Ref B: TYO201100116025 Ref C: 2024-03-01T02:58:59Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationGroups?api-version=2021-07-12 + response: + body: + string: '{"value": [{"name": "appgroup000003", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003", + "type": "Microsoft.DesktopVirtualization/applicationgroups", "location": "centralus", + "tags": {"tag": "test"}, "kind": "RemoteApp", "systemData": {"createdBy": + "v-jingszhang@microsoft.com", "createdByType": "User", "createdAt": "2024-03-01T02:58:53.69Z", + "lastModifiedBy": "v-jingszhang@microsoft.com", "lastModifiedByType": "User", + "lastModifiedAt": "2024-03-01T02:58:56.97Z"}, "properties": {"hostPoolArmPath": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "workspaceArmPath": null, "description": null, "friendlyName": null, "applicationGroupType": + "RemoteApp", "migrationRequest": null, "cloudPcResource": false, "showInFeed": + null, "objectId": "7fcca6fe-11c5-48ef-8a5a-18c5dbce8f0d"}}], "nextLink": null}' + headers: + cache-control: + - no-cache + content-length: + - '1092' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:59:01 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5d35a7442639fc0711921e32334a8850533656dd03cc677a5addc467ce0ffbe1;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=5d35a7442639fc0711921e32334a8850533656dd03cc677a5addc467ce0ffbe1;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - ad0854e3-f07f-41e2-b2e3-e4ce6e52ab28 + x-ms-lamport-ts: + - '5614212057' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dw== + x-msedge-ref: + - 'Ref A: 99AB8B94EDB5431B9F003255E86682B3 Ref B: TYO201100115049 Ref C: 2024-03-01T02:59:01Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization applicationgroup delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n -y + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationGroups/appgroup000003?api-version=2021-07-12 + response: + body: + string: '{"name": "appgroup000003", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup000003", + "type": "Microsoft.DesktopVirtualization/applicationgroups", "location": "centralus", + "tags": {"tag": "test"}, "kind": "RemoteApp", "systemData": {"createdBy": + "v-jingszhang@microsoft.com", "createdByType": "User", "createdAt": "2024-03-01T02:58:53.69Z", + "lastModifiedBy": "v-jingszhang@microsoft.com", "lastModifiedByType": "User", + "lastModifiedAt": "2024-03-01T02:58:56.97Z"}, "properties": {"hostPoolArmPath": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_applicationgroup_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "workspaceArmPath": null, "description": null, "friendlyName": null, "applicationGroupType": + "RemoteApp", "migrationRequest": null, "cloudPcResource": false, "showInFeed": + null, "objectId": "7fcca6fe-11c5-48ef-8a5a-18c5dbce8f0d"}}' + headers: + cache-control: + - no-cache + content-length: + - '1061' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:59:05 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=4c87a3fd2d13fe8deabf01a0da1890a3564e836c7c9f153e312617237a9297d0;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=4c87a3fd2d13fe8deabf01a0da1890a3564e836c7c9f153e312617237a9297d0;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - c041c5c4-be69-4379-938c-56e4c631e6f0 + x-ms-lamport-ts: + - '5614212701' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2FwcGxpY2F0aW9uZ3JvdXBfemdkNXR0YnVwdHR4cmNvZmdobWpjY3ppejRxbjI3dy9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9hcHBsaWNhdGlvbkdyb3Vwcy9hcHBncm91cHk1c213MzY= + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + x-msedge-ref: + - 'Ref A: 9180CE4CB1E84C238BF27B1E5234CED5 Ref B: TYO201100113051 Ref C: 2024-03-01T02:59:02Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +version: 1 diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_hostpool.yaml b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_hostpool.yaml new file mode 100644 index 00000000000..a03f8ec9276 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_hostpool.yaml @@ -0,0 +1,611 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool create + Connection: + - keep-alive + ParameterSetName: + - --name -g --description --friendly-name --host-pool-type --load-balancer-type + --max-session-limit --personal-desktop-assignment-type --preferred-app-group-type + --registration-info --sso-client-id --sso-client-secret-key-vault-path --sso-secret-type + --start-vm-on-connect + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001", + "name": "test_desktopvirtualization_hostpool_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "centralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_desktopvirtualization_hostpool", "date": "2024-03-01T03:45:39Z", + "module": "desktopvirtualization"}, "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '464' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:45:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 2923F1E903B547F996AE3D2F2B055B46 Ref B: TYO201100114029 Ref C: 2024-03-01T03:45:51Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"description": "test", "friendlyName": + "friendly", "hostPoolType": "Pooled", "loadBalancerType": "BreadthFirst", "maxSessionLimit": + 999999, "personalDesktopAssignmentType": "Automatic", "preferredAppGroupType": + "Desktop", "registrationInfo": {"expirationTime": "2024-03-05T06:38:08.189Z", + "registrationTokenOperation": "Update"}, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": + "https://keyvault/secret", "ssoSecretType": "SharedKey", "startVMOnConnect": + false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool create + Connection: + - keep-alive + Content-Length: + - '511' + Content-Type: + - application/json + ParameterSetName: + - --name -g --description --friendly-name --host-pool-type --load-balancer-type + --max-session-limit --personal-desktop-assignment-type --preferred-app-group-type + --registration-info --sso-client-id --sso-client-secret-key-vault-path --sso-secret-type + --start-vm-on-connect + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002?api-version=2021-07-12 + response: + body: + string: '{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": null, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T03:45:53.52Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T03:45:53.52Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": {"expirationTime": + "2024-03-05T06:38:08.189Z", "token": null, "registrationTokenOperation": "Update"}, + "vmTemplate": null, "preferredAppGroupType": "Desktop", "migrationRequest": + null, "cloudPcResource": false, "startVMOnConnect": false, "ssoadfsAuthority": + null, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", + "ssoSecretType": "SharedKey", "objectId": "b6a1069a-3680-48d1-b15b-256860722962"}}' + headers: + cache-control: + - no-cache + content-length: + - '1588' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:45:54 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002 + pragma: + - no-cache + set-cookie: + - ARRAffinity=7bcb77c12c21506594bbc84c20a4a2891f6d7f0bda0e4b28f63e983b7e57b6d3;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=7bcb77c12c21506594bbc84c20a4a2891f6d7f0bda0e4b28f63e983b7e57b6d3;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 77247aab-8d63-4fdd-8ad7-e561ef759dd1 + x-ms-lamport-ts: + - '5614375940' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeC9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfaW96ZnRv + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 11BBD52FDF6B4B8A9C3FD45A96D9F467 Ref B: TYO201100115025 Ref C: 2024-03-01T03:45:52Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool update + Connection: + - keep-alive + ParameterSetName: + - --name -g --tags + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002?api-version=2021-07-12 + response: + body: + string: '{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": null, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T03:45:53.52Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T03:45:53.52Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": null, "vmTemplate": + null, "preferredAppGroupType": "Desktop", "migrationRequest": null, "cloudPcResource": + false, "startVMOnConnect": false, "ssoadfsAuthority": null, "ssoClientId": + "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", "ssoSecretType": + "SharedKey", "objectId": "b6a1069a-3680-48d1-b15b-256860722962"}}' + headers: + cache-control: + - no-cache + content-length: + - '1491' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:45:56 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=11a8016699cfc7f02a71b1dcc7167bc48c9f1d1eaecce21a8c4e027e0921cdd8;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=11a8016699cfc7f02a71b1dcc7167bc48c9f1d1eaecce21a8c4e027e0921cdd8;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 4cc622e2-523c-468e-93d6-9d7cdc380385 + x-ms-lamport-ts: + - '5614376005' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeC9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfaW96ZnRv + x-msedge-ref: + - 'Ref A: 9A0D72AFA02143ECA57D4CA8B1C4811D Ref B: TYO201100113029 Ref C: 2024-03-01T03:45:56Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "description": "test", "friendlyName": "friendly", "hostPoolType": + "Pooled", "loadBalancerType": "BreadthFirst", "maxSessionLimit": 999999, "preferredAppGroupType": + "Desktop", "ssoClientId": "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", + "ssoSecretType": "SharedKey", "startVMOnConnect": false, "validationEnvironment": + false}, "tags": {"tag": "test"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool update + Connection: + - keep-alive + Content-Length: + - '693' + Content-Type: + - application/json + ParameterSetName: + - --name -g --tags + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002?api-version=2021-07-12 + response: + body: + string: '{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T03:45:53.52Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T03:45:57.27Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": {"expirationTime": + "2024-03-05T06:38:08.189Z", "token": null, "registrationTokenOperation": "None"}, + "vmTemplate": null, "preferredAppGroupType": "Desktop", "migrationRequest": + null, "cloudPcResource": false, "startVMOnConnect": false, "ssoadfsAuthority": + null, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", + "ssoSecretType": "SharedKey", "objectId": "b6a1069a-3680-48d1-b15b-256860722962"}}' + headers: + cache-control: + - no-cache + content-length: + - '1597' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:45:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5dd88b1b095b0bace916bbff8b6816e0a442269c15efc1ddf244384e7f96a14f;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=5dd88b1b095b0bace916bbff8b6816e0a442269c15efc1ddf244384e7f96a14f;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 26f9701a-eebf-4235-9f07-4481c8253873 + x-ms-lamport-ts: + - '5614375357' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeC9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfaW96ZnRv + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 9FAFB13371FE4845BA8A2EC1E7C79293 Ref B: TYO201100113029 Ref C: 2024-03-01T03:45:57Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool show + Connection: + - keep-alive + ParameterSetName: + - --name -g + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002?api-version=2021-07-12 + response: + body: + string: '{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T03:45:53.52Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T03:45:57.27Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": null, "vmTemplate": + null, "preferredAppGroupType": "Desktop", "migrationRequest": null, "cloudPcResource": + false, "startVMOnConnect": false, "ssoadfsAuthority": null, "ssoClientId": + "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", "ssoSecretType": + "SharedKey", "objectId": "b6a1069a-3680-48d1-b15b-256860722962"}}' + headers: + cache-control: + - no-cache + content-length: + - '1502' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:46:01 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=607acc0b60c99d398a1b4a887b17d42dc08c6889973dd3e1514cc34bb8598dbf;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=607acc0b60c99d398a1b4a887b17d42dc08c6889973dd3e1514cc34bb8598dbf;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 75bf7722-6d40-447c-8bd6-9786ff8652c1 + x-ms-lamport-ts: + - '5614375624' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeC9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfaW96ZnRv + x-msedge-ref: + - 'Ref A: 9E3ACF0AC1314C1A8C00664E407AE8EA Ref B: TYO201100116049 Ref C: 2024-03-01T03:46:01Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools?api-version=2021-07-12 + response: + body: + string: '{"value": [{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T03:45:53.52Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T03:45:57.27Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": null, "vmTemplate": + null, "preferredAppGroupType": "Desktop", "migrationRequest": null, "cloudPcResource": + false, "startVMOnConnect": false, "ssoadfsAuthority": null, "ssoClientId": + "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", "ssoSecretType": + "SharedKey", "objectId": "b6a1069a-3680-48d1-b15b-256860722962"}}], "nextLink": + null}' + headers: + cache-control: + - no-cache + content-length: + - '1533' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:46:02 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5d35a7442639fc0711921e32334a8850533656dd03cc677a5addc467ce0ffbe1;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=5d35a7442639fc0711921e32334a8850533656dd03cc677a5addc467ce0ffbe1;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 0a3a6412-7568-43bc-8c46-226bb45f1834 + x-ms-lamport-ts: + - '5614376380' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeA== + x-msedge-ref: + - 'Ref A: 2EBE1B2A72974907AD954C8D5A7432DC Ref B: TYO201100115035 Ref C: 2024-03-01T03:46:02Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool retrieve-registration-token + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -g + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002/retrieveRegistrationToken?api-version=2021-07-12 + response: + body: + string: '{"expirationTime": "2024-03-05T06:38:08.189Z", "token": null, "resetToken": + false, "registrationTokenOperation": "None"}' + headers: + cache-control: + - no-cache + content-length: + - '120' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:46:03 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=a42e49241337d9995315eeb84aeb99a9bb129de89814b49a54798016db5a2698;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=a42e49241337d9995315eeb84aeb99a9bb129de89814b49a54798016db5a2698;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - e0e2487b-7f51-4aec-ae24-6a7d1f0ac816 + x-ms-lamport-ts: + - '5614375651' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeC9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfaW96ZnRv + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 7664583CB90B4CDB938A0DD64AB4C9FF Ref B: TYO201100113053 Ref C: 2024-03-01T03:46:03Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization hostpool delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -g -y + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostPools/hostpool_000002?api-version=2021-07-12 + response: + body: + string: '{"identity": null, "name": "hostpool_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_hostpool_000001/providers/Microsoft.DesktopVirtualization/hostpools/hostpool_000002", + "type": "Microsoft.DesktopVirtualization/hostpools", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T03:45:53.52Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T03:45:57.27Z"}, "properties": {"friendlyName": "friendly", "description": + "test", "hostPoolType": "Pooled", "personalDesktopAssignmentType": null, "applicationGroupReferences": + [], "customRdpProperty": "drivestoredirect:s:*;audiomode:i:0;videoplaybackmode:i:1;redirectclipboard:i:1;redirectprinters:i:1;devicestoredirect:s:*;redirectcomports:i:1;redirectsmartcards:i:1;usbdevicestoredirect:s:*;enablecredsspsupport:i:1;redirectwebauthn:i:1;use + multimon:i:1;", "maxSessionLimit": 999999, "loadBalancerType": "BreadthFirst", + "validationEnvironment": false, "ring": null, "registrationInfo": {"expirationTime": + "2024-03-05T06:38:08.189Z", "token": null, "registrationTokenOperation": "None"}, + "vmTemplate": null, "preferredAppGroupType": "Desktop", "migrationRequest": + null, "cloudPcResource": false, "startVMOnConnect": false, "ssoadfsAuthority": + null, "ssoClientId": "client", "ssoClientSecretKeyVaultPath": "https://keyvault/secret", + "ssoSecretType": "SharedKey", "objectId": "b6a1069a-3680-48d1-b15b-256860722962"}}' + headers: + cache-control: + - no-cache + content-length: + - '1597' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 03:46:13 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=136ead941a19baf9a74bd41f746b55cb14e4cf321e040e50f7bd8162d430922d;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=136ead941a19baf9a74bd41f746b55cb14e4cf321e040e50f7bd8162d430922d;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 12d365a8-18a1-49a5-b05d-cf16a9d8aa56 + x-ms-lamport-ts: + - '5614375807' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX2hvc3Rwb29sX3p0cnB2cDJ4c2oybjRmMmpqMjdhaXNybzRkamxuZ21yeWRmcGpoeC9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi9ob3N0UG9vbHMvaG9zdHBvb2xfaW96ZnRv + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + x-msedge-ref: + - 'Ref A: F8FE59739F4A4A6796E178D8877C272E Ref B: TYO201100117025 Ref C: 2024-03-01T03:46:05Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +version: 1 diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_workspace.yaml b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_workspace.yaml new file mode 100644 index 00000000000..6b2732fffd0 --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/recordings/test_desktopvirtualization_workspace.yaml @@ -0,0 +1,484 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --friendly-name + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001", + "name": "test_desktopvirtualization_workspace_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "centralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_desktopvirtualization_workspace", "date": "2024-03-01T02:51:04Z", + "module": "desktopvirtualization"}, "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '467' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 9DBCABC9E3604FF7A867368FC8D67423 Ref B: TYO201100115047 Ref C: 2024-03-01T02:51:07Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"friendlyName": "friendly"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace create + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + ParameterSetName: + - -g -n --friendly-name + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002?api-version=2021-07-12 + response: + body: + string: '{"name": "workspace_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002", + "type": "Microsoft.DesktopVirtualization/workspaces", "location": "centralus", + "tags": null, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:51:09.11Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:51:09.11Z"}, "properties": {"description": null, "friendlyName": + "friendly", "applicationGroupReferences": [], "cloudPcResource": false, "objectId": + "eab13b18-d69e-47be-98b2-d214a3567afc"}}' + headers: + cache-control: + - no-cache + content-length: + - '749' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:09 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002 + pragma: + - no-cache + set-cookie: + - ARRAffinity=b34b3aa3b73c20633be4db36b45b4eabb1f2f2707b98216dd9e344acdede2909;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=b34b3aa3b73c20633be4db36b45b4eabb1f2f2707b98216dd9e344acdede2909;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - e22cc552-d4e9-4de9-881a-72cb7450badf + x-ms-lamport-ts: + - '5614186238' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX3dvcmtzcGFjZV9ydnU3ZHMzdHFnbWx2aGpyaDNjcnRsdDZhaHl4aWtiZGN0eHNrdi9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZV9neGNpaA== + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-msedge-ref: + - 'Ref A: DE5513896FAB4D92B2B86F36474BC2BD Ref B: TYO201100113023 Ref C: 2024-03-01T02:51:08Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002?api-version=2021-07-12 + response: + body: + string: '{"name": "workspace_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002", + "type": "Microsoft.DesktopVirtualization/workspaces", "location": "centralus", + "tags": null, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:51:09.11Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:51:09.11Z"}, "properties": {"description": null, "friendlyName": + "friendly", "applicationGroupReferences": [], "cloudPcResource": false, "objectId": + "eab13b18-d69e-47be-98b2-d214a3567afc"}}' + headers: + cache-control: + - no-cache + content-length: + - '749' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:10 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=171233ed02bc6bc6d9f6a1e68fe312a742cdbf4a141973a357f9d9f07ff6c89a;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=171233ed02bc6bc6d9f6a1e68fe312a742cdbf4a141973a357f9d9f07ff6c89a;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 33d8b59c-f651-473d-a51b-8bc96c85a3ef + x-ms-lamport-ts: + - '5614186232' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX3dvcmtzcGFjZV9ydnU3ZHMzdHFnbWx2aGpyaDNjcnRsdDZhaHl4aWtiZGN0eHNrdi9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZV9neGNpaA== + x-msedge-ref: + - 'Ref A: 8D0C93F40739494EA29C1F77FC9B187D Ref B: TYO201100116037 Ref C: 2024-03-01T02:51:10Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"applicationGroupReferences": + [], "friendlyName": "friendly"}, "tags": {"tag": "test"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace update + Connection: + - keep-alive + Content-Length: + - '128' + Content-Type: + - application/json + ParameterSetName: + - -g -n --tags + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002?api-version=2021-07-12 + response: + body: + string: '{"name": "workspace_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002", + "type": "Microsoft.DesktopVirtualization/workspaces", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:51:09.11Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:51:11.86Z"}, "properties": {"description": null, "friendlyName": + "friendly", "applicationGroupReferences": [], "cloudPcResource": false, "objectId": + "eab13b18-d69e-47be-98b2-d214a3567afc"}}' + headers: + cache-control: + - no-cache + content-length: + - '760' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:13 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3f1534e0112c1392eb84f7c0e4028513a1245721c23b8a0853e115a5a59342c9;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=3f1534e0112c1392eb84f7c0e4028513a1245721c23b8a0853e115a5a59342c9;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - 578267ca-0c5f-43ac-9fe4-59da6f863eb2 + x-ms-lamport-ts: + - '5614185353' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX3dvcmtzcGFjZV9ydnU3ZHMzdHFnbWx2aGpyaDNjcnRsdDZhaHl4aWtiZGN0eHNrdi9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZV9neGNpaA== + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: E9F5BC4F6EDF4244A1560C47143E5904 Ref B: TYO201100116037 Ref C: 2024-03-01T02:51:11Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002?api-version=2021-07-12 + response: + body: + string: '{"name": "workspace_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002", + "type": "Microsoft.DesktopVirtualization/workspaces", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:51:09.11Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:51:11.86Z"}, "properties": {"description": null, "friendlyName": + "friendly", "applicationGroupReferences": [], "cloudPcResource": false, "objectId": + "eab13b18-d69e-47be-98b2-d214a3567afc"}}' + headers: + cache-control: + - no-cache + content-length: + - '760' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:14 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b91d554c77a2e6cae448ed7a2f5e5d19cf3ae21b0eeb9d677ca3780c44c75ae;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=0b91d554c77a2e6cae448ed7a2f5e5d19cf3ae21b0eeb9d677ca3780c44c75ae;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - ece0b3cd-a2f6-4668-8e73-92e46711a352 + x-ms-lamport-ts: + - '5614181396' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX3dvcmtzcGFjZV9ydnU3ZHMzdHFnbWx2aGpyaDNjcnRsdDZhaHl4aWtiZGN0eHNrdi9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZV9neGNpaA== + x-msedge-ref: + - 'Ref A: 992037902D2048F490F01A12355A63D5 Ref B: TYO201100114023 Ref C: 2024-03-01T02:51:14Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces?api-version=2021-07-12 + response: + body: + string: '{"value": [{"name": "workspace_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002", + "type": "Microsoft.DesktopVirtualization/workspaces", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": {"createdBy": "v-jingszhang@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-01T02:51:09.11Z", "lastModifiedBy": + "v-jingszhang@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-01T02:51:11.86Z"}, "properties": {"description": null, "friendlyName": + "friendly", "applicationGroupReferences": [], "cloudPcResource": false, "objectId": + "eab13b18-d69e-47be-98b2-d214a3567afc"}}], "nextLink": null}' + headers: + cache-control: + - no-cache + content-length: + - '791' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:15 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=4c87a3fd2d13fe8deabf01a0da1890a3564e836c7c9f153e312617237a9297d0;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=4c87a3fd2d13fe8deabf01a0da1890a3564e836c7c9f153e312617237a9297d0;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - bbd3dc9c-a986-4e8b-b2dc-1ee2fff591d9 + x-ms-lamport-ts: + - '5614183354' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX3dvcmtzcGFjZV9ydnU3ZHMzdHFnbWx2aGpyaDNjcnRsdDZhaHl4aWtiZGN0eHNrdg== + x-msedge-ref: + - 'Ref A: 4EEBA19B9B0F41AB83A94DF4A85F4935 Ref B: TYO201100114011 Ref C: 2024-03-01T02:51:15Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - desktopvirtualization workspace delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n -y + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002?api-version=2021-07-12 + response: + body: + string: '{"name": "workspace_000002", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_desktopvirtualization_workspace_000001/providers/Microsoft.DesktopVirtualization/workspaces/workspace_000002", + "type": "Microsoft.DesktopVirtualization/workspaces", "location": "centralus", + "tags": {"tag": "test"}, "kind": null, "systemData": null, "properties": {"description": + null, "friendlyName": "friendly", "applicationGroupReferences": [], "cloudPcResource": + false, "objectId": "eab13b18-d69e-47be-98b2-d214a3567afc"}}' + headers: + cache-control: + - no-cache + content-length: + - '533' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Mar 2024 02:51:20 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=25cc4b4586ede118c310f31c65c0e1c74b3280b9c5b1007cd54b39f9ae36d767;Path=/;HttpOnly;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + - ARRAffinitySameSite=25cc4b4586ede118c310f31c65c0e1c74b3280b9c5b1007cd54b39f9ae36d767;Path=/;HttpOnly;SameSite=None;Secure;Domain=rdarmprovider-g-us-r0.wvd.microsoft.com + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-correlation-id: + - f190e664-8e10-418c-9b16-ff1f26cafe30 + x-ms-lamport-ts: + - '5614186453' + x-ms-opsarmpath64: + - L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3Rlc3RfZGVza3RvcHZpcnR1YWxpemF0aW9uX3dvcmtzcGFjZV9ydnU3ZHMzdHFnbWx2aGpyaDNjcnRsdDZhaHl4aWtiZGN0eHNrdi9wcm92aWRlcnMvTWljcm9zb2Z0LkRlc2t0b3BWaXJ0dWFsaXphdGlvbi93b3Jrc3BhY2VzL3dvcmtzcGFjZV9neGNpaA== + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-msedge-ref: + - 'Ref A: DA74B0115E00497A8CB4EE01A7C31D1B Ref B: TYO201100114039 Ref C: 2024-03-01T02:51:17Z' + x-powered-by: + - ASP.NET + x-rate-limit-limit: + - '0' + x-rate-limit-remaining: + - '9223372036854775807' + x-rate-limit-reset: + - '0' + status: + code: 200 + message: OK +version: 1 diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization.py b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization.py new file mode 100644 index 00000000000..c1d83c5184d --- /dev/null +++ b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization.py @@ -0,0 +1,168 @@ +# -------------------------------------------------------------------------------------------- +# 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.testsdk import * +from .recording_processors import TokenReplacer + + +class DesktopvirtualizationScenario(ScenarioTest): + def __init__(self, method_name): + super().__init__(method_name, recording_processors=[ + TokenReplacer() + ]) + + @ResourceGroupPreparer(name_prefix='test_desktopvirtualization_hostpool_', location='centralus') + def test_desktopvirtualization_hostpool(self): + self.kwargs.update({ + 'hostpool': self.create_random_name('hostpool_', 15) + }) + self.cmd('desktopvirtualization hostpool create --name {hostpool} -g {rg} ' + '--description test --friendly-name friendly --host-pool-type Pooled ' + '--load-balancer-type BreadthFirst --max-session-limit 999999 ' + '--personal-desktop-assignment-type Automatic --preferred-app-group-type Desktop ' + '--registration-info expiration-time="2024-03-05T06:38:08.189Z" registration-token-operation=Update ' + '--sso-client-id client ' + '--sso-client-secret-key-vault-path https://keyvault/secret ' + '--sso-secret-type SharedKey ' + '--start-vm-on-connect false ', checks=[ + self.check('name', '{hostpool}'), + self.check('friendlyName', 'friendly'), + self.check('hostPoolType', 'Pooled'), + self.check('loadBalancerType', 'BreadthFirst'), + self.check('maxSessionLimit', 999999), + self.check('preferredAppGroupType', 'Desktop'), + self.check('registrationInfo.expirationTime', '2024-03-05T06:38:08.189Z'), + self.check('ssoClientId', 'client'), + self.check('ssoClientSecretKeyVaultPath', 'https://keyvault/secret'), + self.check('ssoSecretType', 'SharedKey'), + self.check('startVMOnConnect', False) + ]) + self.cmd('desktopvirtualization hostpool update --name {hostpool} -g {rg} --tags tag=test ', checks=[ + self.check('name', '{hostpool}'), + self.check('friendlyName', 'friendly'), + self.check('hostPoolType', 'Pooled'), + self.check('loadBalancerType', 'BreadthFirst'), + self.check('maxSessionLimit', 999999), + self.check('preferredAppGroupType', 'Desktop'), + self.check('registrationInfo.expirationTime', '2024-03-05T06:38:08.189Z'), + self.check('ssoClientId', 'client'), + self.check('ssoClientSecretKeyVaultPath', 'https://keyvault/secret'), + self.check('ssoSecretType', 'SharedKey'), + self.check('startVMOnConnect', False), + self.check('tags.tag', 'test') + ]) + self.cmd('desktopvirtualization hostpool show --name {hostpool} -g {rg}', checks=[ + self.check('name', '{hostpool}'), + self.check('friendlyName', 'friendly'), + self.check('hostPoolType', 'Pooled'), + self.check('loadBalancerType', 'BreadthFirst'), + self.check('maxSessionLimit', 999999), + self.check('preferredAppGroupType', 'Desktop'), + self.check('ssoClientId', 'client'), + self.check('ssoClientSecretKeyVaultPath', 'https://keyvault/secret'), + self.check('ssoSecretType', 'SharedKey'), + self.check('startVMOnConnect', False), + self.check('tags.tag', 'test') + ]) + self.cmd('desktopvirtualization hostpool list -g {rg}', checks=[ + self.check('[0].name', '{hostpool}'), + self.check('[0].friendlyName', 'friendly'), + self.check('[0].hostPoolType', 'Pooled'), + self.check('[0].loadBalancerType', 'BreadthFirst'), + self.check('[0].maxSessionLimit', 999999), + self.check('[0].preferredAppGroupType', 'Desktop'), + self.check('[0].ssoClientId', 'client'), + self.check('[0].ssoClientSecretKeyVaultPath', 'https://keyvault/secret'), + self.check('[0].ssoSecretType', 'SharedKey'), + self.check('[0].startVMOnConnect', False), + self.check('[0].tags.tag', 'test') + ]) + self.cmd('desktopvirtualization hostpool retrieve-registration-token --name {hostpool} -g {rg}', checks=[ + self.check('expirationTime', '2024-03-05T06:38:08.189Z') + ]) + self.cmd('desktopvirtualization hostpool delete --name {hostpool} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='test_desktopvirtualization_applicationgroup_', location='centralus') + def test_desktopvirtualization_applicationgroup(self): + self.kwargs.update({ + 'hostpool': self.create_random_name('hostpool_', 15), + 'applicationgroup': self.create_random_name('appgroup', 15) + }) + hostpool = self.cmd('desktopvirtualization hostpool create --name {hostpool} -g {rg} ' + '--description test --friendly-name friendly --host-pool-type Pooled ' + '--load-balancer-type BreadthFirst --max-session-limit 999999 ' + '--personal-desktop-assignment-type Automatic --preferred-app-group-type Desktop ' + '--registration-info expiration-time="2024-03-05T06:38:08.189Z" registration-token-operation=Update ' + '--sso-client-id client ' + '--sso-client-secret-key-vault-path https://keyvault/secret ' + '--sso-secret-type SharedKey ' + '--start-vm-on-connect false ', checks=[ + self.check('name', '{hostpool}'), + self.check('friendlyName', 'friendly'), + self.check('hostPoolType', 'Pooled'), + self.check('loadBalancerType', 'BreadthFirst'), + self.check('maxSessionLimit', 999999), + self.check('preferredAppGroupType', 'Desktop'), + self.check('registrationInfo.expirationTime', '2024-03-05T06:38:08.189Z'), + self.check('ssoClientId', 'client'), + self.check('ssoClientSecretKeyVaultPath', 'https://keyvault/secret'), + self.check('ssoSecretType', 'SharedKey'), + self.check('startVMOnConnect', False) + ]).get_output_in_json() + self.kwargs.update({ + 'hostpool_id': hostpool['id'] + }) + self.cmd('desktopvirtualization applicationgroup create -g {rg} -n {applicationgroup} --host-pool-arm-path {hostpool_id} --application-group-type remoteapp', checks=[ + self.check('name', '{applicationgroup}'), + self.check('hostPoolArmPath', '{hostpool_id}'), + self.check('applicationGroupType', 'RemoteApp') + ]) + self.cmd('desktopvirtualization applicationgroup update -g {rg} -n {applicationgroup} --tags tag=test', checks=[ + self.check('name', '{applicationgroup}'), + self.check('hostPoolArmPath', '{hostpool_id}'), + self.check('applicationGroupType', 'RemoteApp'), + self.check('tags.tag', 'test') + ]) + self.cmd('desktopvirtualization applicationgroup show -g {rg} -n {applicationgroup}', checks=[ + self.check('name', '{applicationgroup}'), + self.check('hostPoolArmPath', '{hostpool_id}'), + self.check('applicationGroupType', 'RemoteApp'), + self.check('tags.tag', 'test') + ]) + self.cmd('desktopvirtualization applicationgroup list -g {rg}', checks=[ + self.check('[0].name', '{applicationgroup}'), + self.check('[0].hostPoolArmPath', '{hostpool_id}'), + self.check('[0].applicationGroupType', 'RemoteApp'), + self.check('[0].tags.tag', 'test') + ]) + self.cmd('desktopvirtualization applicationgroup delete -g {rg} -n {applicationgroup} -y') + + @ResourceGroupPreparer(name_prefix='test_desktopvirtualization_workspace_', location='centralus') + def test_desktopvirtualization_workspace(self): + self.kwargs.update({ + 'workspace': self.create_random_name('workspace_', 15) + }) + self.cmd('desktopvirtualization workspace create -g {rg} -n {workspace} --friendly-name friendly', checks=[ + self.check('name', '{workspace}'), + self.check('friendlyName', 'friendly') + ]) + self.cmd('desktopvirtualization workspace update -g {rg} -n {workspace} --tags tag=test', checks=[ + self.check('name', '{workspace}'), + self.check('friendlyName', 'friendly'), + self.check('tags.tag', 'test') + ]) + self.cmd('desktopvirtualization workspace show -g {rg} -n {workspace}', checks=[ + self.check('name', '{workspace}'), + self.check('friendlyName', 'friendly'), + self.check('tags.tag', 'test') + ]) + self.cmd('desktopvirtualization workspace list -g {rg}', checks=[ + self.check('[0].name', '{workspace}'), + self.check('[0].friendlyName', 'friendly'), + self.check('[0].tags.tag', 'test') + ]) + self.cmd('desktopvirtualization workspace delete -g {rg} -n {workspace} -y') diff --git a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization_scenario.py b/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization_scenario.py deleted file mode 100644 index 2501ff63724..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/tests/latest/test_desktopvirtualization_scenario.py +++ /dev/null @@ -1,189 +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_hostpool_create -from .example_steps import step_hostpool_show -from .example_steps import step_hostpool_list -from .example_steps import step_hostpool_list2 -from .example_steps import step_hostpool_update -from .example_steps import step_hostpool_retrieve_registration_token -from .example_steps import step_applicationgroup_create -from .example_steps import step_applicationgroup_show -from .example_steps import step_applicationgroup_list -from .example_steps import step_applicationgroup_list2 -from .example_steps import step_applicationgroup_update -from .example_steps import step_applicationgroup_delete -from .example_steps import step_hostpool_delete -from .example_steps import step_workspace_create -from .example_steps import step_workspace_show -from .example_steps import step_workspace_list -from .example_steps import step_workspace_list2 -from .example_steps import step_workspace_update -from .example_steps import step_workspace_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): - pass - - -# Env cleanup_scenario -@try_manual -def cleanup_scenario(test): - pass - - -# Testcase: Scenario -@try_manual -def call_scenario(test): - setup_scenario(test) - - step_hostpool_create(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("hostPoolType", "Pooled", case_sensitive=False), - test.check("loadBalancerType", "BreadthFirst", case_sensitive=False), - test.check("maxSessionLimit", 999999), - test.check("preferredAppGroupType", "Desktop", case_sensitive=False), - test.check("ssoClientId", "client", case_sensitive=False), - test.check("ssoClientSecretKeyVaultPath", "https://keyvault/secret", case_sensitive=False), - test.check("ssoSecretType", "SharedKey", case_sensitive=False), - test.check("name", "{myHostPool}", case_sensitive=False), - ]) - step_hostpool_show(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("hostPoolType", "Pooled", case_sensitive=False), - test.check("loadBalancerType", "BreadthFirst", case_sensitive=False), - test.check("maxSessionLimit", 999999), - test.check("preferredAppGroupType", "Desktop", case_sensitive=False), - test.check("ssoClientId", "client", case_sensitive=False), - test.check("ssoClientSecretKeyVaultPath", "https://keyvault/secret", case_sensitive=False), - test.check("ssoSecretType", "SharedKey", case_sensitive=False), - test.check("name", "{myHostPool}", case_sensitive=False), - ]) - step_hostpool_list(test, checks=[ - test.check('length(@)', 1), - ]) - step_hostpool_list2(test, checks=[ - test.check('length(@)', 1), - ]) - step_hostpool_update(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("hostPoolType", "Pooled", case_sensitive=False), - test.check("loadBalancerType", "BreadthFirst", case_sensitive=False), - test.check("maxSessionLimit", 999999), - test.check("preferredAppGroupType", "Desktop", case_sensitive=False), - test.check("ssoClientId", "client", case_sensitive=False), - test.check("ssoClientSecretKeyVaultPath", "https://keyvault/secret", case_sensitive=False), - test.check("ssoSecretType", "SharedKey", case_sensitive=False), - test.check("name", "{myHostPool}", case_sensitive=False), - ]) - step_hostpool_retrieve_registration_token(test, checks=[]) - - step_applicationgroup_create(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("applicationGroupType", "RemoteApp", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("hostPoolArmPath", "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Desktop" - "Virtualization/hostPools/{myHostPool}", case_sensitive=False), - test.check("name", "{myApplicationGroup}", case_sensitive=False), - ]) - step_applicationgroup_show(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("applicationGroupType", "RemoteApp", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("hostPoolArmPath", "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Desktop" - "Virtualization/hostPools/{myHostPool}", case_sensitive=False), - test.check("name", "{myApplicationGroup}", case_sensitive=False), - ]) - step_applicationgroup_list(test, checks=[]) - step_applicationgroup_list2(test, checks=[]) - step_applicationgroup_update(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("applicationGroupType", "RemoteApp", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("hostPoolArmPath", "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Desktop" - "Virtualization/hostPools/{myHostPool}", case_sensitive=False), - test.check("name", "{myApplicationGroup}", case_sensitive=False), - ]) - step_applicationgroup_delete(test, checks=[]) - - step_hostpool_delete(test, checks=[]) - step_workspace_create(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("name", "{myWorkspace}", case_sensitive=False), - ]) - step_workspace_show(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("name", "{myWorkspace}", case_sensitive=False), - ]) - step_workspace_list(test, checks=[ - test.check('length(@)', 1), - ]) - step_workspace_list2(test, checks=[ - test.check('length(@)', 1), - ]) - step_workspace_update(test, checks=[ - test.check("location", "centralus", case_sensitive=False), - test.check("description", "des1", case_sensitive=False), - test.check("friendlyName", "friendly", case_sensitive=False), - test.check("name", "{myWorkspace}", case_sensitive=False), - ]) - step_workspace_delete(test, checks=[]) - cleanup_scenario(test) - - -# Test class for Scenario -@try_manual -class DesktopvirtualizationScenarioTest(ScenarioTest): - def __init__(self, *args, **kwargs): - super(DesktopvirtualizationScenarioTest, self).__init__(*args, **kwargs) - self.kwargs.update({ - 'subscription_id': self.get_subscription_id() - }) - - self.kwargs.update({ - 'myWorkspace': 'workspace1', - 'myHostPool': 'hostPool1', - 'myHostPool2': 'hostPool2', - 'myScalingPlan': 'scalingPlan1', - 'myApplicationGroup': 'applicationGroup1', - }) - - @ResourceGroupPreparer(name_prefix='clitestdesktopvirtualization_resourceGroup1'[:7], key='rg', - parameter_name='rg', location='centralus') - def test_desktopvirtualization_Scenario(self, rg): - call_scenario(self) - calc_coverage(__file__) - raise_if() diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/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/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/__init__.py deleted file mode 100644 index fcebd4b5654..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/__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 ._desktop_virtualization_api_client import DesktopVirtualizationAPIClient -from ._version import VERSION - -__version__ = VERSION -__all__ = ['DesktopVirtualizationAPIClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_configuration.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_configuration.py deleted file mode 100644 index fa566f2c1ac..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_configuration.py +++ /dev/null @@ -1,71 +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.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class DesktopVirtualizationAPIClientConfiguration(Configuration): - """Configuration for DesktopVirtualizationAPIClient. - - 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.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> 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(DesktopVirtualizationAPIClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2021-07-12" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-desktopvirtualization/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> 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.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_desktop_virtualization_api_client.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_desktop_virtualization_api_client.py deleted file mode 100644 index 790cf05b1f2..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_desktop_virtualization_api_client.py +++ /dev/null @@ -1,124 +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 DesktopVirtualizationAPIClientConfiguration -from .operations import Operations -from .operations import WorkspacesOperations -from .operations import ScalingPlansOperations -from .operations import ApplicationGroupsOperations -from .operations import StartMenuItemsOperations -from .operations import ApplicationsOperations -from .operations import DesktopsOperations -from .operations import HostPoolsOperations -from .operations import UserSessionsOperations -from .operations import SessionHostsOperations -from .operations import MsixPackagesOperations -from .operations import MsixImagesOperations -from . import models - - -class DesktopVirtualizationAPIClient(object): - """DesktopVirtualizationAPIClient. - - :ivar operations: Operations operations - :vartype operations: desktop_virtualization_api_client.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: desktop_virtualization_api_client.operations.WorkspacesOperations - :ivar scaling_plans: ScalingPlansOperations operations - :vartype scaling_plans: desktop_virtualization_api_client.operations.ScalingPlansOperations - :ivar application_groups: ApplicationGroupsOperations operations - :vartype application_groups: desktop_virtualization_api_client.operations.ApplicationGroupsOperations - :ivar start_menu_items: StartMenuItemsOperations operations - :vartype start_menu_items: desktop_virtualization_api_client.operations.StartMenuItemsOperations - :ivar applications: ApplicationsOperations operations - :vartype applications: desktop_virtualization_api_client.operations.ApplicationsOperations - :ivar desktops: DesktopsOperations operations - :vartype desktops: desktop_virtualization_api_client.operations.DesktopsOperations - :ivar host_pools: HostPoolsOperations operations - :vartype host_pools: desktop_virtualization_api_client.operations.HostPoolsOperations - :ivar user_sessions: UserSessionsOperations operations - :vartype user_sessions: desktop_virtualization_api_client.operations.UserSessionsOperations - :ivar session_hosts: SessionHostsOperations operations - :vartype session_hosts: desktop_virtualization_api_client.operations.SessionHostsOperations - :ivar msix_packages: MsixPackagesOperations operations - :vartype msix_packages: desktop_virtualization_api_client.operations.MsixPackagesOperations - :ivar msix_images: MsixImagesOperations operations - :vartype msix_images: desktop_virtualization_api_client.operations.MsixImagesOperations - :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 - """ - - 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 = DesktopVirtualizationAPIClientConfiguration(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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.scaling_plans = ScalingPlansOperations( - self._client, self._config, self._serialize, self._deserialize) - self.application_groups = ApplicationGroupsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.start_menu_items = StartMenuItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.applications = ApplicationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.desktops = DesktopsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.host_pools = HostPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.user_sessions = UserSessionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.session_hosts = SessionHostsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.msix_packages = MsixPackagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.msix_images = MsixImagesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> DesktopVirtualizationAPIClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/__init__.py deleted file mode 100644 index 3160c7b3c30..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/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 ._desktop_virtualization_api_client import DesktopVirtualizationAPIClient -__all__ = ['DesktopVirtualizationAPIClient'] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_configuration.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_configuration.py deleted file mode 100644 index cf5dbe17ec0..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_configuration.py +++ /dev/null @@ -1,67 +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 - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DesktopVirtualizationAPIClientConfiguration(Configuration): - """Configuration for DesktopVirtualizationAPIClient. - - 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(DesktopVirtualizationAPIClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2021-07-12" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-desktopvirtualization/{}'.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/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_desktop_virtualization_api_client.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_desktop_virtualization_api_client.py deleted file mode 100644 index 3b740dd0647..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/_desktop_virtualization_api_client.py +++ /dev/null @@ -1,118 +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 DesktopVirtualizationAPIClientConfiguration -from .operations import Operations -from .operations import WorkspacesOperations -from .operations import ScalingPlansOperations -from .operations import ApplicationGroupsOperations -from .operations import StartMenuItemsOperations -from .operations import ApplicationsOperations -from .operations import DesktopsOperations -from .operations import HostPoolsOperations -from .operations import UserSessionsOperations -from .operations import SessionHostsOperations -from .operations import MsixPackagesOperations -from .operations import MsixImagesOperations -from .. import models - - -class DesktopVirtualizationAPIClient(object): - """DesktopVirtualizationAPIClient. - - :ivar operations: Operations operations - :vartype operations: desktop_virtualization_api_client.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: desktop_virtualization_api_client.aio.operations.WorkspacesOperations - :ivar scaling_plans: ScalingPlansOperations operations - :vartype scaling_plans: desktop_virtualization_api_client.aio.operations.ScalingPlansOperations - :ivar application_groups: ApplicationGroupsOperations operations - :vartype application_groups: desktop_virtualization_api_client.aio.operations.ApplicationGroupsOperations - :ivar start_menu_items: StartMenuItemsOperations operations - :vartype start_menu_items: desktop_virtualization_api_client.aio.operations.StartMenuItemsOperations - :ivar applications: ApplicationsOperations operations - :vartype applications: desktop_virtualization_api_client.aio.operations.ApplicationsOperations - :ivar desktops: DesktopsOperations operations - :vartype desktops: desktop_virtualization_api_client.aio.operations.DesktopsOperations - :ivar host_pools: HostPoolsOperations operations - :vartype host_pools: desktop_virtualization_api_client.aio.operations.HostPoolsOperations - :ivar user_sessions: UserSessionsOperations operations - :vartype user_sessions: desktop_virtualization_api_client.aio.operations.UserSessionsOperations - :ivar session_hosts: SessionHostsOperations operations - :vartype session_hosts: desktop_virtualization_api_client.aio.operations.SessionHostsOperations - :ivar msix_packages: MsixPackagesOperations operations - :vartype msix_packages: desktop_virtualization_api_client.aio.operations.MsixPackagesOperations - :ivar msix_images: MsixImagesOperations operations - :vartype msix_images: desktop_virtualization_api_client.aio.operations.MsixImagesOperations - :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 - """ - - 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 = DesktopVirtualizationAPIClientConfiguration(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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.scaling_plans = ScalingPlansOperations( - self._client, self._config, self._serialize, self._deserialize) - self.application_groups = ApplicationGroupsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.start_menu_items = StartMenuItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.applications = ApplicationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.desktops = DesktopsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.host_pools = HostPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.user_sessions = UserSessionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.session_hosts = SessionHostsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.msix_packages = MsixPackagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.msix_images = MsixImagesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DesktopVirtualizationAPIClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/__init__.py deleted file mode 100644 index 7fecc9b4d93..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/__init__.py +++ /dev/null @@ -1,35 +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 ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._scaling_plans_operations import ScalingPlansOperations -from ._application_groups_operations import ApplicationGroupsOperations -from ._start_menu_items_operations import StartMenuItemsOperations -from ._applications_operations import ApplicationsOperations -from ._desktops_operations import DesktopsOperations -from ._host_pools_operations import HostPoolsOperations -from ._user_sessions_operations import UserSessionsOperations -from ._session_hosts_operations import SessionHostsOperations -from ._msix_packages_operations import MsixPackagesOperations -from ._msix_images_operations import MsixImagesOperations - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'ScalingPlansOperations', - 'ApplicationGroupsOperations', - 'StartMenuItemsOperations', - 'ApplicationsOperations', - 'DesktopsOperations', - 'HostPoolsOperations', - 'UserSessionsOperations', - 'SessionHostsOperations', - 'MsixPackagesOperations', - 'MsixImagesOperations', -] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_application_groups_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_application_groups_operations.py deleted file mode 100644 index 9c717a2a303..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_application_groups_operations.py +++ /dev/null @@ -1,442 +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.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationGroupsOperations: - """ApplicationGroupsOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - application_group_name: str, - **kwargs - ) -> "models.ApplicationGroup": - """Get an application group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGroup, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ApplicationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - application_group_name: str, - application_group: "models.ApplicationGroup", - **kwargs - ) -> "models.ApplicationGroup": - """Create or update an applicationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_group: Object containing ApplicationGroup definitions. - :type application_group: ~desktop_virtualization_api_client.models.ApplicationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGroup, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ApplicationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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(application_group, 'ApplicationGroup') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - application_group_name: str, - **kwargs - ) -> None: - """Remove an applicationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_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 = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - application_group_name: str, - application_group: Optional["models.ApplicationGroupPatch"] = None, - **kwargs - ) -> "models.ApplicationGroup": - """Update an applicationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_group: Object containing ApplicationGroup definitions. - :type application_group: ~desktop_virtualization_api_client.models.ApplicationGroupPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGroup, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ApplicationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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] - if application_group is not None: - body_content = self._serialize.body(application_group, 'ApplicationGroupPatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - filter: Optional[str] = None, - **kwargs - ) -> AsyncIterable["models.ApplicationGroupList"]: - """List applicationGroups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param filter: OData filter expression. Valid properties for filtering are - applicationGroupType. - :type filter: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGroupList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ApplicationGroupList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroupList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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('ApplicationGroupList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups'} # type: ignore - - def list_by_subscription( - self, - filter: Optional[str] = None, - **kwargs - ) -> AsyncIterable["models.ApplicationGroupList"]: - """List applicationGroups in subscription. - - :param filter: OData filter expression. Valid properties for filtering are - applicationGroupType. - :type filter: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGroupList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ApplicationGroupList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroupList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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('ApplicationGroupList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_applications_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_applications_operations.py deleted file mode 100644 index 2be6bf42a8c..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_applications_operations.py +++ /dev/null @@ -1,384 +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.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationsOperations: - """ApplicationsOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - application_group_name: str, - application_name: str, - **kwargs - ) -> "models.Application": - """Get an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Application, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Application - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Application"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Application', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - application_group_name: str, - application_name: str, - application: "models.Application", - **kwargs - ) -> "models.Application": - """Create or update an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_name: str - :param application: Object containing Application definitions. - :type application: ~desktop_virtualization_api_client.models.Application - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Application, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Application - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Application"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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(application, 'Application') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Application', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Application', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - application_group_name: str, - application_name: str, - **kwargs - ) -> None: - """Remove an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_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 = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - application_group_name: str, - application_name: str, - application: Optional["models.ApplicationPatch"] = None, - **kwargs - ) -> "models.Application": - """Update an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_name: str - :param application: Object containing Application definitions. - :type application: ~desktop_virtualization_api_client.models.ApplicationPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Application, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Application - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Application"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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] - if application is not None: - body_content = self._serialize.body(application, 'ApplicationPatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Application', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - def list( - self, - resource_group_name: str, - application_group_name: str, - **kwargs - ) -> AsyncIterable["models.ApplicationList"]: - """List applications. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_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 ApplicationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ApplicationList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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') - - 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('ApplicationList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_desktops_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_desktops_operations.py deleted file mode 100644 index b62729b1da9..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_desktops_operations.py +++ /dev/null @@ -1,234 +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 DesktopsOperations: - """DesktopsOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - application_group_name: str, - desktop_name: str, - **kwargs - ) -> "models.Desktop": - """Get a desktop. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param desktop_name: The name of the desktop within the specified desktop group. - :type desktop_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Desktop, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Desktop - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Desktop"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'desktopName': self._serialize.url("desktop_name", desktop_name, 'str', max_length=24, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Desktop', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - application_group_name: str, - desktop_name: str, - desktop: Optional["models.DesktopPatch"] = None, - **kwargs - ) -> "models.Desktop": - """Update a desktop. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param desktop_name: The name of the desktop within the specified desktop group. - :type desktop_name: str - :param desktop: Object containing Desktop definitions. - :type desktop: ~desktop_virtualization_api_client.models.DesktopPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Desktop, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Desktop - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Desktop"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'desktopName': self._serialize.url("desktop_name", desktop_name, 'str', max_length=24, 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] - if desktop is not None: - body_content = self._serialize.body(desktop, 'DesktopPatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Desktop', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}'} # type: ignore - - async def list( - self, - resource_group_name: str, - application_group_name: str, - **kwargs - ) -> "models.DesktopList": - """List desktops. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DesktopList, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.DesktopList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DesktopList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - accept = "application/json" - - # Construct URL - url = self.list.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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DesktopList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py deleted file mode 100644 index f742a37c18e..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py +++ /dev/null @@ -1,493 +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.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class HostPoolsOperations: - """HostPoolsOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - host_pool_name: str, - **kwargs - ) -> "models.HostPool": - """Get a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HostPool, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.HostPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HostPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - host_pool_name: str, - host_pool: "models.HostPool", - **kwargs - ) -> "models.HostPool": - """Create or update a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param host_pool: Object containing HostPool definitions. - :type host_pool: ~desktop_virtualization_api_client.models.HostPool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HostPool, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.HostPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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(host_pool, 'HostPool') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('HostPool', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('HostPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - host_pool_name: str, - force: Optional[bool] = None, - **kwargs - ) -> None: - """Remove a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param force: Force flag to delete sessionHost. - :type force: bool - :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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - host_pool_name: str, - host_pool: Optional["models.HostPoolPatch"] = None, - **kwargs - ) -> "models.HostPool": - """Update a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param host_pool: Object containing HostPool definitions. - :type host_pool: ~desktop_virtualization_api_client.models.HostPoolPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HostPool, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.HostPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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] - if host_pool is not None: - body_content = self._serialize.body(host_pool, 'HostPoolPatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HostPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.HostPoolList"]: - """List hostPools. - - :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 HostPoolList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.HostPoolList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPoolList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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('HostPoolList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools'} # type: ignore - - def list( - self, - **kwargs - ) -> AsyncIterable["models.HostPoolList"]: - """List hostPools in subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either HostPoolList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.HostPoolList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPoolList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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('HostPoolList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools'} # type: ignore - - async def retrieve_registration_token( - self, - resource_group_name: str, - host_pool_name: str, - **kwargs - ) -> "models.RegistrationInfo": - """Registration token of the host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegistrationInfo, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.RegistrationInfo - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RegistrationInfo"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - accept = "application/json" - - # Construct URL - url = self.retrieve_registration_token.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RegistrationInfo', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve_registration_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_images_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_images_operations.py deleted file mode 100644 index ae9eea62353..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_images_operations.py +++ /dev/null @@ -1,127 +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 MsixImagesOperations: - """MsixImagesOperations 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: ~desktop_virtualization_api_client.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 expand( - self, - resource_group_name: str, - host_pool_name: str, - msix_image_uri: "models.MsixImageUri", - **kwargs - ) -> AsyncIterable["models.ExpandMsixImageList"]: - """Expands and Lists MSIX packages in an Image, given the Image Path. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_image_uri: Object containing URI to MSIX Image. - :type msix_image_uri: ~desktop_virtualization_api_client.models.MsixImageUri - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpandMsixImageList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ExpandMsixImageList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpandMsixImageList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = "application/json" - accept = "application/json" - - def prepare_request(next_link=None): - # 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') - - if not next_link: - # Construct URL - url = self.expand.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(msix_image_uri, 'MsixImageUri') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(msix_image_uri, 'MsixImageUri') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExpandMsixImageList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - expand.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_packages_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_packages_operations.py deleted file mode 100644 index 9a0ab963a6e..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_msix_packages_operations.py +++ /dev/null @@ -1,388 +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.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MsixPackagesOperations: - """MsixPackagesOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - host_pool_name: str, - msix_package_full_name: str, - **kwargs - ) -> "models.MsixPackage": - """Get a msixpackage. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MsixPackage, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.MsixPackage - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - host_pool_name: str, - msix_package_full_name: str, - msix_package: "models.MsixPackage", - **kwargs - ) -> "models.MsixPackage": - """Create or update a MSIX package. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_name: str - :param msix_package: Object containing MSIX Package definitions. - :type msix_package: ~desktop_virtualization_api_client.models.MsixPackage - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MsixPackage, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.MsixPackage - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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(msix_package, 'MsixPackage') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - host_pool_name: str, - msix_package_full_name: str, - **kwargs - ) -> None: - """Remove an MSIX Package. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - host_pool_name: str, - msix_package_full_name: str, - msix_package: Optional["models.MsixPackagePatch"] = None, - **kwargs - ) -> "models.MsixPackage": - """Update an MSIX Package. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_name: str - :param msix_package: Object containing MSIX Package definitions. - :type msix_package: ~desktop_virtualization_api_client.models.MsixPackagePatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MsixPackage, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.MsixPackage - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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] - if msix_package is not None: - body_content = self._serialize.body(msix_package, 'MsixPackagePatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - def list( - self, - resource_group_name: str, - host_pool_name: str, - **kwargs - ) -> AsyncIterable["models.MsixPackageList"]: - """List MSIX packages in hostpool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MsixPackageList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.MsixPackageList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackageList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - 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('MsixPackageList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_operations.py deleted file mode 100644 index 14f4dbf8b84..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_operations.py +++ /dev/null @@ -1,87 +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: ~desktop_virtualization_api_client.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.ResourceProviderOperationList": - """List all of the available operations the Desktop Virtualization resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ResourceProviderOperationList, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ResourceProviderOperationList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceProviderOperationList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.DesktopVirtualization/operations'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_scaling_plans_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_scaling_plans_operations.py deleted file mode 100644 index 4f42c3c5aaa..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_scaling_plans_operations.py +++ /dev/null @@ -1,504 +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.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ScalingPlansOperations: - """ScalingPlansOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - scaling_plan_name: str, - **kwargs - ) -> "models.ScalingPlan": - """Get a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ScalingPlan, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ScalingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - async def create( - self, - resource_group_name: str, - scaling_plan_name: str, - scaling_plan: "models.ScalingPlan", - **kwargs - ) -> "models.ScalingPlan": - """Create or update a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_name: str - :param scaling_plan: Object containing scaling plan definitions. - :type scaling_plan: ~desktop_virtualization_api_client.models.ScalingPlan - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ScalingPlan, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ScalingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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(scaling_plan, 'ScalingPlan') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - scaling_plan_name: str, - **kwargs - ) -> None: - """Remove a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_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 = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - scaling_plan_name: str, - scaling_plan: Optional["models.ScalingPlanPatch"] = None, - **kwargs - ) -> "models.ScalingPlan": - """Update a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_name: str - :param scaling_plan: Object containing scaling plan definitions. - :type scaling_plan: ~desktop_virtualization_api_client.models.ScalingPlanPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ScalingPlan, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ScalingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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] - if scaling_plan is not None: - body_content = self._serialize.body(scaling_plan, 'ScalingPlanPatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.ScalingPlanList"]: - """List scaling plans. - - :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 ScalingPlanList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ScalingPlanList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlanList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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('ScalingPlanList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.ScalingPlanList"]: - """List scaling plans in subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScalingPlanList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ScalingPlanList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlanList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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('ScalingPlanList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans'} # type: ignore - - def list_by_host_pool( - self, - resource_group_name: str, - host_pool_name: str, - **kwargs - ) -> AsyncIterable["models.ScalingPlanList"]: - """List scaling plan associated with hostpool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScalingPlanList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.ScalingPlanList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlanList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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_host_pool.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - 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('ScalingPlanList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_host_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_session_hosts_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_session_hosts_operations.py deleted file mode 100644 index 67aa4713379..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_session_hosts_operations.py +++ /dev/null @@ -1,315 +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 SessionHostsOperations: - """SessionHostsOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - **kwargs - ) -> "models.SessionHost": - """Get a session host. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SessionHost, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.SessionHost - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SessionHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SessionHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - force: Optional[bool] = None, - **kwargs - ) -> None: - """Remove a SessionHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param force: Force flag to force sessionHost deletion even when userSession exists. - :type force: bool - :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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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') - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - session_host: Optional["models.SessionHostPatch"] = None, - **kwargs - ) -> "models.SessionHost": - """Update a session host. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param session_host: Object containing SessionHost definitions. - :type session_host: ~desktop_virtualization_api_client.models.SessionHostPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SessionHost, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.SessionHost - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SessionHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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] - if session_host is not None: - body_content = self._serialize.body(session_host, 'SessionHostPatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SessionHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} # type: ignore - - def list( - self, - resource_group_name: str, - host_pool_name: str, - **kwargs - ) -> AsyncIterable["models.SessionHostList"]: - """List sessionHosts. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SessionHostList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.SessionHostList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SessionHostList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - 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('SessionHostList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_start_menu_items_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_start_menu_items_operations.py deleted file mode 100644 index 303972ebe25..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_start_menu_items_operations.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. -# -------------------------------------------------------------------------- -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 StartMenuItemsOperations: - """StartMenuItemsOperations 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: ~desktop_virtualization_api_client.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( - self, - resource_group_name: str, - application_group_name: str, - **kwargs - ) -> AsyncIterable["models.StartMenuItemList"]: - """List start menu items in the given application group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_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 StartMenuItemList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.StartMenuItemList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StartMenuItemList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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') - - 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('StartMenuItemList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_user_sessions_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_user_sessions_operations.py deleted file mode 100644 index 0ce7f83e3cb..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_user_sessions_operations.py +++ /dev/null @@ -1,471 +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 UserSessionsOperations: - """UserSessionsOperations 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: ~desktop_virtualization_api_client.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_host_pool( - self, - resource_group_name: str, - host_pool_name: str, - filter: Optional[str] = None, - **kwargs - ) -> AsyncIterable["models.UserSessionList"]: - """List userSessions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param filter: OData filter expression. Valid properties for filtering are userprincipalname - and sessionstate. - :type filter: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UserSessionList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.UserSessionList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserSessionList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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_host_pool.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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('UserSessionList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_host_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions'} # type: ignore - - async def get( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - user_session_id: str, - **kwargs - ) -> "models.UserSession": - """Get a userSession. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UserSession, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.UserSession - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserSession"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - - # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UserSession', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - user_session_id: str, - force: Optional[bool] = None, - **kwargs - ) -> None: - """Remove a userSession. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: str - :param force: Force flag to login off userSession. - :type force: bool - :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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}'} # type: ignore - - def list( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - **kwargs - ) -> AsyncIterable["models.UserSessionList"]: - """List userSessions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UserSessionList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.UserSessionList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserSessionList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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') - - 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('UserSessionList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions'} # type: ignore - - async def disconnect( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - user_session_id: str, - **kwargs - ) -> None: - """Disconnect a userSession. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: 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 = "2021-07-12" - accept = "application/json" - - # Construct URL - url = self.disconnect.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - - # 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - disconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect'} # type: ignore - - async def send_message( - self, - resource_group_name: str, - host_pool_name: str, - session_host_name: str, - user_session_id: str, - send_message: Optional["models.SendMessage"] = None, - **kwargs - ) -> None: - """Send a message to a user. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: str - :param send_message: Object containing message includes title and message body. - :type send_message: ~desktop_virtualization_api_client.models.SendMessage - :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 = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.send_message.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - - # 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] - if send_message is not None: - body_content = self._serialize.body(send_message, 'SendMessage') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - send_message.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_workspaces_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_workspaces_operations.py deleted file mode 100644 index fa33c74a610..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,430 +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.mgmt.core.exceptions import ARMErrorFormat - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations 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: ~desktop_virtualization_api_client.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 get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs - ) -> "models.Workspace": - """Get a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - workspace: "models.Workspace", - **kwargs - ) -> "models.Workspace": - """Create or update a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str - :param workspace: Object containing Workspace definitions. - :type workspace: ~desktop_virtualization_api_client.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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(workspace, 'Workspace') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - workspace_name: str, - **kwargs - ) -> None: - """Remove a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_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 = "2021-07-12" - 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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - workspace_name: str, - workspace: Optional["models.WorkspacePatch"] = None, - **kwargs - ) -> "models.Workspace": - """Update a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str - :param workspace: Object containing Workspace definitions. - :type workspace: ~desktop_virtualization_api_client.models.WorkspacePatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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] - if workspace is not None: - body_content = self._serialize.body(workspace, 'WorkspacePatch') - else: - body_content = None - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.WorkspaceList"]: - """List workspaces. - - :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 WorkspaceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.WorkspaceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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('WorkspaceList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.WorkspaceList"]: - """List workspaces in subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~desktop_virtualization_api_client.models.WorkspaceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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('WorkspaceList', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/__init__.py deleted file mode 100644 index 22b524b83e2..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/__init__.py +++ /dev/null @@ -1,224 +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 Application - from ._models_py3 import ApplicationGroup - from ._models_py3 import ApplicationGroupList - from ._models_py3 import ApplicationGroupPatch - from ._models_py3 import ApplicationList - from ._models_py3 import ApplicationPatch - from ._models_py3 import CloudErrorProperties - from ._models_py3 import Desktop - from ._models_py3 import DesktopList - from ._models_py3 import DesktopPatch - from ._models_py3 import ExpandMsixImage - from ._models_py3 import ExpandMsixImageList - from ._models_py3 import HostPool - from ._models_py3 import HostPoolList - from ._models_py3 import HostPoolPatch - from ._models_py3 import Identity - from ._models_py3 import LogSpecification - from ._models_py3 import MigrationRequestProperties - from ._models_py3 import MsixImageUri - from ._models_py3 import MsixPackage - from ._models_py3 import MsixPackageApplications - from ._models_py3 import MsixPackageDependencies - from ._models_py3 import MsixPackageList - from ._models_py3 import MsixPackagePatch - from ._models_py3 import OperationProperties - from ._models_py3 import Plan - from ._models_py3 import RegistrationInfo - from ._models_py3 import RegistrationInfoPatch - from ._models_py3 import Resource - from ._models_py3 import ResourceModelWithAllowedPropertySet - from ._models_py3 import ResourceModelWithAllowedPropertySetIdentity - from ._models_py3 import ResourceModelWithAllowedPropertySetPlan - from ._models_py3 import ResourceModelWithAllowedPropertySetSku - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import ScalingHostPoolReference - from ._models_py3 import ScalingPlan - from ._models_py3 import ScalingPlanList - from ._models_py3 import ScalingPlanPatch - from ._models_py3 import ScalingSchedule - from ._models_py3 import SendMessage - from ._models_py3 import ServiceSpecification - from ._models_py3 import SessionHost - from ._models_py3 import SessionHostHealthCheckFailureDetails - from ._models_py3 import SessionHostHealthCheckReport - from ._models_py3 import SessionHostList - from ._models_py3 import SessionHostPatch - from ._models_py3 import Sku - from ._models_py3 import StartMenuItem - from ._models_py3 import StartMenuItemList - from ._models_py3 import UserSession - from ._models_py3 import UserSessionList - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceList - from ._models_py3 import WorkspacePatch -except (SyntaxError, ImportError): - from ._models import Application # type: ignore - from ._models import ApplicationGroup # type: ignore - from ._models import ApplicationGroupList # type: ignore - from ._models import ApplicationGroupPatch # type: ignore - from ._models import ApplicationList # type: ignore - from ._models import ApplicationPatch # type: ignore - from ._models import CloudErrorProperties # type: ignore - from ._models import Desktop # type: ignore - from ._models import DesktopList # type: ignore - from ._models import DesktopPatch # type: ignore - from ._models import ExpandMsixImage # type: ignore - from ._models import ExpandMsixImageList # type: ignore - from ._models import HostPool # type: ignore - from ._models import HostPoolList # type: ignore - from ._models import HostPoolPatch # type: ignore - from ._models import Identity # type: ignore - from ._models import LogSpecification # type: ignore - from ._models import MigrationRequestProperties # type: ignore - from ._models import MsixImageUri # type: ignore - from ._models import MsixPackage # type: ignore - from ._models import MsixPackageApplications # type: ignore - from ._models import MsixPackageDependencies # type: ignore - from ._models import MsixPackageList # type: ignore - from ._models import MsixPackagePatch # type: ignore - from ._models import OperationProperties # type: ignore - from ._models import Plan # type: ignore - from ._models import RegistrationInfo # type: ignore - from ._models import RegistrationInfoPatch # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceModelWithAllowedPropertySet # type: ignore - from ._models import ResourceModelWithAllowedPropertySetIdentity # type: ignore - from ._models import ResourceModelWithAllowedPropertySetPlan # type: ignore - from ._models import ResourceModelWithAllowedPropertySetSku # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import ScalingHostPoolReference # type: ignore - from ._models import ScalingPlan # type: ignore - from ._models import ScalingPlanList # type: ignore - from ._models import ScalingPlanPatch # type: ignore - from ._models import ScalingSchedule # type: ignore - from ._models import SendMessage # type: ignore - from ._models import ServiceSpecification # type: ignore - from ._models import SessionHost # type: ignore - from ._models import SessionHostHealthCheckFailureDetails # type: ignore - from ._models import SessionHostHealthCheckReport # type: ignore - from ._models import SessionHostList # type: ignore - from ._models import SessionHostPatch # type: ignore - from ._models import Sku # type: ignore - from ._models import StartMenuItem # type: ignore - from ._models import StartMenuItemList # type: ignore - from ._models import UserSession # type: ignore - from ._models import UserSessionList # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceList # type: ignore - from ._models import WorkspacePatch # type: ignore - -from ._desktop_virtualization_api_client_enums import ( - ApplicationGroupType, - ApplicationType, - CommandLineSetting, - HealthCheckName, - HealthCheckResult, - HostPoolType, - LoadBalancerType, - Operation, - PersonalDesktopAssignmentType, - PreferredAppGroupType, - RegistrationTokenOperation, - RemoteApplicationType, - ScalingScheduleDaysOfWeekItem, - SessionHostLoadBalancingAlgorithm, - SessionState, - SkuTier, - SsoSecretType, - Status, - StopHostsWhen, - UpdateState, -) - -__all__ = [ - 'Application', - 'ApplicationGroup', - 'ApplicationGroupList', - 'ApplicationGroupPatch', - 'ApplicationList', - 'ApplicationPatch', - 'CloudErrorProperties', - 'Desktop', - 'DesktopList', - 'DesktopPatch', - 'ExpandMsixImage', - 'ExpandMsixImageList', - 'HostPool', - 'HostPoolList', - 'HostPoolPatch', - 'Identity', - 'LogSpecification', - 'MigrationRequestProperties', - 'MsixImageUri', - 'MsixPackage', - 'MsixPackageApplications', - 'MsixPackageDependencies', - 'MsixPackageList', - 'MsixPackagePatch', - 'OperationProperties', - 'Plan', - 'RegistrationInfo', - 'RegistrationInfoPatch', - 'Resource', - 'ResourceModelWithAllowedPropertySet', - 'ResourceModelWithAllowedPropertySetIdentity', - 'ResourceModelWithAllowedPropertySetPlan', - 'ResourceModelWithAllowedPropertySetSku', - 'ResourceProviderOperation', - 'ResourceProviderOperationDisplay', - 'ResourceProviderOperationList', - 'ScalingHostPoolReference', - 'ScalingPlan', - 'ScalingPlanList', - 'ScalingPlanPatch', - 'ScalingSchedule', - 'SendMessage', - 'ServiceSpecification', - 'SessionHost', - 'SessionHostHealthCheckFailureDetails', - 'SessionHostHealthCheckReport', - 'SessionHostList', - 'SessionHostPatch', - 'Sku', - 'StartMenuItem', - 'StartMenuItemList', - 'UserSession', - 'UserSessionList', - 'Workspace', - 'WorkspaceList', - 'WorkspacePatch', - 'ApplicationGroupType', - 'ApplicationType', - 'CommandLineSetting', - 'HealthCheckName', - 'HealthCheckResult', - 'HostPoolType', - 'LoadBalancerType', - 'Operation', - 'PersonalDesktopAssignmentType', - 'PreferredAppGroupType', - 'RegistrationTokenOperation', - 'RemoteApplicationType', - 'ScalingScheduleDaysOfWeekItem', - 'SessionHostLoadBalancingAlgorithm', - 'SessionState', - 'SkuTier', - 'SsoSecretType', - 'Status', - 'StopHostsWhen', - 'UpdateState', -] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py deleted file mode 100644 index 61a6b2cff2c..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py +++ /dev/null @@ -1,213 +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 ApplicationGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Resource Type of ApplicationGroup. - """ - - REMOTE_APP = "RemoteApp" - DESKTOP = "Desktop" - -class ApplicationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Application type of application. - """ - - REMOTE_APP = "RemoteApp" - DESKTOP = "Desktop" - -class CommandLineSetting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies whether this published application can be launched with command line arguments - provided by the client, command line arguments specified at publish time, or no command line - arguments at all. - """ - - DO_NOT_ALLOW = "DoNotAllow" - ALLOW = "Allow" - REQUIRE = "Require" - -class HealthCheckName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents the name of the health check operation performed. - """ - - DOMAIN_JOINED_CHECK = "DomainJoinedCheck" #: Verifies the SessionHost is joined to a domain. If this check fails is classified as fatal as no connection can succeed if the SessionHost is not joined to the domain. - DOMAIN_TRUST_CHECK = "DomainTrustCheck" #: Verifies the SessionHost is not experiencing domain trust issues that will prevent authentication on SessionHost at connection time when session is created. If this check fails is classified as fatal as no connection can succeed if we cannot reach the domain for authentication on the SessionHost. - FS_LOGIX_HEALTH_CHECK = "FSLogixHealthCheck" #: Verifies the FSLogix service is up and running to make sure users' profiles are loaded in the session. If this check fails is classified as fatal as even if the connection can succeed, user experience is bad as the user profile cannot be loaded and user will get a temporary profile in the session. - SX_S_STACK_LISTENER_CHECK = "SxSStackListenerCheck" #: Verifies that the SxS stack is up and running so connections can succeed. If this check fails is classified as fatal as no connection can succeed if the SxS stack is not ready. - URLS_ACCESSIBLE_CHECK = "UrlsAccessibleCheck" #: Verifies that the required WVD service and Geneva URLs are reachable from the SessionHost. These URLs are: RdTokenUri, RdBrokerURI, RdDiagnosticsUri and storage blob URLs for agent monitoring (geneva). If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is unable to store warm path data (logs, operations ...). - MONITORING_AGENT_CHECK = "MonitoringAgentCheck" #: Verifies that the required Geneva agent is running. If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is missing or running (possibly) older version. - DOMAIN_REACHABLE = "DomainReachable" #: Verifies the domain the SessionHost is joined to is still reachable. If this check fails is classified as fatal as no connection can succeed if the domain the SessionHost is joined is not reachable at the time of connection. - WEB_RTC_REDIRECTOR_CHECK = "WebRTCRedirectorCheck" #: Verifies whether the WebRTCRedirector component is healthy. The WebRTCRedirector component is used to optimize video and audio performance in Microsoft Teams. This checks whether the component is still running, and whether there is a higher version available. If this check fails, it is non fatal and the machine still can service connections, main issue may be the WebRTCRedirector component has to be restarted or updated. - SUPPORTED_ENCRYPTION_CHECK = "SupportedEncryptionCheck" #: Verifies the value of SecurityLayer registration key. If the value is 0 (SecurityLayer.RDP) this check fails with Error code = NativeMethodErrorCode.E_FAIL and is fatal. If the value is 1 (SecurityLayer.Negotiate) this check fails with Error code = NativeMethodErrorCode.ERROR_SUCCESS and is non fatal. - META_DATA_SERVICE_CHECK = "MetaDataServiceCheck" #: Verifies the metadata service is accessible and return compute properties. - APP_ATTACH_HEALTH_CHECK = "AppAttachHealthCheck" #: Verifies that the AppAttachService is healthy (there were no issues during package staging). The AppAttachService is used to enable the staging/registration (and eventual deregistration/destaging) of MSIX apps that have been set up by the tenant admin. This checks whether the component had any failures during package staging. Failures in staging will prevent some MSIX apps from working properly for the end user. If this check fails, it is non fatal and the machine still can service connections, main issue may be certain apps will not work for end-users. - -class HealthCheckResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents the Health state of the health check we performed. - """ - - UNKNOWN = "Unknown" #: Health check result is not currently known. - HEALTH_CHECK_SUCCEEDED = "HealthCheckSucceeded" #: Health check passed. - HEALTH_CHECK_FAILED = "HealthCheckFailed" #: Health check failed. - SESSION_HOST_SHUTDOWN = "SessionHostShutdown" #: We received a Shutdown notification. - -class HostPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """HostPool type for desktop. - """ - - PERSONAL = "Personal" #: Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType = Direct) or upon connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to their assigned SessionHost. - POOLED = "Pooled" #: Users get a new (random) SessionHost every time it connects to the HostPool. - BYO_DESKTOP = "BYODesktop" #: Users assign their own machines, load balancing logic remains the same as Personal. PersonalDesktopAssignmentType must be Direct. - -class LoadBalancerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of the load balancer. - """ - - BREADTH_FIRST = "BreadthFirst" - DEPTH_FIRST = "DepthFirst" - PERSISTENT = "Persistent" - -class Operation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of operation for migration. - """ - - START = "Start" #: Start the migration. - REVOKE = "Revoke" #: Revoke the migration. - COMPLETE = "Complete" #: Complete the migration. - HIDE = "Hide" #: Hide the hostpool. - UNHIDE = "Unhide" #: Unhide the hostpool. - -class PersonalDesktopAssignmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """PersonalDesktopAssignment type for HostPool. - """ - - AUTOMATIC = "Automatic" - DIRECT = "Direct" - -class PreferredAppGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of preferred application group type, default to Desktop Application Group - """ - - NONE = "None" - DESKTOP = "Desktop" - RAIL_APPLICATIONS = "RailApplications" - -class RegistrationTokenOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of resetting the token. - """ - - DELETE = "Delete" - NONE = "None" - UPDATE = "Update" - -class RemoteApplicationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Resource Type of Application. - """ - - IN_BUILT = "InBuilt" - MSIX_APPLICATION = "MsixApplication" - -class ScalingScheduleDaysOfWeekItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SUNDAY = "Sunday" - MONDAY = "Monday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" - THURSDAY = "Thursday" - FRIDAY = "Friday" - SATURDAY = "Saturday" - -class SessionHostLoadBalancingAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Load balancing algorithm for ramp up period. - """ - - BREADTH_FIRST = "BreadthFirst" - DEPTH_FIRST = "DepthFirst" - -class SessionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """State of user session. - """ - - UNKNOWN = "Unknown" - ACTIVE = "Active" - DISCONNECTED = "Disconnected" - PENDING = "Pending" - LOG_OFF = "LogOff" - USER_PROFILE_DISK_MOUNTED = "UserProfileDiskMounted" - -class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SsoSecretType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of single sign on Secret Type. - """ - - SHARED_KEY = "SharedKey" - CERTIFICATE = "Certificate" - SHARED_KEY_IN_KEY_VAULT = "SharedKeyInKeyVault" - CERTIFICATE_IN_KEY_VAULT = "CertificateInKeyVault" - -class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status for a SessionHost. - """ - - AVAILABLE = "Available" #: Session Host has passed all the health checks and is available to handle connections. - UNAVAILABLE = "Unavailable" #: Session Host is either turned off or has failed critical health checks which is causing service not to be able to route connections to this session host. Note this replaces previous 'NoHeartBeat' status. - SHUTDOWN = "Shutdown" #: Session Host is shutdown - RD Agent reported session host to be stopped or deallocated. - DISCONNECTED = "Disconnected" #: The Session Host is unavailable because it is currently disconnected. - UPGRADING = "Upgrading" #: Session Host is unavailable because currently an upgrade of RDAgent/side-by-side stack is in progress. Note: this state will be removed once the upgrade completes and the host is able to accept connections. - UPGRADE_FAILED = "UpgradeFailed" #: Session Host is unavailable because the critical component upgrade (agent, side-by-side stack, etc.) failed. - NO_HEARTBEAT = "NoHeartbeat" #: The Session Host is not heart beating. - NOT_JOINED_TO_DOMAIN = "NotJoinedToDomain" #: SessionHost is not joined to domain. - DOMAIN_TRUST_RELATIONSHIP_LOST = "DomainTrustRelationshipLost" #: SessionHost's domain trust relationship lost. - SX_S_STACK_LISTENER_NOT_READY = "SxSStackListenerNotReady" #: SxS stack installed on the SessionHost is not ready to receive connections. - FS_LOGIX_NOT_HEALTHY = "FSLogixNotHealthy" #: FSLogix is in an unhealthy state on the session host. - NEEDS_ASSISTANCE = "NeedsAssistance" #: New status to inform admins that the health on their endpoint needs to be fixed. The connections might not fail, as these issues are not fatal. - -class StopHostsWhen(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies when to stop hosts during ramp down period. - """ - - ZERO_SESSIONS = "ZeroSessions" - ZERO_ACTIVE_SESSIONS = "ZeroActiveSessions" - -class UpdateState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Update state of a SessionHost. - """ - - INITIAL = "Initial" - PENDING = "Pending" - STARTED = "Started" - SUCCEEDED = "Succeeded" - FAILED = "Failed" diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models.py deleted file mode 100644 index 0791145c654..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models.py +++ /dev/null @@ -1,2702 +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 msrest.serialization - - -class Resource(msrest.serialization.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 Application(Resource): - """Schema for Application properties. - - 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 - :ivar object_id: ObjectId of Application. (internal use). - :vartype object_id: str - :param description: Description of Application. - :type description: str - :param friendly_name: Friendly name of Application. - :type friendly_name: str - :param file_path: Specifies a path for the executable file for the application. - :type file_path: str - :param msix_package_family_name: Specifies the package family name for MSIX applications. - :type msix_package_family_name: str - :param msix_package_application_id: Specifies the package application Id for MSIX applications. - :type msix_package_application_id: str - :param application_type: Resource Type of Application. Possible values include: "InBuilt", - "MsixApplication". - :type application_type: str or ~desktop_virtualization_api_client.models.RemoteApplicationType - :param command_line_setting: Required. Specifies whether this published application can be - launched with command line arguments provided by the client, command line arguments specified - at publish time, or no command line arguments at all. Possible values include: "DoNotAllow", - "Allow", "Require". - :type command_line_setting: str or ~desktop_virtualization_api_client.models.CommandLineSetting - :param command_line_arguments: Command Line Arguments for Application. - :type command_line_arguments: str - :param show_in_portal: Specifies whether to show the RemoteApp program in the RD Web Access - server. - :type show_in_portal: bool - :param icon_path: Path to icon. - :type icon_path: str - :param icon_index: Index of the icon. - :type icon_index: int - :ivar icon_hash: Hash of the icon. - :vartype icon_hash: str - :ivar icon_content: the icon a 64 bit string as a byte array. - :vartype icon_content: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - 'command_line_setting': {'required': True}, - 'icon_hash': {'readonly': True}, - 'icon_content': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'file_path': {'key': 'properties.filePath', 'type': 'str'}, - 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, - 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, - 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, - 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, - 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, - 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, - 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, - 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, - 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, - 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(Application, self).__init__(**kwargs) - self.object_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.file_path = kwargs.get('file_path', None) - self.msix_package_family_name = kwargs.get('msix_package_family_name', None) - self.msix_package_application_id = kwargs.get('msix_package_application_id', None) - self.application_type = kwargs.get('application_type', None) - self.command_line_setting = kwargs['command_line_setting'] - self.command_line_arguments = kwargs.get('command_line_arguments', None) - self.show_in_portal = kwargs.get('show_in_portal', None) - self.icon_path = kwargs.get('icon_path', None) - self.icon_index = kwargs.get('icon_index', None) - self.icon_hash = None - self.icon_content = None - - -class ResourceModelWithAllowedPropertySet(msrest.serialization.Model): - """The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. - - 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 - :param location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceModelWithAllowedPropertySet, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.managed_by = kwargs.get('managed_by', None) - self.kind = kwargs.get('kind', None) - self.etag = None - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.plan = kwargs.get('plan', None) - - -class ApplicationGroup(ResourceModelWithAllowedPropertySet): - """Represents a ApplicationGroup 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. - - :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 location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of ApplicationGroup. (internal use). - :vartype object_id: str - :param description: Description of ApplicationGroup. - :type description: str - :param friendly_name: Friendly name of ApplicationGroup. - :type friendly_name: str - :param host_pool_arm_path: Required. HostPool arm path of ApplicationGroup. - :type host_pool_arm_path: str - :ivar workspace_arm_path: Workspace arm path of ApplicationGroup. - :vartype workspace_arm_path: str - :param application_group_type: Required. Resource Type of ApplicationGroup. Possible values - include: "RemoteApp", "Desktop". - :type application_group_type: str or - ~desktop_virtualization_api_client.models.ApplicationGroupType - :param migration_request: The registration info of HostPool. - :type migration_request: ~desktop_virtualization_api_client.models.MigrationRequestProperties - :ivar cloud_pc_resource: Is cloud pc resource. - :vartype cloud_pc_resource: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - 'host_pool_arm_path': {'required': True}, - 'workspace_arm_path': {'readonly': True}, - 'application_group_type': {'required': True}, - 'cloud_pc_resource': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'host_pool_arm_path': {'key': 'properties.hostPoolArmPath', 'type': 'str'}, - 'workspace_arm_path': {'key': 'properties.workspaceArmPath', 'type': 'str'}, - 'application_group_type': {'key': 'properties.applicationGroupType', 'type': 'str'}, - 'migration_request': {'key': 'properties.migrationRequest', 'type': 'MigrationRequestProperties'}, - 'cloud_pc_resource': {'key': 'properties.cloudPcResource', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGroup, self).__init__(**kwargs) - self.object_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.host_pool_arm_path = kwargs['host_pool_arm_path'] - self.workspace_arm_path = None - self.application_group_type = kwargs['application_group_type'] - self.migration_request = kwargs.get('migration_request', None) - self.cloud_pc_resource = None - - -class ApplicationGroupList(msrest.serialization.Model): - """List of ApplicationGroup definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of ApplicationGroup definitions. - :type value: list[~desktop_virtualization_api_client.models.ApplicationGroup] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGroupList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ApplicationGroupPatch(Resource): - """ApplicationGroup properties that can be patched. - - 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 - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of ApplicationGroup. - :type description: str - :param friendly_name: Friendly name of ApplicationGroup. - :type friendly_name: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGroupPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - - -class ApplicationList(msrest.serialization.Model): - """List of Application definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of Application definitions. - :type value: list[~desktop_virtualization_api_client.models.Application] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Application]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ApplicationPatch(msrest.serialization.Model): - """Application properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of Application. - :type description: str - :param friendly_name: Friendly name of Application. - :type friendly_name: str - :param file_path: Specifies a path for the executable file for the application. - :type file_path: str - :param command_line_setting: Specifies whether this published application can be launched with - command line arguments provided by the client, command line arguments specified at publish - time, or no command line arguments at all. Possible values include: "DoNotAllow", "Allow", - "Require". - :type command_line_setting: str or ~desktop_virtualization_api_client.models.CommandLineSetting - :param command_line_arguments: Command Line Arguments for Application. - :type command_line_arguments: str - :param show_in_portal: Specifies whether to show the RemoteApp program in the RD Web Access - server. - :type show_in_portal: bool - :param icon_path: Path to icon. - :type icon_path: str - :param icon_index: Index of the icon. - :type icon_index: int - :param msix_package_family_name: Specifies the package family name for MSIX applications. - :type msix_package_family_name: str - :param msix_package_application_id: Specifies the package application Id for MSIX applications. - :type msix_package_application_id: str - :param application_type: Resource Type of Application. Possible values include: "InBuilt", - "MsixApplication". - :type application_type: str or ~desktop_virtualization_api_client.models.RemoteApplicationType - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'file_path': {'key': 'properties.filePath', 'type': 'str'}, - 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, - 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, - 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, - 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, - 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, - 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, - 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, - 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.file_path = kwargs.get('file_path', None) - self.command_line_setting = kwargs.get('command_line_setting', None) - self.command_line_arguments = kwargs.get('command_line_arguments', None) - self.show_in_portal = kwargs.get('show_in_portal', None) - self.icon_path = kwargs.get('icon_path', None) - self.icon_index = kwargs.get('icon_index', None) - self.msix_package_family_name = kwargs.get('msix_package_family_name', None) - self.msix_package_application_id = kwargs.get('msix_package_application_id', None) - self.application_type = kwargs.get('application_type', None) - - -class CloudErrorProperties(msrest.serialization.Model): - """CloudErrorProperties. - - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudErrorProperties, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class Desktop(Resource): - """Schema for Desktop properties. - - 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 object_id: ObjectId of Desktop. (internal use). - :vartype object_id: str - :param description: Description of Desktop. - :type description: str - :param friendly_name: Friendly name of Desktop. - :type friendly_name: str - :ivar icon_hash: Hash of the icon. - :vartype icon_hash: str - :ivar icon_content: The icon a 64 bit string as a byte array. - :vartype icon_content: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - 'icon_hash': {'readonly': True}, - 'icon_content': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, - 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(Desktop, self).__init__(**kwargs) - self.object_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.icon_hash = None - self.icon_content = None - - -class DesktopList(msrest.serialization.Model): - """List of Desktop definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of Desktop definitions. - :type value: list[~desktop_virtualization_api_client.models.Desktop] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Desktop]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DesktopList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class DesktopPatch(msrest.serialization.Model): - """Desktop properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of Desktop. - :type description: str - :param friendly_name: Friendly name of Desktop. - :type friendly_name: str - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DesktopPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - - -class ExpandMsixImage(Resource): - """Represents the definition of contents retrieved after expanding the MSIX Image. - - 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 - :param package_alias: Alias of MSIX Package. - :type package_alias: str - :param image_path: VHD/CIM image path on Network Share. - :type image_path: str - :param package_name: Package Name from appxmanifest.xml. - :type package_name: str - :param package_family_name: Package Family Name from appxmanifest.xml. Contains Package Name - and Publisher name. - :type package_family_name: str - :param package_full_name: Package Full Name from appxmanifest.xml. - :type package_full_name: str - :param display_name: User friendly Name to be displayed in the portal. - :type display_name: str - :param package_relative_path: Relative Path to the package inside the image. - :type package_relative_path: str - :param is_regular_registration: Specifies how to register Package in feed. - :type is_regular_registration: bool - :param is_active: Make this version of the package the active one across the hostpool. - :type is_active: bool - :param package_dependencies: List of package dependencies. - :type package_dependencies: - list[~desktop_virtualization_api_client.models.MsixPackageDependencies] - :param version: Package Version found in the appxmanifest.xml. - :type version: str - :param last_updated: Date Package was last updated, found in the appxmanifest.xml. - :type last_updated: ~datetime.datetime - :param package_applications: List of package applications. - :type package_applications: - list[~desktop_virtualization_api_client.models.MsixPackageApplications] - """ - - _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'}, - 'package_alias': {'key': 'properties.packageAlias', 'type': 'str'}, - 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, - 'package_name': {'key': 'properties.packageName', 'type': 'str'}, - 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, - 'package_full_name': {'key': 'properties.packageFullName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, - 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, - 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, - 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, - 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpandMsixImage, self).__init__(**kwargs) - self.package_alias = kwargs.get('package_alias', None) - self.image_path = kwargs.get('image_path', None) - self.package_name = kwargs.get('package_name', None) - self.package_family_name = kwargs.get('package_family_name', None) - self.package_full_name = kwargs.get('package_full_name', None) - self.display_name = kwargs.get('display_name', None) - self.package_relative_path = kwargs.get('package_relative_path', None) - self.is_regular_registration = kwargs.get('is_regular_registration', None) - self.is_active = kwargs.get('is_active', None) - self.package_dependencies = kwargs.get('package_dependencies', None) - self.version = kwargs.get('version', None) - self.last_updated = kwargs.get('last_updated', None) - self.package_applications = kwargs.get('package_applications', None) - - -class ExpandMsixImageList(msrest.serialization.Model): - """List of MSIX package properties retrieved from MSIX Image expansion. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of MSIX package properties from give MSIX Image. - :type value: list[~desktop_virtualization_api_client.models.ExpandMsixImage] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpandMsixImage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpandMsixImageList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class HostPool(ResourceModelWithAllowedPropertySet): - """Represents a HostPool 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. - - :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 location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of HostPool. (internal use). - :vartype object_id: str - :param friendly_name: Friendly name of HostPool. - :type friendly_name: str - :param description: Description of HostPool. - :type description: str - :param host_pool_type: Required. HostPool type for desktop. Possible values include: - "Personal", "Pooled", "BYODesktop". - :type host_pool_type: str or ~desktop_virtualization_api_client.models.HostPoolType - :param personal_desktop_assignment_type: PersonalDesktopAssignment type for HostPool. Possible - values include: "Automatic", "Direct". - :type personal_desktop_assignment_type: str or - ~desktop_virtualization_api_client.models.PersonalDesktopAssignmentType - :param custom_rdp_property: Custom rdp property of HostPool. - :type custom_rdp_property: str - :param max_session_limit: The max session limit of HostPool. - :type max_session_limit: int - :param load_balancer_type: Required. The type of the load balancer. Possible values include: - "BreadthFirst", "DepthFirst", "Persistent". - :type load_balancer_type: str or ~desktop_virtualization_api_client.models.LoadBalancerType - :param ring: The ring number of HostPool. - :type ring: int - :param validation_environment: Is validation environment. - :type validation_environment: bool - :param registration_info: The registration info of HostPool. - :type registration_info: ~desktop_virtualization_api_client.models.RegistrationInfo - :param vm_template: VM template for sessionhosts configuration within hostpool. - :type vm_template: str - :ivar application_group_references: List of applicationGroup links. - :vartype application_group_references: list[str] - :param ssoadfs_authority: URL to customer ADFS server for signing WVD SSO certificates. - :type ssoadfs_authority: str - :param sso_client_id: ClientId for the registered Relying Party used to issue WVD SSO - certificates. - :type sso_client_id: str - :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing the secret used for - communication to ADFS. - :type sso_client_secret_key_vault_path: str - :param sso_secret_type: The type of single sign on Secret Type. Possible values include: - "SharedKey", "Certificate", "SharedKeyInKeyVault", "CertificateInKeyVault". - :type sso_secret_type: str or ~desktop_virtualization_api_client.models.SsoSecretType - :param preferred_app_group_type: Required. The type of preferred application group type, - default to Desktop Application Group. Possible values include: "None", "Desktop", - "RailApplications". - :type preferred_app_group_type: str or - ~desktop_virtualization_api_client.models.PreferredAppGroupType - :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect feature. - :type start_vm_on_connect: bool - :param migration_request: The registration info of HostPool. - :type migration_request: ~desktop_virtualization_api_client.models.MigrationRequestProperties - :ivar cloud_pc_resource: Is cloud pc resource. - :vartype cloud_pc_resource: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - 'host_pool_type': {'required': True}, - 'load_balancer_type': {'required': True}, - 'application_group_references': {'readonly': True}, - 'preferred_app_group_type': {'required': True}, - 'cloud_pc_resource': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, - 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, - 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, - 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, - 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, - 'ring': {'key': 'properties.ring', 'type': 'int'}, - 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, - 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfo'}, - 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, - 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, - 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, - 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, - 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, - 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, - 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, - 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, - 'migration_request': {'key': 'properties.migrationRequest', 'type': 'MigrationRequestProperties'}, - 'cloud_pc_resource': {'key': 'properties.cloudPcResource', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(HostPool, self).__init__(**kwargs) - self.object_id = None - self.friendly_name = kwargs.get('friendly_name', None) - self.description = kwargs.get('description', None) - self.host_pool_type = kwargs['host_pool_type'] - self.personal_desktop_assignment_type = kwargs.get('personal_desktop_assignment_type', None) - self.custom_rdp_property = kwargs.get('custom_rdp_property', None) - self.max_session_limit = kwargs.get('max_session_limit', None) - self.load_balancer_type = kwargs['load_balancer_type'] - self.ring = kwargs.get('ring', None) - self.validation_environment = kwargs.get('validation_environment', None) - self.registration_info = kwargs.get('registration_info', None) - self.vm_template = kwargs.get('vm_template', None) - self.application_group_references = None - self.ssoadfs_authority = kwargs.get('ssoadfs_authority', None) - self.sso_client_id = kwargs.get('sso_client_id', None) - self.sso_client_secret_key_vault_path = kwargs.get('sso_client_secret_key_vault_path', None) - self.sso_secret_type = kwargs.get('sso_secret_type', None) - self.preferred_app_group_type = kwargs['preferred_app_group_type'] - self.start_vm_on_connect = kwargs.get('start_vm_on_connect', None) - self.migration_request = kwargs.get('migration_request', None) - self.cloud_pc_resource = None - - -class HostPoolList(msrest.serialization.Model): - """List of HostPool definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of HostPool definitions. - :type value: list[~desktop_virtualization_api_client.models.HostPool] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[HostPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HostPoolList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class HostPoolPatch(Resource): - """HostPool properties that can be patched. - - 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 - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param friendly_name: Friendly name of HostPool. - :type friendly_name: str - :param description: Description of HostPool. - :type description: str - :param custom_rdp_property: Custom rdp property of HostPool. - :type custom_rdp_property: str - :param max_session_limit: The max session limit of HostPool. - :type max_session_limit: int - :param personal_desktop_assignment_type: PersonalDesktopAssignment type for HostPool. Possible - values include: "Automatic", "Direct". - :type personal_desktop_assignment_type: str or - ~desktop_virtualization_api_client.models.PersonalDesktopAssignmentType - :param load_balancer_type: The type of the load balancer. Possible values include: - "BreadthFirst", "DepthFirst", "Persistent". - :type load_balancer_type: str or ~desktop_virtualization_api_client.models.LoadBalancerType - :param ring: The ring number of HostPool. - :type ring: int - :param validation_environment: Is validation environment. - :type validation_environment: bool - :param registration_info: The registration info of HostPool. - :type registration_info: ~desktop_virtualization_api_client.models.RegistrationInfoPatch - :param vm_template: VM template for sessionhosts configuration within hostpool. - :type vm_template: str - :param ssoadfs_authority: URL to customer ADFS server for signing WVD SSO certificates. - :type ssoadfs_authority: str - :param sso_client_id: ClientId for the registered Relying Party used to issue WVD SSO - certificates. - :type sso_client_id: str - :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing the secret used for - communication to ADFS. - :type sso_client_secret_key_vault_path: str - :param sso_secret_type: The type of single sign on Secret Type. Possible values include: - "SharedKey", "Certificate", "SharedKeyInKeyVault", "CertificateInKeyVault". - :type sso_secret_type: str or ~desktop_virtualization_api_client.models.SsoSecretType - :param preferred_app_group_type: The type of preferred application group type, default to - Desktop Application Group. Possible values include: "None", "Desktop", "RailApplications". - :type preferred_app_group_type: str or - ~desktop_virtualization_api_client.models.PreferredAppGroupType - :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect feature. - :type start_vm_on_connect: bool - """ - - _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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, - 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, - 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, - 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, - 'ring': {'key': 'properties.ring', 'type': 'int'}, - 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, - 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfoPatch'}, - 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, - 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, - 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, - 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, - 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, - 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, - 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(HostPoolPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.description = kwargs.get('description', None) - self.custom_rdp_property = kwargs.get('custom_rdp_property', None) - self.max_session_limit = kwargs.get('max_session_limit', None) - self.personal_desktop_assignment_type = kwargs.get('personal_desktop_assignment_type', None) - self.load_balancer_type = kwargs.get('load_balancer_type', None) - self.ring = kwargs.get('ring', None) - self.validation_environment = kwargs.get('validation_environment', None) - self.registration_info = kwargs.get('registration_info', None) - self.vm_template = kwargs.get('vm_template', None) - self.ssoadfs_authority = kwargs.get('ssoadfs_authority', None) - self.sso_client_id = kwargs.get('sso_client_id', None) - self.sso_client_secret_key_vault_path = kwargs.get('sso_client_secret_key_vault_path', None) - self.sso_secret_type = kwargs.get('sso_secret_type', None) - self.preferred_app_group_type = kwargs.get('preferred_app_group_type', None) - self.start_vm_on_connect = kwargs.get('start_vm_on_connect', None) - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - - -class LogSpecification(msrest.serialization.Model): - """Specifications of the Log for Azure Monitoring. - - :param name: Name of the log. - :type name: str - :param display_name: Localized friendly display name of the log. - :type display_name: str - :param blob_duration: Blob duration of the log. - :type blob_duration: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.blob_duration = kwargs.get('blob_duration', None) - - -class MigrationRequestProperties(msrest.serialization.Model): - """Properties for arm migration. - - :param operation: The type of operation for migration. Possible values include: "Start", - "Revoke", "Complete", "Hide", "Unhide". - :type operation: str or ~desktop_virtualization_api_client.models.Operation - :param migration_path: The path to the legacy object to migrate. - :type migration_path: str - """ - - _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'migration_path': {'key': 'migrationPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationRequestProperties, self).__init__(**kwargs) - self.operation = kwargs.get('operation', None) - self.migration_path = kwargs.get('migration_path', None) - - -class MsixImageUri(msrest.serialization.Model): - """Represents URI referring to MSIX Image. - - :param uri: URI to Image. - :type uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MsixImageUri, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class MsixPackage(Resource): - """Schema for MSIX Package properties. - - 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 - :param image_path: VHD/CIM image path on Network Share. - :type image_path: str - :param package_name: Package Name from appxmanifest.xml. - :type package_name: str - :param package_family_name: Package Family Name from appxmanifest.xml. Contains Package Name - and Publisher name. - :type package_family_name: str - :param display_name: User friendly Name to be displayed in the portal. - :type display_name: str - :param package_relative_path: Relative Path to the package inside the image. - :type package_relative_path: str - :param is_regular_registration: Specifies how to register Package in feed. - :type is_regular_registration: bool - :param is_active: Make this version of the package the active one across the hostpool. - :type is_active: bool - :param package_dependencies: List of package dependencies. - :type package_dependencies: - list[~desktop_virtualization_api_client.models.MsixPackageDependencies] - :param version: Package Version found in the appxmanifest.xml. - :type version: str - :param last_updated: Date Package was last updated, found in the appxmanifest.xml. - :type last_updated: ~datetime.datetime - :param package_applications: List of package applications. - :type package_applications: - list[~desktop_virtualization_api_client.models.MsixPackageApplications] - """ - - _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'}, - 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, - 'package_name': {'key': 'properties.packageName', 'type': 'str'}, - 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, - 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, - 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, - 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, - 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, - } - - def __init__( - self, - **kwargs - ): - super(MsixPackage, self).__init__(**kwargs) - self.image_path = kwargs.get('image_path', None) - self.package_name = kwargs.get('package_name', None) - self.package_family_name = kwargs.get('package_family_name', None) - self.display_name = kwargs.get('display_name', None) - self.package_relative_path = kwargs.get('package_relative_path', None) - self.is_regular_registration = kwargs.get('is_regular_registration', None) - self.is_active = kwargs.get('is_active', None) - self.package_dependencies = kwargs.get('package_dependencies', None) - self.version = kwargs.get('version', None) - self.last_updated = kwargs.get('last_updated', None) - self.package_applications = kwargs.get('package_applications', None) - - -class MsixPackageApplications(msrest.serialization.Model): - """Schema for MSIX Package Application properties. - - :param app_id: Package Application Id, found in appxmanifest.xml. - :type app_id: str - :param description: Description of Package Application. - :type description: str - :param app_user_model_id: Used to activate Package Application. Consists of Package Name and - ApplicationID. Found in appxmanifest.xml. - :type app_user_model_id: str - :param friendly_name: User friendly name. - :type friendly_name: str - :param icon_image_name: User friendly name. - :type icon_image_name: str - :param raw_icon: the icon a 64 bit string as a byte array. - :type raw_icon: bytearray - :param raw_png: the icon a 64 bit string as a byte array. - :type raw_png: bytearray - """ - - _attribute_map = { - 'app_id': {'key': 'appId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'app_user_model_id': {'key': 'appUserModelID', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'icon_image_name': {'key': 'iconImageName', 'type': 'str'}, - 'raw_icon': {'key': 'rawIcon', 'type': 'bytearray'}, - 'raw_png': {'key': 'rawPng', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(MsixPackageApplications, self).__init__(**kwargs) - self.app_id = kwargs.get('app_id', None) - self.description = kwargs.get('description', None) - self.app_user_model_id = kwargs.get('app_user_model_id', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.icon_image_name = kwargs.get('icon_image_name', None) - self.raw_icon = kwargs.get('raw_icon', None) - self.raw_png = kwargs.get('raw_png', None) - - -class MsixPackageDependencies(msrest.serialization.Model): - """Schema for MSIX Package Dependencies properties. - - :param dependency_name: Name of package dependency. - :type dependency_name: str - :param publisher: Name of dependency publisher. - :type publisher: str - :param min_version: Dependency version required. - :type min_version: str - """ - - _attribute_map = { - 'dependency_name': {'key': 'dependencyName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'min_version': {'key': 'minVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MsixPackageDependencies, self).__init__(**kwargs) - self.dependency_name = kwargs.get('dependency_name', None) - self.publisher = kwargs.get('publisher', None) - self.min_version = kwargs.get('min_version', None) - - -class MsixPackageList(msrest.serialization.Model): - """List of MSIX Package definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of MSIX Package definitions. - :type value: list[~desktop_virtualization_api_client.models.MsixPackage] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MsixPackage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MsixPackageList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class MsixPackagePatch(Resource): - """MSIX Package properties that can be patched. - - 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 - :param is_active: Set a version of the package to be active across hostpool. - :type is_active: bool - :param is_regular_registration: Set Registration mode. Regular or Delayed. - :type is_regular_registration: bool - :param display_name: Display name for MSIX Package. - :type display_name: 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'}, - 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, - 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MsixPackagePatch, self).__init__(**kwargs) - self.is_active = kwargs.get('is_active', None) - self.is_regular_registration = kwargs.get('is_regular_registration', None) - self.display_name = kwargs.get('display_name', None) - - -class OperationProperties(msrest.serialization.Model): - """Properties of the operation. - - :param service_specification: Service specification payload. - :type service_specification: ~desktop_virtualization_api_client.models.ServiceSpecification - """ - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationProperties, self).__init__(**kwargs) - self.service_specification = kwargs.get('service_specification', None) - - -class Plan(msrest.serialization.Model): - """Plan for the resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. A user defined name of the 3rd Party Artifact that is being procured. - :type name: str - :param publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. - NewRelic. - :type publisher: str - :param product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product - maps to the OfferID specified for the artifact at the time of Data Market onboarding. - :type product: str - :param promotion_code: A publisher provided promotion code as provisioned in Data Market for - the said product/artifact. - :type promotion_code: str - :param version: The version of the desired product/artifact. - :type version: str - """ - - _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'product': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Plan, self).__init__(**kwargs) - self.name = kwargs['name'] - self.publisher = kwargs['publisher'] - self.product = kwargs['product'] - self.promotion_code = kwargs.get('promotion_code', None) - self.version = kwargs.get('version', None) - - -class RegistrationInfo(msrest.serialization.Model): - """Represents a RegistrationInfo definition. - - :param expiration_time: Expiration time of registration token. - :type expiration_time: ~datetime.datetime - :param token: The registration token base64 encoded string. - :type token: str - :param registration_token_operation: The type of resetting the token. Possible values include: - "Delete", "None", "Update". - :type registration_token_operation: str or - ~desktop_virtualization_api_client.models.RegistrationTokenOperation - """ - - _attribute_map = { - 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, - 'token': {'key': 'token', 'type': 'str'}, - 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RegistrationInfo, self).__init__(**kwargs) - self.expiration_time = kwargs.get('expiration_time', None) - self.token = kwargs.get('token', None) - self.registration_token_operation = kwargs.get('registration_token_operation', None) - - -class RegistrationInfoPatch(msrest.serialization.Model): - """Represents a RegistrationInfo definition. - - :param expiration_time: Expiration time of registration token. - :type expiration_time: ~datetime.datetime - :param registration_token_operation: The type of resetting the token. Possible values include: - "Delete", "None", "Update". - :type registration_token_operation: str or - ~desktop_virtualization_api_client.models.RegistrationTokenOperation - """ - - _attribute_map = { - 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, - 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RegistrationInfoPatch, self).__init__(**kwargs) - self.expiration_time = kwargs.get('expiration_time', None) - self.registration_token_operation = kwargs.get('registration_token_operation', None) - - -class ResourceModelWithAllowedPropertySetIdentity(Identity): - """ResourceModelWithAllowedPropertySetIdentity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__( - self, - **kwargs - ): - super(ResourceModelWithAllowedPropertySetIdentity, self).__init__(**kwargs) - - -class ResourceModelWithAllowedPropertySetPlan(Plan): - """ResourceModelWithAllowedPropertySetPlan. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. A user defined name of the 3rd Party Artifact that is being procured. - :type name: str - :param publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. - NewRelic. - :type publisher: str - :param product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product - maps to the OfferID specified for the artifact at the time of Data Market onboarding. - :type product: str - :param promotion_code: A publisher provided promotion code as provisioned in Data Market for - the said product/artifact. - :type promotion_code: str - :param version: The version of the desired product/artifact. - :type version: str - """ - - _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'product': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceModelWithAllowedPropertySetPlan, self).__init__(**kwargs) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :type name: str - :param tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :type tier: str or ~desktop_virtualization_api_client.models.SkuTier - :param size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :type size: str - :param family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :type family: str - :param capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class ResourceModelWithAllowedPropertySetSku(Sku): - """ResourceModelWithAllowedPropertySetSku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :type name: str - :param tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :type tier: str or ~desktop_virtualization_api_client.models.SkuTier - :param size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :type size: str - :param family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :type family: str - :param capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceModelWithAllowedPropertySetSku, self).__init__(**kwargs) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~desktop_virtualization_api_client.models.ResourceProviderOperationDisplay - :param is_data_action: Is a data action. - :type is_data_action: bool - :param properties: Properties of the operation. - :type properties: ~desktop_virtualization_api_client.models.OperationProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'OperationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) - self.properties = kwargs.get('properties', None) - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft Desktop Virtualization. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this 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(ResourceProviderOperationDisplay, 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 ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - :param value: List of operations supported by this resource provider. - :type value: list[~desktop_virtualization_api_client.models.ResourceProviderOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class ScalingHostPoolReference(msrest.serialization.Model): - """Scaling plan reference to hostpool. - - :param host_pool_arm_path: Arm path of referenced hostpool. - :type host_pool_arm_path: str - :param scaling_plan_enabled: Is the scaling plan enabled for this hostpool. - :type scaling_plan_enabled: bool - """ - - _attribute_map = { - 'host_pool_arm_path': {'key': 'hostPoolArmPath', 'type': 'str'}, - 'scaling_plan_enabled': {'key': 'scalingPlanEnabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ScalingHostPoolReference, self).__init__(**kwargs) - self.host_pool_arm_path = kwargs.get('host_pool_arm_path', None) - self.scaling_plan_enabled = kwargs.get('scaling_plan_enabled', None) - - -class ScalingPlan(ResourceModelWithAllowedPropertySet): - """Represents a scaling plan definition. - - 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 - :param location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of scaling plan. (internal use). - :vartype object_id: str - :param description: Description of scaling plan. - :type description: str - :param friendly_name: User friendly name of scaling plan. - :type friendly_name: str - :param time_zone: Timezone of the scaling plan. - :type time_zone: str - :param host_pool_type: HostPool type for desktop. Possible values include: "Personal", - "Pooled", "BYODesktop". - :type host_pool_type: str or ~desktop_virtualization_api_client.models.HostPoolType - :param exclusion_tag: Exclusion tag for scaling plan. - :type exclusion_tag: str - :param schedules: List of ScalingSchedule definitions. - :type schedules: list[~desktop_virtualization_api_client.models.ScalingSchedule] - :param host_pool_references: List of ScalingHostPoolReference definitions. - :type host_pool_references: - list[~desktop_virtualization_api_client.models.ScalingHostPoolReference] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, - 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, - 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, - 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, - 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ScalingPlan, self).__init__(**kwargs) - self.object_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.time_zone = kwargs.get('time_zone', None) - self.host_pool_type = kwargs.get('host_pool_type', None) - self.exclusion_tag = kwargs.get('exclusion_tag', None) - self.schedules = kwargs.get('schedules', None) - self.host_pool_references = kwargs.get('host_pool_references', None) - - -class ScalingPlanList(msrest.serialization.Model): - """List of scaling plan definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of scaling plan definitions. - :type value: list[~desktop_virtualization_api_client.models.ScalingPlan] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ScalingPlan]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScalingPlanList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ScalingPlanPatch(msrest.serialization.Model): - """Scaling plan properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of scaling plan. - :type description: str - :param friendly_name: User friendly name of scaling plan. - :type friendly_name: str - :param time_zone: Timezone of the scaling plan. - :type time_zone: str - :param host_pool_type: HostPool type for desktop. Possible values include: "Personal", - "Pooled", "BYODesktop". - :type host_pool_type: str or ~desktop_virtualization_api_client.models.HostPoolType - :param exclusion_tag: Exclusion tag for scaling plan. - :type exclusion_tag: str - :param schedules: List of ScalingSchedule definitions. - :type schedules: list[~desktop_virtualization_api_client.models.ScalingSchedule] - :param host_pool_references: List of ScalingHostPoolReference definitions. - :type host_pool_references: - list[~desktop_virtualization_api_client.models.ScalingHostPoolReference] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, - 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, - 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, - 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, - 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ScalingPlanPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.time_zone = kwargs.get('time_zone', None) - self.host_pool_type = kwargs.get('host_pool_type', None) - self.exclusion_tag = kwargs.get('exclusion_tag', None) - self.schedules = kwargs.get('schedules', None) - self.host_pool_references = kwargs.get('host_pool_references', None) - - -class ScalingSchedule(msrest.serialization.Model): - """Scaling plan schedule. - - :param name: Name of the scaling schedule. - :type name: str - :param days_of_week: Set of days of the week on which this schedule is active. - :type days_of_week: list[str or - ~desktop_virtualization_api_client.models.ScalingScheduleDaysOfWeekItem] - :param ramp_up_start_time: Starting time for ramp up period. - :type ramp_up_start_time: ~datetime.datetime - :param ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp up period. Possible - values include: "BreadthFirst", "DepthFirst". - :type ramp_up_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - :param ramp_up_minimum_hosts_pct: Minimum host percentage for ramp up period. - :type ramp_up_minimum_hosts_pct: int - :param ramp_up_capacity_threshold_pct: Capacity threshold for ramp up period. - :type ramp_up_capacity_threshold_pct: int - :param peak_start_time: Starting time for peak period. - :type peak_start_time: ~datetime.datetime - :param peak_load_balancing_algorithm: Load balancing algorithm for peak period. Possible values - include: "BreadthFirst", "DepthFirst". - :type peak_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - :param ramp_down_start_time: Starting time for ramp down period. - :type ramp_down_start_time: ~datetime.datetime - :param ramp_down_load_balancing_algorithm: Load balancing algorithm for ramp down period. - Possible values include: "BreadthFirst", "DepthFirst". - :type ramp_down_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - :param ramp_down_minimum_hosts_pct: Minimum host percentage for ramp down period. - :type ramp_down_minimum_hosts_pct: int - :param ramp_down_capacity_threshold_pct: Capacity threshold for ramp down period. - :type ramp_down_capacity_threshold_pct: int - :param ramp_down_force_logoff_users: Should users be logged off forcefully from hosts. - :type ramp_down_force_logoff_users: bool - :param ramp_down_stop_hosts_when: Specifies when to stop hosts during ramp down period. - Possible values include: "ZeroSessions", "ZeroActiveSessions". - :type ramp_down_stop_hosts_when: str or ~desktop_virtualization_api_client.models.StopHostsWhen - :param ramp_down_wait_time_minutes: Number of minutes to wait to stop hosts during ramp down - period. - :type ramp_down_wait_time_minutes: int - :param ramp_down_notification_message: Notification message for users during ramp down period. - :type ramp_down_notification_message: str - :param off_peak_start_time: Starting time for off-peak period. - :type off_peak_start_time: ~datetime.datetime - :param off_peak_load_balancing_algorithm: Load balancing algorithm for off-peak period. - Possible values include: "BreadthFirst", "DepthFirst". - :type off_peak_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - """ - - _validation = { - 'ramp_up_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, - 'ramp_up_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, - 'ramp_down_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, - 'ramp_down_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'days_of_week': {'key': 'daysOfWeek', 'type': '[str]'}, - 'ramp_up_start_time': {'key': 'rampUpStartTime', 'type': 'iso-8601'}, - 'ramp_up_load_balancing_algorithm': {'key': 'rampUpLoadBalancingAlgorithm', 'type': 'str'}, - 'ramp_up_minimum_hosts_pct': {'key': 'rampUpMinimumHostsPct', 'type': 'int'}, - 'ramp_up_capacity_threshold_pct': {'key': 'rampUpCapacityThresholdPct', 'type': 'int'}, - 'peak_start_time': {'key': 'peakStartTime', 'type': 'iso-8601'}, - 'peak_load_balancing_algorithm': {'key': 'peakLoadBalancingAlgorithm', 'type': 'str'}, - 'ramp_down_start_time': {'key': 'rampDownStartTime', 'type': 'iso-8601'}, - 'ramp_down_load_balancing_algorithm': {'key': 'rampDownLoadBalancingAlgorithm', 'type': 'str'}, - 'ramp_down_minimum_hosts_pct': {'key': 'rampDownMinimumHostsPct', 'type': 'int'}, - 'ramp_down_capacity_threshold_pct': {'key': 'rampDownCapacityThresholdPct', 'type': 'int'}, - 'ramp_down_force_logoff_users': {'key': 'rampDownForceLogoffUsers', 'type': 'bool'}, - 'ramp_down_stop_hosts_when': {'key': 'rampDownStopHostsWhen', 'type': 'str'}, - 'ramp_down_wait_time_minutes': {'key': 'rampDownWaitTimeMinutes', 'type': 'int'}, - 'ramp_down_notification_message': {'key': 'rampDownNotificationMessage', 'type': 'str'}, - 'off_peak_start_time': {'key': 'offPeakStartTime', 'type': 'iso-8601'}, - 'off_peak_load_balancing_algorithm': {'key': 'offPeakLoadBalancingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScalingSchedule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.days_of_week = kwargs.get('days_of_week', None) - self.ramp_up_start_time = kwargs.get('ramp_up_start_time', None) - self.ramp_up_load_balancing_algorithm = kwargs.get('ramp_up_load_balancing_algorithm', None) - self.ramp_up_minimum_hosts_pct = kwargs.get('ramp_up_minimum_hosts_pct', None) - self.ramp_up_capacity_threshold_pct = kwargs.get('ramp_up_capacity_threshold_pct', None) - self.peak_start_time = kwargs.get('peak_start_time', None) - self.peak_load_balancing_algorithm = kwargs.get('peak_load_balancing_algorithm', None) - self.ramp_down_start_time = kwargs.get('ramp_down_start_time', None) - self.ramp_down_load_balancing_algorithm = kwargs.get('ramp_down_load_balancing_algorithm', None) - self.ramp_down_minimum_hosts_pct = kwargs.get('ramp_down_minimum_hosts_pct', None) - self.ramp_down_capacity_threshold_pct = kwargs.get('ramp_down_capacity_threshold_pct', None) - self.ramp_down_force_logoff_users = kwargs.get('ramp_down_force_logoff_users', None) - self.ramp_down_stop_hosts_when = kwargs.get('ramp_down_stop_hosts_when', None) - self.ramp_down_wait_time_minutes = kwargs.get('ramp_down_wait_time_minutes', None) - self.ramp_down_notification_message = kwargs.get('ramp_down_notification_message', None) - self.off_peak_start_time = kwargs.get('off_peak_start_time', None) - self.off_peak_load_balancing_algorithm = kwargs.get('off_peak_load_balancing_algorithm', None) - - -class SendMessage(msrest.serialization.Model): - """Represents message sent to a UserSession. - - :param message_title: Title of message. - :type message_title: str - :param message_body: Body of message. - :type message_body: str - """ - - _attribute_map = { - 'message_title': {'key': 'messageTitle', 'type': 'str'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SendMessage, self).__init__(**kwargs) - self.message_title = kwargs.get('message_title', None) - self.message_body = kwargs.get('message_body', None) - - -class ServiceSpecification(msrest.serialization.Model): - """Service specification payload. - - :param log_specifications: Specifications of the Log for Azure Monitoring. - :type log_specifications: list[~desktop_virtualization_api_client.models.LogSpecification] - """ - - _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = kwargs.get('log_specifications', None) - - -class SessionHost(Resource): - """Represents a SessionHost definition. - - 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 object_id: ObjectId of SessionHost. (internal use). - :vartype object_id: str - :param last_heart_beat: Last heart beat from SessionHost. - :type last_heart_beat: ~datetime.datetime - :param sessions: Number of sessions on SessionHost. - :type sessions: int - :param agent_version: Version of agent on SessionHost. - :type agent_version: str - :param allow_new_session: Allow a new session. - :type allow_new_session: bool - :ivar virtual_machine_id: Virtual Machine Id of SessionHost's underlying virtual machine. - :vartype virtual_machine_id: str - :ivar resource_id: Resource Id of SessionHost's underlying virtual machine. - :vartype resource_id: str - :param assigned_user: User assigned to SessionHost. - :type assigned_user: str - :param status: Status for a SessionHost. Possible values include: "Available", "Unavailable", - "Shutdown", "Disconnected", "Upgrading", "UpgradeFailed", "NoHeartbeat", "NotJoinedToDomain", - "DomainTrustRelationshipLost", "SxSStackListenerNotReady", "FSLogixNotHealthy", - "NeedsAssistance". - :type status: str or ~desktop_virtualization_api_client.models.Status - :ivar status_timestamp: The timestamp of the status. - :vartype status_timestamp: ~datetime.datetime - :param os_version: The version of the OS on the session host. - :type os_version: str - :param sx_s_stack_version: The version of the side by side stack on the session host. - :type sx_s_stack_version: str - :param update_state: Update state of a SessionHost. Possible values include: "Initial", - "Pending", "Started", "Succeeded", "Failed". - :type update_state: str or ~desktop_virtualization_api_client.models.UpdateState - :ivar last_update_time: The timestamp of the last update. - :vartype last_update_time: ~datetime.datetime - :param update_error_message: The error message. - :type update_error_message: str - :ivar session_host_health_check_results: List of SessionHostHealthCheckReports. - :vartype session_host_health_check_results: - list[~desktop_virtualization_api_client.models.SessionHostHealthCheckReport] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - 'virtual_machine_id': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'status_timestamp': {'readonly': True}, - 'last_update_time': {'readonly': True}, - 'session_host_health_check_results': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'iso-8601'}, - 'sessions': {'key': 'properties.sessions', 'type': 'int'}, - 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, - 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, - 'virtual_machine_id': {'key': 'properties.virtualMachineId', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'status_timestamp': {'key': 'properties.statusTimestamp', 'type': 'iso-8601'}, - 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, - 'sx_s_stack_version': {'key': 'properties.sxSStackVersion', 'type': 'str'}, - 'update_state': {'key': 'properties.updateState', 'type': 'str'}, - 'last_update_time': {'key': 'properties.lastUpdateTime', 'type': 'iso-8601'}, - 'update_error_message': {'key': 'properties.updateErrorMessage', 'type': 'str'}, - 'session_host_health_check_results': {'key': 'properties.sessionHostHealthCheckResults', 'type': '[SessionHostHealthCheckReport]'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHost, self).__init__(**kwargs) - self.object_id = None - self.last_heart_beat = kwargs.get('last_heart_beat', None) - self.sessions = kwargs.get('sessions', None) - self.agent_version = kwargs.get('agent_version', None) - self.allow_new_session = kwargs.get('allow_new_session', None) - self.virtual_machine_id = None - self.resource_id = None - self.assigned_user = kwargs.get('assigned_user', None) - self.status = kwargs.get('status', None) - self.status_timestamp = None - self.os_version = kwargs.get('os_version', None) - self.sx_s_stack_version = kwargs.get('sx_s_stack_version', None) - self.update_state = kwargs.get('update_state', None) - self.last_update_time = None - self.update_error_message = kwargs.get('update_error_message', None) - self.session_host_health_check_results = None - - -class SessionHostHealthCheckFailureDetails(msrest.serialization.Model): - """Contains details on the failure. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar message: Failure message: hints on what is wrong and how to recover. - :vartype message: str - :ivar error_code: Error code corresponding for the failure. - :vartype error_code: int - :ivar last_health_check_date_time: The timestamp of the last update. - :vartype last_health_check_date_time: ~datetime.datetime - """ - - _validation = { - 'message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'last_health_check_date_time': {'readonly': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'last_health_check_date_time': {'key': 'lastHealthCheckDateTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHostHealthCheckFailureDetails, self).__init__(**kwargs) - self.message = None - self.error_code = None - self.last_health_check_date_time = None - - -class SessionHostHealthCheckReport(msrest.serialization.Model): - """The report for session host information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar health_check_name: Represents the name of the health check operation performed. Possible - values include: "DomainJoinedCheck", "DomainTrustCheck", "FSLogixHealthCheck", - "SxSStackListenerCheck", "UrlsAccessibleCheck", "MonitoringAgentCheck", "DomainReachable", - "WebRTCRedirectorCheck", "SupportedEncryptionCheck", "MetaDataServiceCheck", - "AppAttachHealthCheck". - :vartype health_check_name: str or ~desktop_virtualization_api_client.models.HealthCheckName - :ivar health_check_result: Represents the Health state of the health check we performed. - Possible values include: "Unknown", "HealthCheckSucceeded", "HealthCheckFailed", - "SessionHostShutdown". - :vartype health_check_result: str or - ~desktop_virtualization_api_client.models.HealthCheckResult - :ivar additional_failure_details: Additional detailed information on the failure. - :vartype additional_failure_details: - ~desktop_virtualization_api_client.models.SessionHostHealthCheckFailureDetails - """ - - _validation = { - 'health_check_name': {'readonly': True}, - 'health_check_result': {'readonly': True}, - 'additional_failure_details': {'readonly': True}, - } - - _attribute_map = { - 'health_check_name': {'key': 'healthCheckName', 'type': 'str'}, - 'health_check_result': {'key': 'healthCheckResult', 'type': 'str'}, - 'additional_failure_details': {'key': 'additionalFailureDetails', 'type': 'SessionHostHealthCheckFailureDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHostHealthCheckReport, self).__init__(**kwargs) - self.health_check_name = None - self.health_check_result = None - self.additional_failure_details = None - - -class SessionHostList(msrest.serialization.Model): - """List of SessionHost definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of SessionHost definitions. - :type value: list[~desktop_virtualization_api_client.models.SessionHost] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SessionHost]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHostList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class SessionHostPatch(Resource): - """SessionHost properties that can be patched. - - 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 - :param allow_new_session: Allow a new session. - :type allow_new_session: bool - :param assigned_user: User assigned to SessionHost. - :type assigned_user: 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'}, - 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, - 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHostPatch, self).__init__(**kwargs) - self.allow_new_session = kwargs.get('allow_new_session', None) - self.assigned_user = kwargs.get('assigned_user', None) - - -class StartMenuItem(Resource): - """Represents a StartMenuItem definition. - - 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 - :param app_alias: Alias of StartMenuItem. - :type app_alias: str - :param file_path: Path to the file of StartMenuItem. - :type file_path: str - :param command_line_arguments: Command line arguments for StartMenuItem. - :type command_line_arguments: str - :param icon_path: Path to the icon. - :type icon_path: str - :param icon_index: Index of the icon. - :type icon_index: int - """ - - _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'}, - 'app_alias': {'key': 'properties.appAlias', 'type': 'str'}, - 'file_path': {'key': 'properties.filePath', 'type': 'str'}, - 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, - 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, - 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(StartMenuItem, self).__init__(**kwargs) - self.app_alias = kwargs.get('app_alias', None) - self.file_path = kwargs.get('file_path', None) - self.command_line_arguments = kwargs.get('command_line_arguments', None) - self.icon_path = kwargs.get('icon_path', None) - self.icon_index = kwargs.get('icon_index', None) - - -class StartMenuItemList(msrest.serialization.Model): - """List of StartMenuItem definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of StartMenuItem definitions. - :type value: list[~desktop_virtualization_api_client.models.StartMenuItem] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[StartMenuItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StartMenuItemList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class UserSession(Resource): - """Represents a UserSession definition. - - 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 object_id: ObjectId of user session. (internal use). - :vartype object_id: str - :param user_principal_name: The user principal name. - :type user_principal_name: str - :param application_type: Application type of application. Possible values include: "RemoteApp", - "Desktop". - :type application_type: str or ~desktop_virtualization_api_client.models.ApplicationType - :param session_state: State of user session. Possible values include: "Unknown", "Active", - "Disconnected", "Pending", "LogOff", "UserProfileDiskMounted". - :type session_state: str or ~desktop_virtualization_api_client.models.SessionState - :param active_directory_user_name: The active directory user name. - :type active_directory_user_name: str - :param create_time: The timestamp of the user session create. - :type create_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'user_principal_name': {'key': 'properties.userPrincipalName', 'type': 'str'}, - 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, - 'session_state': {'key': 'properties.sessionState', 'type': 'str'}, - 'active_directory_user_name': {'key': 'properties.activeDirectoryUserName', 'type': 'str'}, - 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(UserSession, self).__init__(**kwargs) - self.object_id = None - self.user_principal_name = kwargs.get('user_principal_name', None) - self.application_type = kwargs.get('application_type', None) - self.session_state = kwargs.get('session_state', None) - self.active_directory_user_name = kwargs.get('active_directory_user_name', None) - self.create_time = kwargs.get('create_time', None) - - -class UserSessionList(msrest.serialization.Model): - """List of UserSession definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of UserSession definitions. - :type value: list[~desktop_virtualization_api_client.models.UserSession] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UserSession]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserSessionList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Workspace(ResourceModelWithAllowedPropertySet): - """Represents a Workspace definition. - - 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 - :param location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of Workspace. (internal use). - :vartype object_id: str - :param description: Description of Workspace. - :type description: str - :param friendly_name: Friendly name of Workspace. - :type friendly_name: str - :param application_group_references: List of applicationGroup resource Ids. - :type application_group_references: list[str] - :ivar cloud_pc_resource: Is cloud pc resource. - :vartype cloud_pc_resource: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - 'cloud_pc_resource': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, - 'cloud_pc_resource': {'key': 'properties.cloudPcResource', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(Workspace, self).__init__(**kwargs) - self.object_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.application_group_references = kwargs.get('application_group_references', None) - self.cloud_pc_resource = None - - -class WorkspaceList(msrest.serialization.Model): - """List of Workspace definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of Workspace definitions. - :type value: list[~desktop_virtualization_api_client.models.Workspace] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkspaceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class WorkspacePatch(msrest.serialization.Model): - """Workspace properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of Workspace. - :type description: str - :param friendly_name: Friendly name of Workspace. - :type friendly_name: str - :param application_group_references: List of applicationGroup links. - :type application_group_references: list[str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkspacePatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.application_group_references = kwargs.get('application_group_references', None) diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models_py3.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models_py3.py deleted file mode 100644 index 2c185b35178..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/models/_models_py3.py +++ /dev/null @@ -1,3022 +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 datetime -from typing import Dict, List, Optional, Union - -import msrest.serialization - -from ._desktop_virtualization_api_client_enums import * - - -class Resource(msrest.serialization.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 Application(Resource): - """Schema for Application properties. - - 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 - :ivar object_id: ObjectId of Application. (internal use). - :vartype object_id: str - :param description: Description of Application. - :type description: str - :param friendly_name: Friendly name of Application. - :type friendly_name: str - :param file_path: Specifies a path for the executable file for the application. - :type file_path: str - :param msix_package_family_name: Specifies the package family name for MSIX applications. - :type msix_package_family_name: str - :param msix_package_application_id: Specifies the package application Id for MSIX applications. - :type msix_package_application_id: str - :param application_type: Resource Type of Application. Possible values include: "InBuilt", - "MsixApplication". - :type application_type: str or ~desktop_virtualization_api_client.models.RemoteApplicationType - :param command_line_setting: Required. Specifies whether this published application can be - launched with command line arguments provided by the client, command line arguments specified - at publish time, or no command line arguments at all. Possible values include: "DoNotAllow", - "Allow", "Require". - :type command_line_setting: str or ~desktop_virtualization_api_client.models.CommandLineSetting - :param command_line_arguments: Command Line Arguments for Application. - :type command_line_arguments: str - :param show_in_portal: Specifies whether to show the RemoteApp program in the RD Web Access - server. - :type show_in_portal: bool - :param icon_path: Path to icon. - :type icon_path: str - :param icon_index: Index of the icon. - :type icon_index: int - :ivar icon_hash: Hash of the icon. - :vartype icon_hash: str - :ivar icon_content: the icon a 64 bit string as a byte array. - :vartype icon_content: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - 'command_line_setting': {'required': True}, - 'icon_hash': {'readonly': True}, - 'icon_content': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'file_path': {'key': 'properties.filePath', 'type': 'str'}, - 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, - 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, - 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, - 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, - 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, - 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, - 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, - 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, - 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, - 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, - } - - def __init__( - self, - *, - command_line_setting: Union[str, "CommandLineSetting"], - description: Optional[str] = None, - friendly_name: Optional[str] = None, - file_path: Optional[str] = None, - msix_package_family_name: Optional[str] = None, - msix_package_application_id: Optional[str] = None, - application_type: Optional[Union[str, "RemoteApplicationType"]] = None, - command_line_arguments: Optional[str] = None, - show_in_portal: Optional[bool] = None, - icon_path: Optional[str] = None, - icon_index: Optional[int] = None, - **kwargs - ): - super(Application, self).__init__(**kwargs) - self.object_id = None - self.description = description - self.friendly_name = friendly_name - self.file_path = file_path - self.msix_package_family_name = msix_package_family_name - self.msix_package_application_id = msix_package_application_id - self.application_type = application_type - self.command_line_setting = command_line_setting - self.command_line_arguments = command_line_arguments - self.show_in_portal = show_in_portal - self.icon_path = icon_path - self.icon_index = icon_index - self.icon_hash = None - self.icon_content = None - - -class ResourceModelWithAllowedPropertySet(msrest.serialization.Model): - """The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. - - 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 - :param location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - managed_by: Optional[str] = None, - kind: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - plan: Optional["Plan"] = None, - **kwargs - ): - super(ResourceModelWithAllowedPropertySet, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.managed_by = managed_by - self.kind = kind - self.etag = None - self.tags = tags - self.identity = identity - self.sku = sku - self.plan = plan - - -class ApplicationGroup(ResourceModelWithAllowedPropertySet): - """Represents a ApplicationGroup 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. - - :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 location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of ApplicationGroup. (internal use). - :vartype object_id: str - :param description: Description of ApplicationGroup. - :type description: str - :param friendly_name: Friendly name of ApplicationGroup. - :type friendly_name: str - :param host_pool_arm_path: Required. HostPool arm path of ApplicationGroup. - :type host_pool_arm_path: str - :ivar workspace_arm_path: Workspace arm path of ApplicationGroup. - :vartype workspace_arm_path: str - :param application_group_type: Required. Resource Type of ApplicationGroup. Possible values - include: "RemoteApp", "Desktop". - :type application_group_type: str or - ~desktop_virtualization_api_client.models.ApplicationGroupType - :param migration_request: The registration info of HostPool. - :type migration_request: ~desktop_virtualization_api_client.models.MigrationRequestProperties - :ivar cloud_pc_resource: Is cloud pc resource. - :vartype cloud_pc_resource: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - 'host_pool_arm_path': {'required': True}, - 'workspace_arm_path': {'readonly': True}, - 'application_group_type': {'required': True}, - 'cloud_pc_resource': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'host_pool_arm_path': {'key': 'properties.hostPoolArmPath', 'type': 'str'}, - 'workspace_arm_path': {'key': 'properties.workspaceArmPath', 'type': 'str'}, - 'application_group_type': {'key': 'properties.applicationGroupType', 'type': 'str'}, - 'migration_request': {'key': 'properties.migrationRequest', 'type': 'MigrationRequestProperties'}, - 'cloud_pc_resource': {'key': 'properties.cloudPcResource', 'type': 'bool'}, - } - - def __init__( - self, - *, - host_pool_arm_path: str, - application_group_type: Union[str, "ApplicationGroupType"], - location: Optional[str] = None, - managed_by: Optional[str] = None, - kind: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - plan: Optional["Plan"] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - migration_request: Optional["MigrationRequestProperties"] = None, - **kwargs - ): - super(ApplicationGroup, self).__init__(location=location, managed_by=managed_by, kind=kind, tags=tags, identity=identity, sku=sku, plan=plan, **kwargs) - self.object_id = None - self.description = description - self.friendly_name = friendly_name - self.host_pool_arm_path = host_pool_arm_path - self.workspace_arm_path = None - self.application_group_type = application_group_type - self.migration_request = migration_request - self.cloud_pc_resource = None - - -class ApplicationGroupList(msrest.serialization.Model): - """List of ApplicationGroup definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of ApplicationGroup definitions. - :type value: list[~desktop_virtualization_api_client.models.ApplicationGroup] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ApplicationGroup"]] = None, - **kwargs - ): - super(ApplicationGroupList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ApplicationGroupPatch(Resource): - """ApplicationGroup properties that can be patched. - - 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 - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of ApplicationGroup. - :type description: str - :param friendly_name: Friendly name of ApplicationGroup. - :type friendly_name: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - **kwargs - ): - super(ApplicationGroupPatch, self).__init__(**kwargs) - self.tags = tags - self.description = description - self.friendly_name = friendly_name - - -class ApplicationList(msrest.serialization.Model): - """List of Application definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of Application definitions. - :type value: list[~desktop_virtualization_api_client.models.Application] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Application]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Application"]] = None, - **kwargs - ): - super(ApplicationList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ApplicationPatch(msrest.serialization.Model): - """Application properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of Application. - :type description: str - :param friendly_name: Friendly name of Application. - :type friendly_name: str - :param file_path: Specifies a path for the executable file for the application. - :type file_path: str - :param command_line_setting: Specifies whether this published application can be launched with - command line arguments provided by the client, command line arguments specified at publish - time, or no command line arguments at all. Possible values include: "DoNotAllow", "Allow", - "Require". - :type command_line_setting: str or ~desktop_virtualization_api_client.models.CommandLineSetting - :param command_line_arguments: Command Line Arguments for Application. - :type command_line_arguments: str - :param show_in_portal: Specifies whether to show the RemoteApp program in the RD Web Access - server. - :type show_in_portal: bool - :param icon_path: Path to icon. - :type icon_path: str - :param icon_index: Index of the icon. - :type icon_index: int - :param msix_package_family_name: Specifies the package family name for MSIX applications. - :type msix_package_family_name: str - :param msix_package_application_id: Specifies the package application Id for MSIX applications. - :type msix_package_application_id: str - :param application_type: Resource Type of Application. Possible values include: "InBuilt", - "MsixApplication". - :type application_type: str or ~desktop_virtualization_api_client.models.RemoteApplicationType - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'file_path': {'key': 'properties.filePath', 'type': 'str'}, - 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, - 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, - 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, - 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, - 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, - 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, - 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, - 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - file_path: Optional[str] = None, - command_line_setting: Optional[Union[str, "CommandLineSetting"]] = None, - command_line_arguments: Optional[str] = None, - show_in_portal: Optional[bool] = None, - icon_path: Optional[str] = None, - icon_index: Optional[int] = None, - msix_package_family_name: Optional[str] = None, - msix_package_application_id: Optional[str] = None, - application_type: Optional[Union[str, "RemoteApplicationType"]] = None, - **kwargs - ): - super(ApplicationPatch, self).__init__(**kwargs) - self.tags = tags - self.description = description - self.friendly_name = friendly_name - self.file_path = file_path - self.command_line_setting = command_line_setting - self.command_line_arguments = command_line_arguments - self.show_in_portal = show_in_portal - self.icon_path = icon_path - self.icon_index = icon_index - self.msix_package_family_name = msix_package_family_name - self.msix_package_application_id = msix_package_application_id - self.application_type = application_type - - -class CloudErrorProperties(msrest.serialization.Model): - """CloudErrorProperties. - - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - **kwargs - ): - super(CloudErrorProperties, self).__init__(**kwargs) - self.code = code - self.message = message - - -class Desktop(Resource): - """Schema for Desktop properties. - - 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 object_id: ObjectId of Desktop. (internal use). - :vartype object_id: str - :param description: Description of Desktop. - :type description: str - :param friendly_name: Friendly name of Desktop. - :type friendly_name: str - :ivar icon_hash: Hash of the icon. - :vartype icon_hash: str - :ivar icon_content: The icon a 64 bit string as a byte array. - :vartype icon_content: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - 'icon_hash': {'readonly': True}, - 'icon_content': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, - 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - **kwargs - ): - super(Desktop, self).__init__(**kwargs) - self.object_id = None - self.description = description - self.friendly_name = friendly_name - self.icon_hash = None - self.icon_content = None - - -class DesktopList(msrest.serialization.Model): - """List of Desktop definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of Desktop definitions. - :type value: list[~desktop_virtualization_api_client.models.Desktop] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Desktop]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Desktop"]] = None, - **kwargs - ): - super(DesktopList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class DesktopPatch(msrest.serialization.Model): - """Desktop properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of Desktop. - :type description: str - :param friendly_name: Friendly name of Desktop. - :type friendly_name: str - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - **kwargs - ): - super(DesktopPatch, self).__init__(**kwargs) - self.tags = tags - self.description = description - self.friendly_name = friendly_name - - -class ExpandMsixImage(Resource): - """Represents the definition of contents retrieved after expanding the MSIX Image. - - 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 - :param package_alias: Alias of MSIX Package. - :type package_alias: str - :param image_path: VHD/CIM image path on Network Share. - :type image_path: str - :param package_name: Package Name from appxmanifest.xml. - :type package_name: str - :param package_family_name: Package Family Name from appxmanifest.xml. Contains Package Name - and Publisher name. - :type package_family_name: str - :param package_full_name: Package Full Name from appxmanifest.xml. - :type package_full_name: str - :param display_name: User friendly Name to be displayed in the portal. - :type display_name: str - :param package_relative_path: Relative Path to the package inside the image. - :type package_relative_path: str - :param is_regular_registration: Specifies how to register Package in feed. - :type is_regular_registration: bool - :param is_active: Make this version of the package the active one across the hostpool. - :type is_active: bool - :param package_dependencies: List of package dependencies. - :type package_dependencies: - list[~desktop_virtualization_api_client.models.MsixPackageDependencies] - :param version: Package Version found in the appxmanifest.xml. - :type version: str - :param last_updated: Date Package was last updated, found in the appxmanifest.xml. - :type last_updated: ~datetime.datetime - :param package_applications: List of package applications. - :type package_applications: - list[~desktop_virtualization_api_client.models.MsixPackageApplications] - """ - - _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'}, - 'package_alias': {'key': 'properties.packageAlias', 'type': 'str'}, - 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, - 'package_name': {'key': 'properties.packageName', 'type': 'str'}, - 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, - 'package_full_name': {'key': 'properties.packageFullName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, - 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, - 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, - 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, - 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, - } - - def __init__( - self, - *, - package_alias: Optional[str] = None, - image_path: Optional[str] = None, - package_name: Optional[str] = None, - package_family_name: Optional[str] = None, - package_full_name: Optional[str] = None, - display_name: Optional[str] = None, - package_relative_path: Optional[str] = None, - is_regular_registration: Optional[bool] = None, - is_active: Optional[bool] = None, - package_dependencies: Optional[List["MsixPackageDependencies"]] = None, - version: Optional[str] = None, - last_updated: Optional[datetime.datetime] = None, - package_applications: Optional[List["MsixPackageApplications"]] = None, - **kwargs - ): - super(ExpandMsixImage, self).__init__(**kwargs) - self.package_alias = package_alias - self.image_path = image_path - self.package_name = package_name - self.package_family_name = package_family_name - self.package_full_name = package_full_name - self.display_name = display_name - self.package_relative_path = package_relative_path - self.is_regular_registration = is_regular_registration - self.is_active = is_active - self.package_dependencies = package_dependencies - self.version = version - self.last_updated = last_updated - self.package_applications = package_applications - - -class ExpandMsixImageList(msrest.serialization.Model): - """List of MSIX package properties retrieved from MSIX Image expansion. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of MSIX package properties from give MSIX Image. - :type value: list[~desktop_virtualization_api_client.models.ExpandMsixImage] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpandMsixImage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpandMsixImage"]] = None, - **kwargs - ): - super(ExpandMsixImageList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class HostPool(ResourceModelWithAllowedPropertySet): - """Represents a HostPool 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. - - :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 location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of HostPool. (internal use). - :vartype object_id: str - :param friendly_name: Friendly name of HostPool. - :type friendly_name: str - :param description: Description of HostPool. - :type description: str - :param host_pool_type: Required. HostPool type for desktop. Possible values include: - "Personal", "Pooled", "BYODesktop". - :type host_pool_type: str or ~desktop_virtualization_api_client.models.HostPoolType - :param personal_desktop_assignment_type: PersonalDesktopAssignment type for HostPool. Possible - values include: "Automatic", "Direct". - :type personal_desktop_assignment_type: str or - ~desktop_virtualization_api_client.models.PersonalDesktopAssignmentType - :param custom_rdp_property: Custom rdp property of HostPool. - :type custom_rdp_property: str - :param max_session_limit: The max session limit of HostPool. - :type max_session_limit: int - :param load_balancer_type: Required. The type of the load balancer. Possible values include: - "BreadthFirst", "DepthFirst", "Persistent". - :type load_balancer_type: str or ~desktop_virtualization_api_client.models.LoadBalancerType - :param ring: The ring number of HostPool. - :type ring: int - :param validation_environment: Is validation environment. - :type validation_environment: bool - :param registration_info: The registration info of HostPool. - :type registration_info: ~desktop_virtualization_api_client.models.RegistrationInfo - :param vm_template: VM template for sessionhosts configuration within hostpool. - :type vm_template: str - :ivar application_group_references: List of applicationGroup links. - :vartype application_group_references: list[str] - :param ssoadfs_authority: URL to customer ADFS server for signing WVD SSO certificates. - :type ssoadfs_authority: str - :param sso_client_id: ClientId for the registered Relying Party used to issue WVD SSO - certificates. - :type sso_client_id: str - :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing the secret used for - communication to ADFS. - :type sso_client_secret_key_vault_path: str - :param sso_secret_type: The type of single sign on Secret Type. Possible values include: - "SharedKey", "Certificate", "SharedKeyInKeyVault", "CertificateInKeyVault". - :type sso_secret_type: str or ~desktop_virtualization_api_client.models.SsoSecretType - :param preferred_app_group_type: Required. The type of preferred application group type, - default to Desktop Application Group. Possible values include: "None", "Desktop", - "RailApplications". - :type preferred_app_group_type: str or - ~desktop_virtualization_api_client.models.PreferredAppGroupType - :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect feature. - :type start_vm_on_connect: bool - :param migration_request: The registration info of HostPool. - :type migration_request: ~desktop_virtualization_api_client.models.MigrationRequestProperties - :ivar cloud_pc_resource: Is cloud pc resource. - :vartype cloud_pc_resource: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - 'host_pool_type': {'required': True}, - 'load_balancer_type': {'required': True}, - 'application_group_references': {'readonly': True}, - 'preferred_app_group_type': {'required': True}, - 'cloud_pc_resource': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, - 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, - 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, - 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, - 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, - 'ring': {'key': 'properties.ring', 'type': 'int'}, - 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, - 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfo'}, - 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, - 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, - 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, - 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, - 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, - 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, - 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, - 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, - 'migration_request': {'key': 'properties.migrationRequest', 'type': 'MigrationRequestProperties'}, - 'cloud_pc_resource': {'key': 'properties.cloudPcResource', 'type': 'bool'}, - } - - def __init__( - self, - *, - host_pool_type: Union[str, "HostPoolType"], - load_balancer_type: Union[str, "LoadBalancerType"], - preferred_app_group_type: Union[str, "PreferredAppGroupType"], - location: Optional[str] = None, - managed_by: Optional[str] = None, - kind: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - plan: Optional["Plan"] = None, - friendly_name: Optional[str] = None, - description: Optional[str] = None, - personal_desktop_assignment_type: Optional[Union[str, "PersonalDesktopAssignmentType"]] = None, - custom_rdp_property: Optional[str] = None, - max_session_limit: Optional[int] = None, - ring: Optional[int] = None, - validation_environment: Optional[bool] = None, - registration_info: Optional["RegistrationInfo"] = None, - vm_template: Optional[str] = None, - ssoadfs_authority: Optional[str] = None, - sso_client_id: Optional[str] = None, - sso_client_secret_key_vault_path: Optional[str] = None, - sso_secret_type: Optional[Union[str, "SsoSecretType"]] = None, - start_vm_on_connect: Optional[bool] = None, - migration_request: Optional["MigrationRequestProperties"] = None, - **kwargs - ): - super(HostPool, self).__init__(location=location, managed_by=managed_by, kind=kind, tags=tags, identity=identity, sku=sku, plan=plan, **kwargs) - self.object_id = None - self.friendly_name = friendly_name - self.description = description - self.host_pool_type = host_pool_type - self.personal_desktop_assignment_type = personal_desktop_assignment_type - self.custom_rdp_property = custom_rdp_property - self.max_session_limit = max_session_limit - self.load_balancer_type = load_balancer_type - self.ring = ring - self.validation_environment = validation_environment - self.registration_info = registration_info - self.vm_template = vm_template - self.application_group_references = None - self.ssoadfs_authority = ssoadfs_authority - self.sso_client_id = sso_client_id - self.sso_client_secret_key_vault_path = sso_client_secret_key_vault_path - self.sso_secret_type = sso_secret_type - self.preferred_app_group_type = preferred_app_group_type - self.start_vm_on_connect = start_vm_on_connect - self.migration_request = migration_request - self.cloud_pc_resource = None - - -class HostPoolList(msrest.serialization.Model): - """List of HostPool definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of HostPool definitions. - :type value: list[~desktop_virtualization_api_client.models.HostPool] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[HostPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["HostPool"]] = None, - **kwargs - ): - super(HostPoolList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class HostPoolPatch(Resource): - """HostPool properties that can be patched. - - 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 - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param friendly_name: Friendly name of HostPool. - :type friendly_name: str - :param description: Description of HostPool. - :type description: str - :param custom_rdp_property: Custom rdp property of HostPool. - :type custom_rdp_property: str - :param max_session_limit: The max session limit of HostPool. - :type max_session_limit: int - :param personal_desktop_assignment_type: PersonalDesktopAssignment type for HostPool. Possible - values include: "Automatic", "Direct". - :type personal_desktop_assignment_type: str or - ~desktop_virtualization_api_client.models.PersonalDesktopAssignmentType - :param load_balancer_type: The type of the load balancer. Possible values include: - "BreadthFirst", "DepthFirst", "Persistent". - :type load_balancer_type: str or ~desktop_virtualization_api_client.models.LoadBalancerType - :param ring: The ring number of HostPool. - :type ring: int - :param validation_environment: Is validation environment. - :type validation_environment: bool - :param registration_info: The registration info of HostPool. - :type registration_info: ~desktop_virtualization_api_client.models.RegistrationInfoPatch - :param vm_template: VM template for sessionhosts configuration within hostpool. - :type vm_template: str - :param ssoadfs_authority: URL to customer ADFS server for signing WVD SSO certificates. - :type ssoadfs_authority: str - :param sso_client_id: ClientId for the registered Relying Party used to issue WVD SSO - certificates. - :type sso_client_id: str - :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing the secret used for - communication to ADFS. - :type sso_client_secret_key_vault_path: str - :param sso_secret_type: The type of single sign on Secret Type. Possible values include: - "SharedKey", "Certificate", "SharedKeyInKeyVault", "CertificateInKeyVault". - :type sso_secret_type: str or ~desktop_virtualization_api_client.models.SsoSecretType - :param preferred_app_group_type: The type of preferred application group type, default to - Desktop Application Group. Possible values include: "None", "Desktop", "RailApplications". - :type preferred_app_group_type: str or - ~desktop_virtualization_api_client.models.PreferredAppGroupType - :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect feature. - :type start_vm_on_connect: bool - """ - - _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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, - 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, - 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, - 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, - 'ring': {'key': 'properties.ring', 'type': 'int'}, - 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, - 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfoPatch'}, - 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, - 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, - 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, - 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, - 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, - 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, - 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - friendly_name: Optional[str] = None, - description: Optional[str] = None, - custom_rdp_property: Optional[str] = None, - max_session_limit: Optional[int] = None, - personal_desktop_assignment_type: Optional[Union[str, "PersonalDesktopAssignmentType"]] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = None, - ring: Optional[int] = None, - validation_environment: Optional[bool] = None, - registration_info: Optional["RegistrationInfoPatch"] = None, - vm_template: Optional[str] = None, - ssoadfs_authority: Optional[str] = None, - sso_client_id: Optional[str] = None, - sso_client_secret_key_vault_path: Optional[str] = None, - sso_secret_type: Optional[Union[str, "SsoSecretType"]] = None, - preferred_app_group_type: Optional[Union[str, "PreferredAppGroupType"]] = None, - start_vm_on_connect: Optional[bool] = None, - **kwargs - ): - super(HostPoolPatch, self).__init__(**kwargs) - self.tags = tags - self.friendly_name = friendly_name - self.description = description - self.custom_rdp_property = custom_rdp_property - self.max_session_limit = max_session_limit - self.personal_desktop_assignment_type = personal_desktop_assignment_type - self.load_balancer_type = load_balancer_type - self.ring = ring - self.validation_environment = validation_environment - self.registration_info = registration_info - self.vm_template = vm_template - self.ssoadfs_authority = ssoadfs_authority - self.sso_client_id = sso_client_id - self.sso_client_secret_key_vault_path = sso_client_secret_key_vault_path - self.sso_secret_type = sso_secret_type - self.preferred_app_group_type = preferred_app_group_type - self.start_vm_on_connect = start_vm_on_connect - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - - -class LogSpecification(msrest.serialization.Model): - """Specifications of the Log for Azure Monitoring. - - :param name: Name of the log. - :type name: str - :param display_name: Localized friendly display name of the log. - :type display_name: str - :param blob_duration: Blob duration of the log. - :type blob_duration: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - blob_duration: Optional[str] = None, - **kwargs - ): - super(LogSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration - - -class MigrationRequestProperties(msrest.serialization.Model): - """Properties for arm migration. - - :param operation: The type of operation for migration. Possible values include: "Start", - "Revoke", "Complete", "Hide", "Unhide". - :type operation: str or ~desktop_virtualization_api_client.models.Operation - :param migration_path: The path to the legacy object to migrate. - :type migration_path: str - """ - - _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'migration_path': {'key': 'migrationPath', 'type': 'str'}, - } - - def __init__( - self, - *, - operation: Optional[Union[str, "Operation"]] = None, - migration_path: Optional[str] = None, - **kwargs - ): - super(MigrationRequestProperties, self).__init__(**kwargs) - self.operation = operation - self.migration_path = migration_path - - -class MsixImageUri(msrest.serialization.Model): - """Represents URI referring to MSIX Image. - - :param uri: URI to Image. - :type uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - super(MsixImageUri, self).__init__(**kwargs) - self.uri = uri - - -class MsixPackage(Resource): - """Schema for MSIX Package properties. - - 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 - :param image_path: VHD/CIM image path on Network Share. - :type image_path: str - :param package_name: Package Name from appxmanifest.xml. - :type package_name: str - :param package_family_name: Package Family Name from appxmanifest.xml. Contains Package Name - and Publisher name. - :type package_family_name: str - :param display_name: User friendly Name to be displayed in the portal. - :type display_name: str - :param package_relative_path: Relative Path to the package inside the image. - :type package_relative_path: str - :param is_regular_registration: Specifies how to register Package in feed. - :type is_regular_registration: bool - :param is_active: Make this version of the package the active one across the hostpool. - :type is_active: bool - :param package_dependencies: List of package dependencies. - :type package_dependencies: - list[~desktop_virtualization_api_client.models.MsixPackageDependencies] - :param version: Package Version found in the appxmanifest.xml. - :type version: str - :param last_updated: Date Package was last updated, found in the appxmanifest.xml. - :type last_updated: ~datetime.datetime - :param package_applications: List of package applications. - :type package_applications: - list[~desktop_virtualization_api_client.models.MsixPackageApplications] - """ - - _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'}, - 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, - 'package_name': {'key': 'properties.packageName', 'type': 'str'}, - 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, - 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, - 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, - 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, - 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, - } - - def __init__( - self, - *, - image_path: Optional[str] = None, - package_name: Optional[str] = None, - package_family_name: Optional[str] = None, - display_name: Optional[str] = None, - package_relative_path: Optional[str] = None, - is_regular_registration: Optional[bool] = None, - is_active: Optional[bool] = None, - package_dependencies: Optional[List["MsixPackageDependencies"]] = None, - version: Optional[str] = None, - last_updated: Optional[datetime.datetime] = None, - package_applications: Optional[List["MsixPackageApplications"]] = None, - **kwargs - ): - super(MsixPackage, self).__init__(**kwargs) - self.image_path = image_path - self.package_name = package_name - self.package_family_name = package_family_name - self.display_name = display_name - self.package_relative_path = package_relative_path - self.is_regular_registration = is_regular_registration - self.is_active = is_active - self.package_dependencies = package_dependencies - self.version = version - self.last_updated = last_updated - self.package_applications = package_applications - - -class MsixPackageApplications(msrest.serialization.Model): - """Schema for MSIX Package Application properties. - - :param app_id: Package Application Id, found in appxmanifest.xml. - :type app_id: str - :param description: Description of Package Application. - :type description: str - :param app_user_model_id: Used to activate Package Application. Consists of Package Name and - ApplicationID. Found in appxmanifest.xml. - :type app_user_model_id: str - :param friendly_name: User friendly name. - :type friendly_name: str - :param icon_image_name: User friendly name. - :type icon_image_name: str - :param raw_icon: the icon a 64 bit string as a byte array. - :type raw_icon: bytearray - :param raw_png: the icon a 64 bit string as a byte array. - :type raw_png: bytearray - """ - - _attribute_map = { - 'app_id': {'key': 'appId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'app_user_model_id': {'key': 'appUserModelID', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'icon_image_name': {'key': 'iconImageName', 'type': 'str'}, - 'raw_icon': {'key': 'rawIcon', 'type': 'bytearray'}, - 'raw_png': {'key': 'rawPng', 'type': 'bytearray'}, - } - - def __init__( - self, - *, - app_id: Optional[str] = None, - description: Optional[str] = None, - app_user_model_id: Optional[str] = None, - friendly_name: Optional[str] = None, - icon_image_name: Optional[str] = None, - raw_icon: Optional[bytearray] = None, - raw_png: Optional[bytearray] = None, - **kwargs - ): - super(MsixPackageApplications, self).__init__(**kwargs) - self.app_id = app_id - self.description = description - self.app_user_model_id = app_user_model_id - self.friendly_name = friendly_name - self.icon_image_name = icon_image_name - self.raw_icon = raw_icon - self.raw_png = raw_png - - -class MsixPackageDependencies(msrest.serialization.Model): - """Schema for MSIX Package Dependencies properties. - - :param dependency_name: Name of package dependency. - :type dependency_name: str - :param publisher: Name of dependency publisher. - :type publisher: str - :param min_version: Dependency version required. - :type min_version: str - """ - - _attribute_map = { - 'dependency_name': {'key': 'dependencyName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'min_version': {'key': 'minVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - dependency_name: Optional[str] = None, - publisher: Optional[str] = None, - min_version: Optional[str] = None, - **kwargs - ): - super(MsixPackageDependencies, self).__init__(**kwargs) - self.dependency_name = dependency_name - self.publisher = publisher - self.min_version = min_version - - -class MsixPackageList(msrest.serialization.Model): - """List of MSIX Package definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of MSIX Package definitions. - :type value: list[~desktop_virtualization_api_client.models.MsixPackage] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MsixPackage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["MsixPackage"]] = None, - **kwargs - ): - super(MsixPackageList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class MsixPackagePatch(Resource): - """MSIX Package properties that can be patched. - - 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 - :param is_active: Set a version of the package to be active across hostpool. - :type is_active: bool - :param is_regular_registration: Set Registration mode. Regular or Delayed. - :type is_regular_registration: bool - :param display_name: Display name for MSIX Package. - :type display_name: 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'}, - 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, - 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - } - - def __init__( - self, - *, - is_active: Optional[bool] = None, - is_regular_registration: Optional[bool] = None, - display_name: Optional[str] = None, - **kwargs - ): - super(MsixPackagePatch, self).__init__(**kwargs) - self.is_active = is_active - self.is_regular_registration = is_regular_registration - self.display_name = display_name - - -class OperationProperties(msrest.serialization.Model): - """Properties of the operation. - - :param service_specification: Service specification payload. - :type service_specification: ~desktop_virtualization_api_client.models.ServiceSpecification - """ - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - *, - service_specification: Optional["ServiceSpecification"] = None, - **kwargs - ): - super(OperationProperties, self).__init__(**kwargs) - self.service_specification = service_specification - - -class Plan(msrest.serialization.Model): - """Plan for the resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. A user defined name of the 3rd Party Artifact that is being procured. - :type name: str - :param publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. - NewRelic. - :type publisher: str - :param product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product - maps to the OfferID specified for the artifact at the time of Data Market onboarding. - :type product: str - :param promotion_code: A publisher provided promotion code as provisioned in Data Market for - the said product/artifact. - :type promotion_code: str - :param version: The version of the desired product/artifact. - :type version: str - """ - - _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'product': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - publisher: str, - product: str, - promotion_code: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - super(Plan, self).__init__(**kwargs) - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - self.version = version - - -class RegistrationInfo(msrest.serialization.Model): - """Represents a RegistrationInfo definition. - - :param expiration_time: Expiration time of registration token. - :type expiration_time: ~datetime.datetime - :param token: The registration token base64 encoded string. - :type token: str - :param registration_token_operation: The type of resetting the token. Possible values include: - "Delete", "None", "Update". - :type registration_token_operation: str or - ~desktop_virtualization_api_client.models.RegistrationTokenOperation - """ - - _attribute_map = { - 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, - 'token': {'key': 'token', 'type': 'str'}, - 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, - } - - def __init__( - self, - *, - expiration_time: Optional[datetime.datetime] = None, - token: Optional[str] = None, - registration_token_operation: Optional[Union[str, "RegistrationTokenOperation"]] = None, - **kwargs - ): - super(RegistrationInfo, self).__init__(**kwargs) - self.expiration_time = expiration_time - self.token = token - self.registration_token_operation = registration_token_operation - - -class RegistrationInfoPatch(msrest.serialization.Model): - """Represents a RegistrationInfo definition. - - :param expiration_time: Expiration time of registration token. - :type expiration_time: ~datetime.datetime - :param registration_token_operation: The type of resetting the token. Possible values include: - "Delete", "None", "Update". - :type registration_token_operation: str or - ~desktop_virtualization_api_client.models.RegistrationTokenOperation - """ - - _attribute_map = { - 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, - 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, - } - - def __init__( - self, - *, - expiration_time: Optional[datetime.datetime] = None, - registration_token_operation: Optional[Union[str, "RegistrationTokenOperation"]] = None, - **kwargs - ): - super(RegistrationInfoPatch, self).__init__(**kwargs) - self.expiration_time = expiration_time - self.registration_token_operation = registration_token_operation - - -class ResourceModelWithAllowedPropertySetIdentity(Identity): - """ResourceModelWithAllowedPropertySetIdentity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__( - self, - **kwargs - ): - super(ResourceModelWithAllowedPropertySetIdentity, self).__init__(**kwargs) - - -class ResourceModelWithAllowedPropertySetPlan(Plan): - """ResourceModelWithAllowedPropertySetPlan. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. A user defined name of the 3rd Party Artifact that is being procured. - :type name: str - :param publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. - NewRelic. - :type publisher: str - :param product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product - maps to the OfferID specified for the artifact at the time of Data Market onboarding. - :type product: str - :param promotion_code: A publisher provided promotion code as provisioned in Data Market for - the said product/artifact. - :type promotion_code: str - :param version: The version of the desired product/artifact. - :type version: str - """ - - _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'product': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - publisher: str, - product: str, - promotion_code: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - super(ResourceModelWithAllowedPropertySetPlan, self).__init__(name=name, publisher=publisher, product=product, promotion_code=promotion_code, version=version, **kwargs) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :type name: str - :param tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :type tier: str or ~desktop_virtualization_api_client.models.SkuTier - :param size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :type size: str - :param family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :type family: str - :param capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class ResourceModelWithAllowedPropertySetSku(Sku): - """ResourceModelWithAllowedPropertySetSku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :type name: str - :param tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :type tier: str or ~desktop_virtualization_api_client.models.SkuTier - :param size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :type size: str - :param family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :type family: str - :param capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - super(ResourceModelWithAllowedPropertySetSku, self).__init__(name=name, tier=tier, size=size, family=family, capacity=capacity, **kwargs) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~desktop_virtualization_api_client.models.ResourceProviderOperationDisplay - :param is_data_action: Is a data action. - :type is_data_action: bool - :param properties: Properties of the operation. - :type properties: ~desktop_virtualization_api_client.models.OperationProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'OperationProperties'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["ResourceProviderOperationDisplay"] = None, - is_data_action: Optional[bool] = None, - properties: Optional["OperationProperties"] = None, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = name - self.display = display - self.is_data_action = is_data_action - self.properties = properties - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft Desktop Virtualization. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this 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: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - :param value: List of operations supported by this resource provider. - :type value: list[~desktop_virtualization_api_client.models.ResourceProviderOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - } - - def __init__( - self, - *, - value: Optional[List["ResourceProviderOperation"]] = None, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = value - - -class ScalingHostPoolReference(msrest.serialization.Model): - """Scaling plan reference to hostpool. - - :param host_pool_arm_path: Arm path of referenced hostpool. - :type host_pool_arm_path: str - :param scaling_plan_enabled: Is the scaling plan enabled for this hostpool. - :type scaling_plan_enabled: bool - """ - - _attribute_map = { - 'host_pool_arm_path': {'key': 'hostPoolArmPath', 'type': 'str'}, - 'scaling_plan_enabled': {'key': 'scalingPlanEnabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - host_pool_arm_path: Optional[str] = None, - scaling_plan_enabled: Optional[bool] = None, - **kwargs - ): - super(ScalingHostPoolReference, self).__init__(**kwargs) - self.host_pool_arm_path = host_pool_arm_path - self.scaling_plan_enabled = scaling_plan_enabled - - -class ScalingPlan(ResourceModelWithAllowedPropertySet): - """Represents a scaling plan definition. - - 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 - :param location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of scaling plan. (internal use). - :vartype object_id: str - :param description: Description of scaling plan. - :type description: str - :param friendly_name: User friendly name of scaling plan. - :type friendly_name: str - :param time_zone: Timezone of the scaling plan. - :type time_zone: str - :param host_pool_type: HostPool type for desktop. Possible values include: "Personal", - "Pooled", "BYODesktop". - :type host_pool_type: str or ~desktop_virtualization_api_client.models.HostPoolType - :param exclusion_tag: Exclusion tag for scaling plan. - :type exclusion_tag: str - :param schedules: List of ScalingSchedule definitions. - :type schedules: list[~desktop_virtualization_api_client.models.ScalingSchedule] - :param host_pool_references: List of ScalingHostPoolReference definitions. - :type host_pool_references: - list[~desktop_virtualization_api_client.models.ScalingHostPoolReference] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, - 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, - 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, - 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, - 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - managed_by: Optional[str] = None, - kind: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - plan: Optional["Plan"] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - time_zone: Optional[str] = None, - host_pool_type: Optional[Union[str, "HostPoolType"]] = None, - exclusion_tag: Optional[str] = None, - schedules: Optional[List["ScalingSchedule"]] = None, - host_pool_references: Optional[List["ScalingHostPoolReference"]] = None, - **kwargs - ): - super(ScalingPlan, self).__init__(location=location, managed_by=managed_by, kind=kind, tags=tags, identity=identity, sku=sku, plan=plan, **kwargs) - self.object_id = None - self.description = description - self.friendly_name = friendly_name - self.time_zone = time_zone - self.host_pool_type = host_pool_type - self.exclusion_tag = exclusion_tag - self.schedules = schedules - self.host_pool_references = host_pool_references - - -class ScalingPlanList(msrest.serialization.Model): - """List of scaling plan definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of scaling plan definitions. - :type value: list[~desktop_virtualization_api_client.models.ScalingPlan] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ScalingPlan]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ScalingPlan"]] = None, - **kwargs - ): - super(ScalingPlanList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ScalingPlanPatch(msrest.serialization.Model): - """Scaling plan properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of scaling plan. - :type description: str - :param friendly_name: User friendly name of scaling plan. - :type friendly_name: str - :param time_zone: Timezone of the scaling plan. - :type time_zone: str - :param host_pool_type: HostPool type for desktop. Possible values include: "Personal", - "Pooled", "BYODesktop". - :type host_pool_type: str or ~desktop_virtualization_api_client.models.HostPoolType - :param exclusion_tag: Exclusion tag for scaling plan. - :type exclusion_tag: str - :param schedules: List of ScalingSchedule definitions. - :type schedules: list[~desktop_virtualization_api_client.models.ScalingSchedule] - :param host_pool_references: List of ScalingHostPoolReference definitions. - :type host_pool_references: - list[~desktop_virtualization_api_client.models.ScalingHostPoolReference] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, - 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, - 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, - 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, - 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - time_zone: Optional[str] = None, - host_pool_type: Optional[Union[str, "HostPoolType"]] = None, - exclusion_tag: Optional[str] = None, - schedules: Optional[List["ScalingSchedule"]] = None, - host_pool_references: Optional[List["ScalingHostPoolReference"]] = None, - **kwargs - ): - super(ScalingPlanPatch, self).__init__(**kwargs) - self.tags = tags - self.description = description - self.friendly_name = friendly_name - self.time_zone = time_zone - self.host_pool_type = host_pool_type - self.exclusion_tag = exclusion_tag - self.schedules = schedules - self.host_pool_references = host_pool_references - - -class ScalingSchedule(msrest.serialization.Model): - """Scaling plan schedule. - - :param name: Name of the scaling schedule. - :type name: str - :param days_of_week: Set of days of the week on which this schedule is active. - :type days_of_week: list[str or - ~desktop_virtualization_api_client.models.ScalingScheduleDaysOfWeekItem] - :param ramp_up_start_time: Starting time for ramp up period. - :type ramp_up_start_time: ~datetime.datetime - :param ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp up period. Possible - values include: "BreadthFirst", "DepthFirst". - :type ramp_up_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - :param ramp_up_minimum_hosts_pct: Minimum host percentage for ramp up period. - :type ramp_up_minimum_hosts_pct: int - :param ramp_up_capacity_threshold_pct: Capacity threshold for ramp up period. - :type ramp_up_capacity_threshold_pct: int - :param peak_start_time: Starting time for peak period. - :type peak_start_time: ~datetime.datetime - :param peak_load_balancing_algorithm: Load balancing algorithm for peak period. Possible values - include: "BreadthFirst", "DepthFirst". - :type peak_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - :param ramp_down_start_time: Starting time for ramp down period. - :type ramp_down_start_time: ~datetime.datetime - :param ramp_down_load_balancing_algorithm: Load balancing algorithm for ramp down period. - Possible values include: "BreadthFirst", "DepthFirst". - :type ramp_down_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - :param ramp_down_minimum_hosts_pct: Minimum host percentage for ramp down period. - :type ramp_down_minimum_hosts_pct: int - :param ramp_down_capacity_threshold_pct: Capacity threshold for ramp down period. - :type ramp_down_capacity_threshold_pct: int - :param ramp_down_force_logoff_users: Should users be logged off forcefully from hosts. - :type ramp_down_force_logoff_users: bool - :param ramp_down_stop_hosts_when: Specifies when to stop hosts during ramp down period. - Possible values include: "ZeroSessions", "ZeroActiveSessions". - :type ramp_down_stop_hosts_when: str or ~desktop_virtualization_api_client.models.StopHostsWhen - :param ramp_down_wait_time_minutes: Number of minutes to wait to stop hosts during ramp down - period. - :type ramp_down_wait_time_minutes: int - :param ramp_down_notification_message: Notification message for users during ramp down period. - :type ramp_down_notification_message: str - :param off_peak_start_time: Starting time for off-peak period. - :type off_peak_start_time: ~datetime.datetime - :param off_peak_load_balancing_algorithm: Load balancing algorithm for off-peak period. - Possible values include: "BreadthFirst", "DepthFirst". - :type off_peak_load_balancing_algorithm: str or - ~desktop_virtualization_api_client.models.SessionHostLoadBalancingAlgorithm - """ - - _validation = { - 'ramp_up_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, - 'ramp_up_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, - 'ramp_down_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, - 'ramp_down_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'days_of_week': {'key': 'daysOfWeek', 'type': '[str]'}, - 'ramp_up_start_time': {'key': 'rampUpStartTime', 'type': 'iso-8601'}, - 'ramp_up_load_balancing_algorithm': {'key': 'rampUpLoadBalancingAlgorithm', 'type': 'str'}, - 'ramp_up_minimum_hosts_pct': {'key': 'rampUpMinimumHostsPct', 'type': 'int'}, - 'ramp_up_capacity_threshold_pct': {'key': 'rampUpCapacityThresholdPct', 'type': 'int'}, - 'peak_start_time': {'key': 'peakStartTime', 'type': 'iso-8601'}, - 'peak_load_balancing_algorithm': {'key': 'peakLoadBalancingAlgorithm', 'type': 'str'}, - 'ramp_down_start_time': {'key': 'rampDownStartTime', 'type': 'iso-8601'}, - 'ramp_down_load_balancing_algorithm': {'key': 'rampDownLoadBalancingAlgorithm', 'type': 'str'}, - 'ramp_down_minimum_hosts_pct': {'key': 'rampDownMinimumHostsPct', 'type': 'int'}, - 'ramp_down_capacity_threshold_pct': {'key': 'rampDownCapacityThresholdPct', 'type': 'int'}, - 'ramp_down_force_logoff_users': {'key': 'rampDownForceLogoffUsers', 'type': 'bool'}, - 'ramp_down_stop_hosts_when': {'key': 'rampDownStopHostsWhen', 'type': 'str'}, - 'ramp_down_wait_time_minutes': {'key': 'rampDownWaitTimeMinutes', 'type': 'int'}, - 'ramp_down_notification_message': {'key': 'rampDownNotificationMessage', 'type': 'str'}, - 'off_peak_start_time': {'key': 'offPeakStartTime', 'type': 'iso-8601'}, - 'off_peak_load_balancing_algorithm': {'key': 'offPeakLoadBalancingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - days_of_week: Optional[List[Union[str, "ScalingScheduleDaysOfWeekItem"]]] = None, - ramp_up_start_time: Optional[datetime.datetime] = None, - ramp_up_load_balancing_algorithm: Optional[Union[str, "SessionHostLoadBalancingAlgorithm"]] = None, - ramp_up_minimum_hosts_pct: Optional[int] = None, - ramp_up_capacity_threshold_pct: Optional[int] = None, - peak_start_time: Optional[datetime.datetime] = None, - peak_load_balancing_algorithm: Optional[Union[str, "SessionHostLoadBalancingAlgorithm"]] = None, - ramp_down_start_time: Optional[datetime.datetime] = None, - ramp_down_load_balancing_algorithm: Optional[Union[str, "SessionHostLoadBalancingAlgorithm"]] = None, - ramp_down_minimum_hosts_pct: Optional[int] = None, - ramp_down_capacity_threshold_pct: Optional[int] = None, - ramp_down_force_logoff_users: Optional[bool] = None, - ramp_down_stop_hosts_when: Optional[Union[str, "StopHostsWhen"]] = None, - ramp_down_wait_time_minutes: Optional[int] = None, - ramp_down_notification_message: Optional[str] = None, - off_peak_start_time: Optional[datetime.datetime] = None, - off_peak_load_balancing_algorithm: Optional[Union[str, "SessionHostLoadBalancingAlgorithm"]] = None, - **kwargs - ): - super(ScalingSchedule, self).__init__(**kwargs) - self.name = name - self.days_of_week = days_of_week - self.ramp_up_start_time = ramp_up_start_time - self.ramp_up_load_balancing_algorithm = ramp_up_load_balancing_algorithm - self.ramp_up_minimum_hosts_pct = ramp_up_minimum_hosts_pct - self.ramp_up_capacity_threshold_pct = ramp_up_capacity_threshold_pct - self.peak_start_time = peak_start_time - self.peak_load_balancing_algorithm = peak_load_balancing_algorithm - self.ramp_down_start_time = ramp_down_start_time - self.ramp_down_load_balancing_algorithm = ramp_down_load_balancing_algorithm - self.ramp_down_minimum_hosts_pct = ramp_down_minimum_hosts_pct - self.ramp_down_capacity_threshold_pct = ramp_down_capacity_threshold_pct - self.ramp_down_force_logoff_users = ramp_down_force_logoff_users - self.ramp_down_stop_hosts_when = ramp_down_stop_hosts_when - self.ramp_down_wait_time_minutes = ramp_down_wait_time_minutes - self.ramp_down_notification_message = ramp_down_notification_message - self.off_peak_start_time = off_peak_start_time - self.off_peak_load_balancing_algorithm = off_peak_load_balancing_algorithm - - -class SendMessage(msrest.serialization.Model): - """Represents message sent to a UserSession. - - :param message_title: Title of message. - :type message_title: str - :param message_body: Body of message. - :type message_body: str - """ - - _attribute_map = { - 'message_title': {'key': 'messageTitle', 'type': 'str'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, - } - - def __init__( - self, - *, - message_title: Optional[str] = None, - message_body: Optional[str] = None, - **kwargs - ): - super(SendMessage, self).__init__(**kwargs) - self.message_title = message_title - self.message_body = message_body - - -class ServiceSpecification(msrest.serialization.Model): - """Service specification payload. - - :param log_specifications: Specifications of the Log for Azure Monitoring. - :type log_specifications: list[~desktop_virtualization_api_client.models.LogSpecification] - """ - - _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - } - - def __init__( - self, - *, - log_specifications: Optional[List["LogSpecification"]] = None, - **kwargs - ): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = log_specifications - - -class SessionHost(Resource): - """Represents a SessionHost definition. - - 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 object_id: ObjectId of SessionHost. (internal use). - :vartype object_id: str - :param last_heart_beat: Last heart beat from SessionHost. - :type last_heart_beat: ~datetime.datetime - :param sessions: Number of sessions on SessionHost. - :type sessions: int - :param agent_version: Version of agent on SessionHost. - :type agent_version: str - :param allow_new_session: Allow a new session. - :type allow_new_session: bool - :ivar virtual_machine_id: Virtual Machine Id of SessionHost's underlying virtual machine. - :vartype virtual_machine_id: str - :ivar resource_id: Resource Id of SessionHost's underlying virtual machine. - :vartype resource_id: str - :param assigned_user: User assigned to SessionHost. - :type assigned_user: str - :param status: Status for a SessionHost. Possible values include: "Available", "Unavailable", - "Shutdown", "Disconnected", "Upgrading", "UpgradeFailed", "NoHeartbeat", "NotJoinedToDomain", - "DomainTrustRelationshipLost", "SxSStackListenerNotReady", "FSLogixNotHealthy", - "NeedsAssistance". - :type status: str or ~desktop_virtualization_api_client.models.Status - :ivar status_timestamp: The timestamp of the status. - :vartype status_timestamp: ~datetime.datetime - :param os_version: The version of the OS on the session host. - :type os_version: str - :param sx_s_stack_version: The version of the side by side stack on the session host. - :type sx_s_stack_version: str - :param update_state: Update state of a SessionHost. Possible values include: "Initial", - "Pending", "Started", "Succeeded", "Failed". - :type update_state: str or ~desktop_virtualization_api_client.models.UpdateState - :ivar last_update_time: The timestamp of the last update. - :vartype last_update_time: ~datetime.datetime - :param update_error_message: The error message. - :type update_error_message: str - :ivar session_host_health_check_results: List of SessionHostHealthCheckReports. - :vartype session_host_health_check_results: - list[~desktop_virtualization_api_client.models.SessionHostHealthCheckReport] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - 'virtual_machine_id': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'status_timestamp': {'readonly': True}, - 'last_update_time': {'readonly': True}, - 'session_host_health_check_results': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'iso-8601'}, - 'sessions': {'key': 'properties.sessions', 'type': 'int'}, - 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, - 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, - 'virtual_machine_id': {'key': 'properties.virtualMachineId', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'status_timestamp': {'key': 'properties.statusTimestamp', 'type': 'iso-8601'}, - 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, - 'sx_s_stack_version': {'key': 'properties.sxSStackVersion', 'type': 'str'}, - 'update_state': {'key': 'properties.updateState', 'type': 'str'}, - 'last_update_time': {'key': 'properties.lastUpdateTime', 'type': 'iso-8601'}, - 'update_error_message': {'key': 'properties.updateErrorMessage', 'type': 'str'}, - 'session_host_health_check_results': {'key': 'properties.sessionHostHealthCheckResults', 'type': '[SessionHostHealthCheckReport]'}, - } - - def __init__( - self, - *, - last_heart_beat: Optional[datetime.datetime] = None, - sessions: Optional[int] = None, - agent_version: Optional[str] = None, - allow_new_session: Optional[bool] = None, - assigned_user: Optional[str] = None, - status: Optional[Union[str, "Status"]] = None, - os_version: Optional[str] = None, - sx_s_stack_version: Optional[str] = None, - update_state: Optional[Union[str, "UpdateState"]] = None, - update_error_message: Optional[str] = None, - **kwargs - ): - super(SessionHost, self).__init__(**kwargs) - self.object_id = None - self.last_heart_beat = last_heart_beat - self.sessions = sessions - self.agent_version = agent_version - self.allow_new_session = allow_new_session - self.virtual_machine_id = None - self.resource_id = None - self.assigned_user = assigned_user - self.status = status - self.status_timestamp = None - self.os_version = os_version - self.sx_s_stack_version = sx_s_stack_version - self.update_state = update_state - self.last_update_time = None - self.update_error_message = update_error_message - self.session_host_health_check_results = None - - -class SessionHostHealthCheckFailureDetails(msrest.serialization.Model): - """Contains details on the failure. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar message: Failure message: hints on what is wrong and how to recover. - :vartype message: str - :ivar error_code: Error code corresponding for the failure. - :vartype error_code: int - :ivar last_health_check_date_time: The timestamp of the last update. - :vartype last_health_check_date_time: ~datetime.datetime - """ - - _validation = { - 'message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'last_health_check_date_time': {'readonly': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'last_health_check_date_time': {'key': 'lastHealthCheckDateTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHostHealthCheckFailureDetails, self).__init__(**kwargs) - self.message = None - self.error_code = None - self.last_health_check_date_time = None - - -class SessionHostHealthCheckReport(msrest.serialization.Model): - """The report for session host information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar health_check_name: Represents the name of the health check operation performed. Possible - values include: "DomainJoinedCheck", "DomainTrustCheck", "FSLogixHealthCheck", - "SxSStackListenerCheck", "UrlsAccessibleCheck", "MonitoringAgentCheck", "DomainReachable", - "WebRTCRedirectorCheck", "SupportedEncryptionCheck", "MetaDataServiceCheck", - "AppAttachHealthCheck". - :vartype health_check_name: str or ~desktop_virtualization_api_client.models.HealthCheckName - :ivar health_check_result: Represents the Health state of the health check we performed. - Possible values include: "Unknown", "HealthCheckSucceeded", "HealthCheckFailed", - "SessionHostShutdown". - :vartype health_check_result: str or - ~desktop_virtualization_api_client.models.HealthCheckResult - :ivar additional_failure_details: Additional detailed information on the failure. - :vartype additional_failure_details: - ~desktop_virtualization_api_client.models.SessionHostHealthCheckFailureDetails - """ - - _validation = { - 'health_check_name': {'readonly': True}, - 'health_check_result': {'readonly': True}, - 'additional_failure_details': {'readonly': True}, - } - - _attribute_map = { - 'health_check_name': {'key': 'healthCheckName', 'type': 'str'}, - 'health_check_result': {'key': 'healthCheckResult', 'type': 'str'}, - 'additional_failure_details': {'key': 'additionalFailureDetails', 'type': 'SessionHostHealthCheckFailureDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(SessionHostHealthCheckReport, self).__init__(**kwargs) - self.health_check_name = None - self.health_check_result = None - self.additional_failure_details = None - - -class SessionHostList(msrest.serialization.Model): - """List of SessionHost definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of SessionHost definitions. - :type value: list[~desktop_virtualization_api_client.models.SessionHost] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SessionHost]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["SessionHost"]] = None, - **kwargs - ): - super(SessionHostList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class SessionHostPatch(Resource): - """SessionHost properties that can be patched. - - 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 - :param allow_new_session: Allow a new session. - :type allow_new_session: bool - :param assigned_user: User assigned to SessionHost. - :type assigned_user: 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'}, - 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, - 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_new_session: Optional[bool] = None, - assigned_user: Optional[str] = None, - **kwargs - ): - super(SessionHostPatch, self).__init__(**kwargs) - self.allow_new_session = allow_new_session - self.assigned_user = assigned_user - - -class StartMenuItem(Resource): - """Represents a StartMenuItem definition. - - 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 - :param app_alias: Alias of StartMenuItem. - :type app_alias: str - :param file_path: Path to the file of StartMenuItem. - :type file_path: str - :param command_line_arguments: Command line arguments for StartMenuItem. - :type command_line_arguments: str - :param icon_path: Path to the icon. - :type icon_path: str - :param icon_index: Index of the icon. - :type icon_index: int - """ - - _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'}, - 'app_alias': {'key': 'properties.appAlias', 'type': 'str'}, - 'file_path': {'key': 'properties.filePath', 'type': 'str'}, - 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, - 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, - 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, - } - - def __init__( - self, - *, - app_alias: Optional[str] = None, - file_path: Optional[str] = None, - command_line_arguments: Optional[str] = None, - icon_path: Optional[str] = None, - icon_index: Optional[int] = None, - **kwargs - ): - super(StartMenuItem, self).__init__(**kwargs) - self.app_alias = app_alias - self.file_path = file_path - self.command_line_arguments = command_line_arguments - self.icon_path = icon_path - self.icon_index = icon_index - - -class StartMenuItemList(msrest.serialization.Model): - """List of StartMenuItem definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of StartMenuItem definitions. - :type value: list[~desktop_virtualization_api_client.models.StartMenuItem] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[StartMenuItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["StartMenuItem"]] = None, - **kwargs - ): - super(StartMenuItemList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class UserSession(Resource): - """Represents a UserSession definition. - - 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 object_id: ObjectId of user session. (internal use). - :vartype object_id: str - :param user_principal_name: The user principal name. - :type user_principal_name: str - :param application_type: Application type of application. Possible values include: "RemoteApp", - "Desktop". - :type application_type: str or ~desktop_virtualization_api_client.models.ApplicationType - :param session_state: State of user session. Possible values include: "Unknown", "Active", - "Disconnected", "Pending", "LogOff", "UserProfileDiskMounted". - :type session_state: str or ~desktop_virtualization_api_client.models.SessionState - :param active_directory_user_name: The active directory user name. - :type active_directory_user_name: str - :param create_time: The timestamp of the user session create. - :type create_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'object_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'user_principal_name': {'key': 'properties.userPrincipalName', 'type': 'str'}, - 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, - 'session_state': {'key': 'properties.sessionState', 'type': 'str'}, - 'active_directory_user_name': {'key': 'properties.activeDirectoryUserName', 'type': 'str'}, - 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - user_principal_name: Optional[str] = None, - application_type: Optional[Union[str, "ApplicationType"]] = None, - session_state: Optional[Union[str, "SessionState"]] = None, - active_directory_user_name: Optional[str] = None, - create_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(UserSession, self).__init__(**kwargs) - self.object_id = None - self.user_principal_name = user_principal_name - self.application_type = application_type - self.session_state = session_state - self.active_directory_user_name = active_directory_user_name - self.create_time = create_time - - -class UserSessionList(msrest.serialization.Model): - """List of UserSession definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of UserSession definitions. - :type value: list[~desktop_virtualization_api_client.models.UserSession] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UserSession]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["UserSession"]] = None, - **kwargs - ): - super(UserSessionList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class Workspace(ResourceModelWithAllowedPropertySet): - """Represents a Workspace definition. - - 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 - :param location: The geo-location where the resource lives. - :type location: str - :param managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :type managed_by: str - :param kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. - :type kind: str - :ivar etag: The etag field is *not* required. If it is provided in the response body, it must - also be provided as a header per the normal etag convention. Entity tags are used for - comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in - the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range - (section 14.27) header fields. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~desktop_virtualization_api_client.models.Identity - :param sku: The resource model definition representing SKU. - :type sku: ~desktop_virtualization_api_client.models.Sku - :param plan: Plan for the resource. - :type plan: ~desktop_virtualization_api_client.models.Plan - :ivar object_id: ObjectId of Workspace. (internal use). - :vartype object_id: str - :param description: Description of Workspace. - :type description: str - :param friendly_name: Friendly name of Workspace. - :type friendly_name: str - :param application_group_references: List of applicationGroup resource Ids. - :type application_group_references: list[str] - :ivar cloud_pc_resource: Is cloud pc resource. - :vartype cloud_pc_resource: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, - 'object_id': {'readonly': True}, - 'cloud_pc_resource': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'plan': {'key': 'plan', 'type': 'Plan'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, - 'cloud_pc_resource': {'key': 'properties.cloudPcResource', 'type': 'bool'}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - managed_by: Optional[str] = None, - kind: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - plan: Optional["Plan"] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - application_group_references: Optional[List[str]] = None, - **kwargs - ): - super(Workspace, self).__init__(location=location, managed_by=managed_by, kind=kind, tags=tags, identity=identity, sku=sku, plan=plan, **kwargs) - self.object_id = None - self.description = description - self.friendly_name = friendly_name - self.application_group_references = application_group_references - self.cloud_pc_resource = None - - -class WorkspaceList(msrest.serialization.Model): - """List of Workspace definitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of Workspace definitions. - :type value: list[~desktop_virtualization_api_client.models.Workspace] - :ivar next_link: Link to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Workspace"]] = None, - **kwargs - ): - super(WorkspaceList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class WorkspacePatch(msrest.serialization.Model): - """Workspace properties that can be patched. - - :param tags: A set of tags. tags to be updated. - :type tags: dict[str, str] - :param description: Description of Workspace. - :type description: str - :param friendly_name: Friendly name of Workspace. - :type friendly_name: str - :param application_group_references: List of applicationGroup links. - :type application_group_references: list[str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - application_group_references: Optional[List[str]] = None, - **kwargs - ): - super(WorkspacePatch, self).__init__(**kwargs) - self.tags = tags - self.description = description - self.friendly_name = friendly_name - self.application_group_references = application_group_references diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py deleted file mode 100644 index 7fecc9b4d93..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py +++ /dev/null @@ -1,35 +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 ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._scaling_plans_operations import ScalingPlansOperations -from ._application_groups_operations import ApplicationGroupsOperations -from ._start_menu_items_operations import StartMenuItemsOperations -from ._applications_operations import ApplicationsOperations -from ._desktops_operations import DesktopsOperations -from ._host_pools_operations import HostPoolsOperations -from ._user_sessions_operations import UserSessionsOperations -from ._session_hosts_operations import SessionHostsOperations -from ._msix_packages_operations import MsixPackagesOperations -from ._msix_images_operations import MsixImagesOperations - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'ScalingPlansOperations', - 'ApplicationGroupsOperations', - 'StartMenuItemsOperations', - 'ApplicationsOperations', - 'DesktopsOperations', - 'HostPoolsOperations', - 'UserSessionsOperations', - 'SessionHostsOperations', - 'MsixPackagesOperations', - 'MsixImagesOperations', -] diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_application_groups_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_application_groups_operations.py deleted file mode 100644 index 0ef5a213392..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_application_groups_operations.py +++ /dev/null @@ -1,452 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationGroupsOperations(object): - """ApplicationGroupsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - application_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.ApplicationGroup" - """Get an application group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGroup, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ApplicationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - application_group_name, # type: str - application_group, # type: "models.ApplicationGroup" - **kwargs # type: Any - ): - # type: (...) -> "models.ApplicationGroup" - """Create or update an applicationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_group: Object containing ApplicationGroup definitions. - :type application_group: ~desktop_virtualization_api_client.models.ApplicationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGroup, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ApplicationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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(application_group, 'ApplicationGroup') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - application_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove an applicationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_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 = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - application_group_name, # type: str - application_group=None, # type: Optional["models.ApplicationGroupPatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.ApplicationGroup" - """Update an applicationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_group: Object containing ApplicationGroup definitions. - :type application_group: ~desktop_virtualization_api_client.models.ApplicationGroupPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGroup, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ApplicationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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] - if application_group is not None: - body_content = self._serialize.body(application_group, 'ApplicationGroupPatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ApplicationGroupList"] - """List applicationGroups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param filter: OData filter expression. Valid properties for filtering are - applicationGroupType. - :type filter: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGroupList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ApplicationGroupList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroupList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGroupList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups'} # type: ignore - - def list_by_subscription( - self, - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ApplicationGroupList"] - """List applicationGroups in subscription. - - :param filter: OData filter expression. Valid properties for filtering are - applicationGroupType. - :type filter: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGroupList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ApplicationGroupList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGroupList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGroupList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_applications_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_applications_operations.py deleted file mode 100644 index 1726f62d282..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_applications_operations.py +++ /dev/null @@ -1,393 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationsOperations(object): - """ApplicationsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - application_group_name, # type: str - application_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.Application" - """Get an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Application, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Application - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Application"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Application', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - application_group_name, # type: str - application_name, # type: str - application, # type: "models.Application" - **kwargs # type: Any - ): - # type: (...) -> "models.Application" - """Create or update an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_name: str - :param application: Object containing Application definitions. - :type application: ~desktop_virtualization_api_client.models.Application - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Application, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Application - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Application"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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(application, 'Application') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Application', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Application', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - application_group_name, # type: str - application_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_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 = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - application_group_name, # type: str - application_name, # type: str - application=None, # type: Optional["models.ApplicationPatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.Application" - """Update an application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param application_name: The name of the application within the specified application group. - :type application_name: str - :param application: Object containing Application definitions. - :type application: ~desktop_virtualization_api_client.models.ApplicationPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Application, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Application - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Application"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, 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] - if application is not None: - body_content = self._serialize.body(application, 'ApplicationPatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Application', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - application_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ApplicationList"] - """List applications. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_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 ApplicationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ApplicationList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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') - - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_desktops_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_desktops_operations.py deleted file mode 100644 index f0bc31561da..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_desktops_operations.py +++ /dev/null @@ -1,241 +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 -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 HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class DesktopsOperations(object): - """DesktopsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - application_group_name, # type: str - desktop_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.Desktop" - """Get a desktop. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param desktop_name: The name of the desktop within the specified desktop group. - :type desktop_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Desktop, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Desktop - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Desktop"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'desktopName': self._serialize.url("desktop_name", desktop_name, 'str', max_length=24, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Desktop', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - application_group_name, # type: str - desktop_name, # type: str - desktop=None, # type: Optional["models.DesktopPatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.Desktop" - """Update a desktop. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :param desktop_name: The name of the desktop within the specified desktop group. - :type desktop_name: str - :param desktop: Object containing Desktop definitions. - :type desktop: ~desktop_virtualization_api_client.models.DesktopPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Desktop, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Desktop - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Desktop"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=64, min_length=3), - 'desktopName': self._serialize.url("desktop_name", desktop_name, 'str', max_length=24, 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] - if desktop is not None: - body_content = self._serialize.body(desktop, 'DesktopPatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Desktop', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - application_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.DesktopList" - """List desktops. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DesktopList, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.DesktopList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DesktopList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - accept = "application/json" - - # Construct URL - url = self.list.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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DesktopList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_host_pools_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_host_pools_operations.py deleted file mode 100644 index 16c5ce32a1d..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_host_pools_operations.py +++ /dev/null @@ -1,504 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class HostPoolsOperations(object): - """HostPoolsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - host_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.HostPool" - """Get a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HostPool, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.HostPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HostPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - host_pool_name, # type: str - host_pool, # type: "models.HostPool" - **kwargs # type: Any - ): - # type: (...) -> "models.HostPool" - """Create or update a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param host_pool: Object containing HostPool definitions. - :type host_pool: ~desktop_virtualization_api_client.models.HostPool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HostPool, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.HostPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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(host_pool, 'HostPool') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('HostPool', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('HostPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - host_pool_name, # type: str - force=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - """Remove a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param force: Force flag to delete sessionHost. - :type force: bool - :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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - host_pool_name, # type: str - host_pool=None, # type: Optional["models.HostPoolPatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.HostPool" - """Update a host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param host_pool: Object containing HostPool definitions. - :type host_pool: ~desktop_virtualization_api_client.models.HostPoolPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HostPool, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.HostPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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] - if host_pool is not None: - body_content = self._serialize.body(host_pool, 'HostPoolPatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HostPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.HostPoolList"] - """List hostPools. - - :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 HostPoolList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.HostPoolList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPoolList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('HostPoolList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools'} # type: ignore - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.HostPoolList"] - """List hostPools in subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either HostPoolList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.HostPoolList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HostPoolList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('HostPoolList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools'} # type: ignore - - def retrieve_registration_token( - self, - resource_group_name, # type: str - host_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.RegistrationInfo" - """Registration token of the host pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegistrationInfo, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.RegistrationInfo - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RegistrationInfo"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - accept = "application/json" - - # Construct URL - url = self.retrieve_registration_token.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RegistrationInfo', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - retrieve_registration_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_images_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_images_operations.py deleted file mode 100644 index 7a059f2e66b..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_images_operations.py +++ /dev/null @@ -1,132 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class MsixImagesOperations(object): - """MsixImagesOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def expand( - self, - resource_group_name, # type: str - host_pool_name, # type: str - msix_image_uri, # type: "models.MsixImageUri" - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ExpandMsixImageList"] - """Expands and Lists MSIX packages in an Image, given the Image Path. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_image_uri: Object containing URI to MSIX Image. - :type msix_image_uri: ~desktop_virtualization_api_client.models.MsixImageUri - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpandMsixImageList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ExpandMsixImageList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpandMsixImageList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = "application/json" - accept = "application/json" - - def prepare_request(next_link=None): - # 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') - - if not next_link: - # Construct URL - url = self.expand.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(msix_image_uri, 'MsixImageUri') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(msix_image_uri, 'MsixImageUri') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExpandMsixImageList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - expand.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_packages_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_packages_operations.py deleted file mode 100644 index ec49458dcd3..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_msix_packages_operations.py +++ /dev/null @@ -1,397 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class MsixPackagesOperations(object): - """MsixPackagesOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - host_pool_name, # type: str - msix_package_full_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.MsixPackage" - """Get a msixpackage. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MsixPackage, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.MsixPackage - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - host_pool_name, # type: str - msix_package_full_name, # type: str - msix_package, # type: "models.MsixPackage" - **kwargs # type: Any - ): - # type: (...) -> "models.MsixPackage" - """Create or update a MSIX package. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_name: str - :param msix_package: Object containing MSIX Package definitions. - :type msix_package: ~desktop_virtualization_api_client.models.MsixPackage - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MsixPackage, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.MsixPackage - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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(msix_package, 'MsixPackage') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - host_pool_name, # type: str - msix_package_full_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove an MSIX Package. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - host_pool_name, # type: str - msix_package_full_name, # type: str - msix_package=None, # type: Optional["models.MsixPackagePatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.MsixPackage" - """Update an MSIX Package. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param msix_package_full_name: The version specific package full name of the MSIX package - within specified hostpool. - :type msix_package_full_name: str - :param msix_package: Object containing MSIX Package definitions. - :type msix_package: ~desktop_virtualization_api_client.models.MsixPackagePatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MsixPackage, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.MsixPackage - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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] - if msix_package is not None: - body_content = self._serialize.body(msix_package, 'MsixPackagePatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MsixPackage', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - host_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.MsixPackageList"] - """List MSIX packages in hostpool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MsixPackageList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.MsixPackageList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MsixPackageList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('MsixPackageList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_operations.py deleted file mode 100644 index 141dfe4a4f7..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_operations.py +++ /dev/null @@ -1,92 +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 -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 HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class Operations(object): - """Operations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> "models.ResourceProviderOperationList" - """List all of the available operations the Desktop Virtualization resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ResourceProviderOperationList, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ResourceProviderOperationList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceProviderOperationList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.DesktopVirtualization/operations'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_scaling_plans_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_scaling_plans_operations.py deleted file mode 100644 index b5db1c415d4..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_scaling_plans_operations.py +++ /dev/null @@ -1,515 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ScalingPlansOperations(object): - """ScalingPlansOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - scaling_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.ScalingPlan" - """Get a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ScalingPlan, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ScalingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - def create( - self, - resource_group_name, # type: str - scaling_plan_name, # type: str - scaling_plan, # type: "models.ScalingPlan" - **kwargs # type: Any - ): - # type: (...) -> "models.ScalingPlan" - """Create or update a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_name: str - :param scaling_plan: Object containing scaling plan definitions. - :type scaling_plan: ~desktop_virtualization_api_client.models.ScalingPlan - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ScalingPlan, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ScalingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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(scaling_plan, 'ScalingPlan') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - scaling_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_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 = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - scaling_plan_name, # type: str - scaling_plan=None, # type: Optional["models.ScalingPlanPatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.ScalingPlan" - """Update a scaling plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scaling_plan_name: The name of the scaling plan. - :type scaling_plan_name: str - :param scaling_plan: Object containing scaling plan definitions. - :type scaling_plan: ~desktop_virtualization_api_client.models.ScalingPlanPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ScalingPlan, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.ScalingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_name, 'str', max_length=24, 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] - if scaling_plan is not None: - body_content = self._serialize.body(scaling_plan, 'ScalingPlanPatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ScalingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ScalingPlanList"] - """List scaling plans. - - :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 ScalingPlanList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ScalingPlanList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlanList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('ScalingPlanList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans'} # type: ignore - - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ScalingPlanList"] - """List scaling plans in subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScalingPlanList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ScalingPlanList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlanList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('ScalingPlanList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans'} # type: ignore - - def list_by_host_pool( - self, - resource_group_name, # type: str - host_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ScalingPlanList"] - """List scaling plan associated with hostpool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScalingPlanList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.ScalingPlanList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScalingPlanList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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_host_pool.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('ScalingPlanList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_host_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_session_hosts_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_session_hosts_operations.py deleted file mode 100644 index 8c225d804e5..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_session_hosts_operations.py +++ /dev/null @@ -1,323 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SessionHostsOperations(object): - """SessionHostsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.SessionHost" - """Get a session host. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SessionHost, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.SessionHost - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SessionHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SessionHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - force=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - """Remove a SessionHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param force: Force flag to force sessionHost deletion even when userSession exists. - :type force: bool - :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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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') - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - session_host=None, # type: Optional["models.SessionHostPatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.SessionHost" - """Update a session host. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param session_host: Object containing SessionHost definitions. - :type session_host: ~desktop_virtualization_api_client.models.SessionHostPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SessionHost, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.SessionHost - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SessionHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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] - if session_host is not None: - body_content = self._serialize.body(session_host, 'SessionHostPatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SessionHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - host_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.SessionHostList"] - """List sessionHosts. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SessionHostList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.SessionHostList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SessionHostList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('SessionHostList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_start_menu_items_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_start_menu_items_operations.py deleted file mode 100644 index 03c3ead69c9..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_start_menu_items_operations.py +++ /dev/null @@ -1,121 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class StartMenuItemsOperations(object): - """StartMenuItemsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - application_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.StartMenuItemList"] - """List start menu items in the given application group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param application_group_name: The name of the application group. - :type application_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 StartMenuItemList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.StartMenuItemList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StartMenuItemList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'applicationGroupName': self._serialize.url("application_group_name", application_group_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') - - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('StartMenuItemList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_user_sessions_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_user_sessions_operations.py deleted file mode 100644 index 6698d5dae95..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_user_sessions_operations.py +++ /dev/null @@ -1,481 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class UserSessionsOperations(object): - """UserSessionsOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_host_pool( - self, - resource_group_name, # type: str - host_pool_name, # type: str - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.UserSessionList"] - """List userSessions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param filter: OData filter expression. Valid properties for filtering are userprincipalname - and sessionstate. - :type filter: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UserSessionList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.UserSessionList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserSessionList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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_host_pool.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('UserSessionList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_host_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions'} # type: ignore - - def get( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - user_session_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.UserSession" - """Get a userSession. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UserSession, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.UserSession - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserSession"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - - # 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UserSession', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - user_session_id, # type: str - force=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - """Remove a userSession. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: str - :param force: Force flag to login off userSession. - :type force: bool - :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 = "2021-07-12" - 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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # 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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.UserSessionList"] - """List userSessions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UserSessionList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.UserSessionList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserSessionList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, 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') - - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('UserSessionList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions'} # type: ignore - - def disconnect( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - user_session_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Disconnect a userSession. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: 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 = "2021-07-12" - accept = "application/json" - - # Construct URL - url = self.disconnect.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - - # 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - disconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect'} # type: ignore - - def send_message( - self, - resource_group_name, # type: str - host_pool_name, # type: str - session_host_name, # type: str - user_session_id, # type: str - send_message=None, # type: Optional["models.SendMessage"] - **kwargs # type: Any - ): - # type: (...) -> None - """Send a message to a user. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param host_pool_name: The name of the host pool within the specified resource group. - :type host_pool_name: str - :param session_host_name: The name of the session host within the specified host pool. - :type session_host_name: str - :param user_session_id: The name of the user session within the specified session host. - :type user_session_id: str - :param send_message: Object containing message includes title and message body. - :type send_message: ~desktop_virtualization_api_client.models.SendMessage - :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 = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.send_message.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), - 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=64, min_length=3), - 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), - 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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') - - # 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] - if send_message is not None: - body_content = self._serialize.body(send_message, 'SendMessage') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - send_message.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_workspaces_operations.py b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_workspaces_operations.py deleted file mode 100644 index 17fdc30bd95..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/_workspaces_operations.py +++ /dev/null @@ -1,440 +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 -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations(object): - """WorkspacesOperations 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: ~desktop_virtualization_api_client.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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.Workspace" - """Get a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - workspace, # type: "models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> "models.Workspace" - """Create or update a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str - :param workspace: Object containing Workspace definitions. - :type workspace: ~desktop_virtualization_api_client.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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(workspace, 'Workspace') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_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 = "2021-07-12" - 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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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 = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - workspace=None, # type: Optional["models.WorkspacePatch"] - **kwargs # type: Any - ): - # type: (...) -> "models.Workspace" - """Update a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str - :param workspace: Object containing Workspace definitions. - :type workspace: ~desktop_virtualization_api_client.models.WorkspacePatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~desktop_virtualization_api_client.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - 'workspaceName': self._serialize.url("workspace_name", workspace_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] - if workspace is not None: - body_content = self._serialize.body(workspace, 'WorkspacePatch') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.WorkspaceList"] - """List workspaces. - - :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 WorkspaceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.WorkspaceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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), - } - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('WorkspaceList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces'} # type: ignore - - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.WorkspaceList"] - """List workspaces in subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~desktop_virtualization_api_client.models.WorkspaceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-12" - 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('WorkspaceList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces'} # type: ignore diff --git a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/py.typed b/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/desktopvirtualization/setup.py b/src/desktopvirtualization/setup.py index d6d943ab7c9..f25ad44bf0f 100644 --- a/src/desktopvirtualization/setup.py +++ b/src/desktopvirtualization/setup.py @@ -1,16 +1,16 @@ -#!/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. +# +# Code generated by aaz-dev-tools # -------------------------------------------------------------------------------------------- - from codecs import open from setuptools import setup, find_packages + # HISTORY.rst entry. -VERSION = '0.2.0' +VERSION = '1.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -20,9 +20,9 @@ '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', + 'Programming Language :: Python :: 3.9', 'License :: OSI Approved :: MIT License', ] @@ -36,14 +36,14 @@ setup( name='desktopvirtualization', version=VERSION, - description='Microsoft Azure Command-Line Tools DesktopVirtualizationAPIClient Extension', + description='Microsoft Azure Command-Line Tools Desktopvirtualization Extension.', + long_description=README + '\n\n' + HISTORY, + license='MIT', author='Microsoft Corporation', author_email='azpycli@microsoft.com', url='https://github.com/Azure/azure-cli-extensions/tree/main/src/desktopvirtualization', - long_description=README + '\n\n' + HISTORY, - license='MIT', classifiers=CLASSIFIERS, - packages=find_packages(), - install_requires=DEPENDENCIES, + packages=find_packages(exclude=["tests"]), package_data={'azext_desktopvirtualization': ['azext_metadata.json']}, + install_requires=DEPENDENCIES )