From 4f53bd0b51c9f0fa2ff9b1f1b20d933cd11de9ef Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Thu, 7 Nov 2024 16:44:03 -0500 Subject: [PATCH] remove old folders --- .../{generated => }/commands.py | 0 .../azext_connectedmachine/custom.py | 55 +- .../generated/__init__.py | 12 - .../generated/_client_factory.py | 36 - .../azext_connectedmachine/generated/_help.py | 24 - .../generated/_params.py | 36 - .../generated/_validators.py | 9 - .../generated/action.py | 94 - .../generated/custom.py | 25 - .../azext_connectedmachine/manual/__init__.py | 12 - .../azext_connectedmachine/manual/commands.py | 77 - .../tests/latest/test_ESULicense_scenario.py | 8 + .../vendored_sdks/__init__.py | 12 - .../connectedmachine/__init__.py | 19 - .../connectedmachine/_configuration.py | 71 - .../connectedmachine/_connected_machine.py | 96 - .../connectedmachine/_version.py | 9 - .../connectedmachine/aio/__init__.py | 10 - .../connectedmachine/aio/_configuration.py | 67 - .../aio/_connected_machine.py | 90 - .../aio/operations/__init__.py | 25 - .../_connected_machine_operations.py | 142 -- .../_machine_extensions_operations.py | 571 ----- .../aio/operations/_machines_operations.py | 302 --- .../aio/operations/_operations.py | 105 - ...private_endpoint_connections_operations.py | 432 ---- .../_private_link_resources_operations.py | 180 -- .../_private_link_scopes_operations.py | 610 ----- .../connectedmachine/models/__init__.py | 183 -- .../models/_connected_machine_enums.py | 80 - .../connectedmachine/models/_models.py | 1903 --------------- .../connectedmachine/models/_models_py3.py | 2049 ----------------- .../connectedmachine/operations/__init__.py | 25 - .../_connected_machine_operations.py | 148 -- .../_machine_extensions_operations.py | 583 ----- .../operations/_machines_operations.py | 310 --- .../operations/_operations.py | 110 - ...private_endpoint_connections_operations.py | 442 ---- .../_private_link_resources_operations.py | 186 -- .../_private_link_scopes_operations.py | 623 ----- .../vendored_sdks/connectedmachine/py.typed | 1 - 41 files changed, 55 insertions(+), 9717 deletions(-) rename src/connectedmachine/azext_connectedmachine/{generated => }/commands.py (100%) delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/_client_factory.py delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/_help.py delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/_params.py delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/_validators.py delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/action.py delete mode 100644 src/connectedmachine/azext_connectedmachine/generated/custom.py delete mode 100644 src/connectedmachine/azext_connectedmachine/manual/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/manual/commands.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_version.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py delete mode 100644 src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed diff --git a/src/connectedmachine/azext_connectedmachine/generated/commands.py b/src/connectedmachine/azext_connectedmachine/commands.py similarity index 100% rename from src/connectedmachine/azext_connectedmachine/generated/commands.py rename to src/connectedmachine/azext_connectedmachine/commands.py diff --git a/src/connectedmachine/azext_connectedmachine/custom.py b/src/connectedmachine/azext_connectedmachine/custom.py index 885447229d6..a9f741b3b7c 100644 --- a/src/connectedmachine/azext_connectedmachine/custom.py +++ b/src/connectedmachine/azext_connectedmachine/custom.py @@ -9,12 +9,51 @@ # -------------------------------------------------------------------------- # pylint: disable=wildcard-import # pylint: disable=unused-wildcard-import +# pylint: disable=too-many-lines +# pylint: disable=unused-argument +# pylint: disable=too-many-statements + +from .aaz.latest.connectedmachine.license_profile import Create as _ProfileCreate + + +# hide license-profile-name from user and always set it to be 'Default' +class SettingsUpdate(_SettingsUpdate): + """Update the base Settings of the target resource. + + :example: Sample command for setting update + az arcgateway settings update --resource-group myResourceGroup --subscription mySubscription + --base-provider Microsoft.HybridCompute --base-resource-type machines + --base-resource-name workloadServer --gateway-resource-id myResourceId + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + + # pylint: disable=protected-access + args_schema.license-profile-name._required = False + args_schema.license-profile-name._registered = False + + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.license-profile-name = "Default" + +class ScopeUpdate(_ScopeUpdate): + """Update an Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + + :example: Sample command for private-link-scope update + az connectedmachine private-link-scope update --location westus --tags Tag1=Value1 --resource-group my-resource-group --scope-name my-privatelinkscope + """ + def connectedmachine_private_link_scope_update_tag(client, + resource_group_name, + scope_name, + tags=None): + private_link_scope_tags = {} + if tags is not None: + private_link_scope_tags['tags'] = tags + return client.update_tags(resource_group_name=resource_group_name, + scope_name=scope_name, + private_link_scope_tags=private_link_scope_tags) + -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 diff --git a/src/connectedmachine/azext_connectedmachine/generated/__init__.py b/src/connectedmachine/azext_connectedmachine/generated/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/connectedmachine/azext_connectedmachine/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/connectedmachine/azext_connectedmachine/generated/_client_factory.py b/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py deleted file mode 100644 index cb6e02b1d6e..00000000000 --- a/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py +++ /dev/null @@ -1,36 +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_connectedmachine_cl(cli_ctx, *_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_connectedmachine.vendored_sdks.connectedmachine import ConnectedMachine - return get_mgmt_service_client(cli_ctx, - ConnectedMachine) - - -def cf_machine(cli_ctx, *_): - return cf_connectedmachine_cl(cli_ctx).machines - - -def cf_machine_extension(cli_ctx, *_): - return cf_connectedmachine_cl(cli_ctx).machine_extensions - - -def cf_private_link_scope(cli_ctx, *_): - return cf_connectedmachine_cl(cli_ctx).private_link_scopes - - -def cf_private_link_resource(cli_ctx, *_): - return cf_connectedmachine_cl(cli_ctx).private_link_resources - - -def cf_private_endpoint_connection(cli_ctx, *_): - return cf_connectedmachine_cl(cli_ctx).private_endpoint_connections diff --git a/src/connectedmachine/azext_connectedmachine/generated/_help.py b/src/connectedmachine/azext_connectedmachine/generated/_help.py deleted file mode 100644 index acdf7c4b939..00000000000 --- a/src/connectedmachine/azext_connectedmachine/generated/_help.py +++ /dev/null @@ -1,24 +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['connectedmachine private-link-scope update-tag'] = """ - type: command - short-summary: "Update an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate \ -method." - examples: - - name: PrivateLinkScopeUpdateTagsOnly - text: |- - az connectedmachine private-link-scope update-tag --tags Tag1="Value1" Tag2="Value2" --resource-group \ -"my-resource-group" --scope-name "my-privatelinkscope" -""" diff --git a/src/connectedmachine/azext_connectedmachine/generated/_params.py b/src/connectedmachine/azext_connectedmachine/generated/_params.py deleted file mode 100644 index 95d3febe8dc..00000000000 --- a/src/connectedmachine/azext_connectedmachine/generated/_params.py +++ /dev/null @@ -1,36 +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, - validate_file_or_dict -) -from azext_connectedmachine.action import ( - AddStatus, - AddConnectionState -) - - -def load_arguments(self, _): - - with self.argument_context('connectedmachine private-link-scope update-tag') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('tags', tags_type) diff --git a/src/connectedmachine/azext_connectedmachine/generated/_validators.py b/src/connectedmachine/azext_connectedmachine/generated/_validators.py deleted file mode 100644 index b33a44c1ebf..00000000000 --- a/src/connectedmachine/azext_connectedmachine/generated/_validators.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- diff --git a/src/connectedmachine/azext_connectedmachine/generated/action.py b/src/connectedmachine/azext_connectedmachine/generated/action.py deleted file mode 100644 index 712a7dd8684..00000000000 --- a/src/connectedmachine/azext_connectedmachine/generated/action.py +++ /dev/null @@ -1,94 +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 InvalidArgumentValueError - - -class AddStatus(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.status = action - - def get_action(self, values, option_string): - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise InvalidArgumentValueError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - - if kl == 'code': - d['code'] = v[0] - - elif kl == 'level': - d['level'] = v[0] - - elif kl == 'display-status': - d['display_status'] = v[0] - - elif kl == 'message': - d['message'] = v[0] - - elif kl == 'time': - d['time'] = v[0] - - else: - raise InvalidArgumentValueError( - 'Unsupported Key {} is provided for parameter status. All possible keys are: code, level,' - ' display-status, message, time'.format(k) - ) - - return d - - -class AddConnectionState(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.connection_state = action - - def get_action(self, values, option_string): - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise InvalidArgumentValueError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - - if kl == 'status': - d['status'] = v[0] - - elif kl == 'description': - d['description'] = v[0] - - else: - raise InvalidArgumentValueError( - 'Unsupported Key {} is provided for parameter connection-state. All possible keys are: status,' - ' description'.format(k) - ) - - return d diff --git a/src/connectedmachine/azext_connectedmachine/generated/custom.py b/src/connectedmachine/azext_connectedmachine/generated/custom.py deleted file mode 100644 index f428da912c8..00000000000 --- a/src/connectedmachine/azext_connectedmachine/generated/custom.py +++ /dev/null @@ -1,25 +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=unused-argument - -from azure.cli.core.util import sdk_no_wait - - -def connectedmachine_private_link_scope_update_tag(client, - resource_group_name, - scope_name, - tags=None): - private_link_scope_tags = {} - if tags is not None: - private_link_scope_tags['tags'] = tags - return client.update_tags(resource_group_name=resource_group_name, - scope_name=scope_name, - private_link_scope_tags=private_link_scope_tags) diff --git a/src/connectedmachine/azext_connectedmachine/manual/__init__.py b/src/connectedmachine/azext_connectedmachine/manual/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/connectedmachine/azext_connectedmachine/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/connectedmachine/azext_connectedmachine/manual/commands.py b/src/connectedmachine/azext_connectedmachine/manual/commands.py deleted file mode 100644 index e1dc442ffeb..00000000000 --- a/src/connectedmachine/azext_connectedmachine/manual/commands.py +++ /dev/null @@ -1,77 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by 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 collections import OrderedDict -from azure.cli.core.commands import CliCommandType -from azext_connectedmachine.generated._client_factory import ( - cf_machine, - cf_machine_extension, - cf_connectedmachine_cl, - cf_private_link_scope, - cf_private_link_resource, - cf_private_endpoint_connection, -) - - -connectedmachine_machine = CliCommandType( - operations_tmpl=( - 'azext_connectedmachine.vendored_sdks.connectedmachine.operations._machines_operations#MachinesOperations.{}' - ), - client_factory=cf_machine, -) - - -connectedmachine_ = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._connected_machine_operations#ConnectedMachineOperationsMixin.{}', - client_factory=cf_connectedmachine_cl, -) - - -connectedmachine_machine_extension = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_extensions_operations#MachineExtensionsOperations.{}', - client_factory=cf_machine_extension, -) - - -connectedmachine_private_endpoint_connection = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_endpoint_connections_operations#PrivateEndpointConnectionsOperations.{}', - client_factory=cf_private_endpoint_connection, -) - - -connectedmachine_private_link_resource = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_link_resources_operations#PrivateLinkResourcesOperations.{}', - client_factory=cf_private_link_resource, -) - - -connectedmachine_private_link_scope = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_link_scopes_operations#PrivateLinkScopesOperations.{}', - client_factory=cf_private_link_scope, -) - - -def load_command_table(self, _): # pylint: disable=unused-argument - pass - - -def transform_machine_list(result): - return [transform_machine(machine) for machine in result] - - -def transform_machine(result): - return OrderedDict([('Name', result['name']), - ('ResourceGroup', result['resourceGroup']), - ('Location', result['location']), - ('Status', result.get('status'))]) diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_ESULicense_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ESULicense_scenario.py index 9ed0dca37de..4f78a47eb76 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/test_ESULicense_scenario.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ESULicense_scenario.py @@ -63,6 +63,14 @@ def test_esu_license(self): self.check('length(@)', 8) ]) + self.cmd('az connectedmachine license-profile create ' + '--resource-group "{rg}" ' + '--subscription "{subscription}" ' + '--name "Default" ' + checks=[ + self.check('name', '{licenseName}'), + ]) + self.cmd('az connectedmachine license update ' '--name "{licenseName}" ' '--resource-group "{rg}" ' diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py deleted file mode 100644 index c9cfdc73e77..00000000000 --- a/src/connectedmachine/azext_connectedmachine/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/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__init__.py deleted file mode 100644 index 9a8a1b4dcf8..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__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 ._connected_machine import ConnectedMachine -from ._version import VERSION - -__version__ = VERSION -__all__ = ['ConnectedMachine'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py deleted file mode 100644 index c7c9373c9d8..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_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 ConnectedMachineConfiguration(Configuration): - """Configuration for ConnectedMachine. - - 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(ConnectedMachineConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2022-03-10" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.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/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py deleted file mode 100644 index 75b9809af78..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py +++ /dev/null @@ -1,96 +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 ConnectedMachineConfiguration -from .operations import MachinesOperations -from .operations import MachineExtensionsOperations -from .operations import ConnectedMachineOperationsMixin -from .operations import Operations -from .operations import PrivateLinkScopesOperations -from .operations import PrivateLinkResourcesOperations -from .operations import PrivateEndpointConnectionsOperations -from . import models - - -class ConnectedMachine(ConnectedMachineOperationsMixin): - """The Hybrid Compute Management Client. - - :ivar machines: MachinesOperations operations - :vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations - :ivar machine_extensions: MachineExtensionsOperations operations - :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.hybridcompute.operations.Operations - :ivar private_link_scopes: PrivateLinkScopesOperations operations - :vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.hybridcompute.operations.PrivateLinkResourcesOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.hybridcompute.operations.PrivateEndpointConnectionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = ConnectedMachineConfiguration(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.machines = MachinesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.machine_extensions = MachineExtensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_scopes = PrivateLinkScopesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> ConnectedMachine - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_version.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_version.py deleted file mode 100644 index e5754a47ce6..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "1.0.0b1" diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py deleted file mode 100644 index 5a8f3eca2b2..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/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 ._connected_machine import ConnectedMachine -__all__ = ['ConnectedMachine'] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py deleted file mode 100644 index 2ea09f521a0..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/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 ConnectedMachineConfiguration(Configuration): - """Configuration for ConnectedMachine. - - 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(ConnectedMachineConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2022-03-10" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.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/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine.py deleted file mode 100644 index e5dbf9451bd..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine.py +++ /dev/null @@ -1,90 +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 ConnectedMachineConfiguration -from .operations import MachinesOperations -from .operations import MachineExtensionsOperations -from .operations import ConnectedMachineOperationsMixin -from .operations import Operations -from .operations import PrivateLinkScopesOperations -from .operations import PrivateLinkResourcesOperations -from .operations import PrivateEndpointConnectionsOperations -from .. import models - - -class ConnectedMachine(ConnectedMachineOperationsMixin): - """The Hybrid Compute Management Client. - - :ivar machines: MachinesOperations operations - :vartype machines: azure.mgmt.hybridcompute.aio.operations.MachinesOperations - :ivar machine_extensions: MachineExtensionsOperations operations - :vartype machine_extensions: azure.mgmt.hybridcompute.aio.operations.MachineExtensionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.hybridcompute.aio.operations.Operations - :ivar private_link_scopes: PrivateLinkScopesOperations operations - :vartype private_link_scopes: azure.mgmt.hybridcompute.aio.operations.PrivateLinkScopesOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.hybridcompute.aio.operations.PrivateLinkResourcesOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.hybridcompute.aio.operations.PrivateEndpointConnectionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ConnectedMachineConfiguration(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.machines = MachinesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.machine_extensions = MachineExtensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_scopes = PrivateLinkScopesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ConnectedMachine": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py deleted file mode 100644 index 641a5a8b66c..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._machines_operations import MachinesOperations -from ._machine_extensions_operations import MachineExtensionsOperations -from ._connected_machine_operations import ConnectedMachineOperationsMixin -from ._operations import Operations -from ._private_link_scopes_operations import PrivateLinkScopesOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations - -__all__ = [ - 'MachinesOperations', - 'MachineExtensionsOperations', - 'ConnectedMachineOperationsMixin', - 'Operations', - 'PrivateLinkScopesOperations', - 'PrivateLinkResourcesOperations', - 'PrivateEndpointConnectionsOperations', -] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py deleted file mode 100644 index 228a61224a8..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py +++ /dev/null @@ -1,142 +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, Union -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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectedMachineOperationsMixin: - - async def _upgrade_extensions_initial( - self, - resource_group_name: str, - machine_name: str, - extension_upgrade_parameters: "models.MachineExtensionUpgrade", - **kwargs - ) -> None: - 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 = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._upgrade_extensions_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_upgrade_parameters, 'MachineExtensionUpgrade') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _upgrade_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore - - async def begin_upgrade_extensions( - self, - resource_group_name: str, - machine_name: str, - extension_upgrade_parameters: "models.MachineExtensionUpgrade", - **kwargs - ) -> AsyncLROPoller[None]: - """The operation to Upgrade Machine Extensions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. - :type machine_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - :type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._upgrade_extensions_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_upgrade_parameters=extension_upgrade_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_upgrade_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py deleted file mode 100644 index fb842b7813b..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py +++ /dev/null @@ -1,571 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MachineExtensionsOperations: - """MachineExtensionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_or_update_initial( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - extension_parameters: "models.MachineExtension", - **kwargs - ) -> Optional["models.MachineExtension"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'MachineExtension') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - extension_parameters: "models.MachineExtension", - **kwargs - ) -> AsyncLROPoller["models.MachineExtension"]: - """The operation to create or update the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine where the extension should be created or updated. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param extension_parameters: Parameters supplied to the Create Machine Extension operation. - :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtension - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=extension_name, - extension_parameters=extension_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - extension_parameters: "models.MachineExtensionUpdate", - **kwargs - ) -> Optional["models.MachineExtension"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'MachineExtensionUpdate') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - async def begin_update( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - extension_parameters: "models.MachineExtensionUpdate", - **kwargs - ) -> AsyncLROPoller["models.MachineExtension"]: - """The operation to create or update the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine where the extension should be created or updated. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param extension_parameters: Parameters supplied to the Create Machine Extension operation. - :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=extension_name, - extension_parameters=extension_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - **kwargs - ) -> None: - 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 = "2022-03-10" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # 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, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - **kwargs - ) -> AsyncLROPoller[None]: - """The operation to delete the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine where the extension should be deleted. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=extension_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - machine_name: str, - extension_name: str, - **kwargs - ) -> "models.MachineExtension": - """The operation to get the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine containing the extension. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def list( - self, - resource_group_name: str, - machine_name: str, - expand: Optional[str] = None, - **kwargs - ) -> AsyncIterable["models.MachineExtensionsListResult"]: - """The operation to get all extensions of a non-Azure machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine containing the extension. - :type machine_name: str - :param expand: The expand expression to apply on the operation. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MachineExtensionsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.MachineExtensionsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - '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] - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - 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('MachineExtensionsListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py deleted file mode 100644 index 7a88248b470..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py +++ /dev/null @@ -1,302 +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 MachinesOperations: - """MachinesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def delete( - self, - resource_group_name: str, - machine_name: str, - **kwargs - ) -> None: - """The operation to remove a hybrid machine identity in Azure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. - :type machine_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 = "2022-03-10" - 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), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - machine_name: str, - expand: Optional[Union[str, "models.InstanceViewTypes"]] = None, - **kwargs - ) -> "models.Machine": - """Retrieves information about the model view or the instance view of a hybrid machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. - :type machine_name: str - :param expand: The expand expression to apply on the operation. - :type expand: str or ~azure.mgmt.hybridcompute.models.InstanceViewTypes - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Machine, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.Machine - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Machine', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.MachineListResult"]: - """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the - response to get the next page of hybrid machines. - - :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 MachineListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.MachineListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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('MachineListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'} # type: ignore - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.MachineListResult"]: - """Lists all the hybrid machines in the specified subscription. Use the nextLink property in the - response to get the next page of hybrid machines. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MachineListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.MachineListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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('MachineListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py deleted file mode 100644 index 8c9cc6fd77e..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py +++ /dev/null @@ -1,105 +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 Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["models.OperationListResult"]: - """Gets a list of hybrid compute operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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 - # 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('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.HybridCompute/operations'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 9f69296c1c3..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,432 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def get( - self, - resource_group_name: str, - scope_name: str, - private_endpoint_connection_name: str, - **kwargs - ) -> "models.PrivateEndpointConnection": - """Gets a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - scope_name: str, - private_endpoint_connection_name: str, - parameters: "models.PrivateEndpointConnection", - **kwargs - ) -> Optional["models.PrivateEndpointConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - async def begin_update( - self, - resource_group_name: str, - scope_name: str, - private_endpoint_connection_name: str, - parameters: "models.PrivateEndpointConnection", - **kwargs - ) -> AsyncLROPoller["models.PrivateEndpointConnection"]: - """Approve or reject a private endpoint connection with a given name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. - :type private_endpoint_connection_name: str - :param parameters: - :type parameters: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - scope_name: str, - private_endpoint_connection_name: str, - **kwargs - ) -> None: - 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 = "2022-03-10" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - scope_name: str, - private_endpoint_connection_name: str, - **kwargs - ) -> AsyncLROPoller[None]: - """Deletes a private endpoint connection with a given name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - def list_by_private_link_scope( - self, - resource_group_name: str, - scope_name: str, - **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: - """Gets all private endpoint connections on a private link scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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_private_link_scope.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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 9548d75237c..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,180 +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 PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_private_link_scope( - self, - resource_group_name: str, - scope_name: str, - **kwargs - ) -> AsyncIterable["models.PrivateLinkResourceListResult"]: - """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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_private_link_scope.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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'} # type: ignore - - async def get( - self, - resource_group_name: str, - scope_name: str, - group_name: str, - **kwargs - ) -> "models.PrivateLinkResource": - """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param group_name: The name of the private link resource. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py deleted file mode 100644 index dfcc4211733..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py +++ /dev/null @@ -1,610 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkScopesOperations: - """PrivateLinkScopesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["models.HybridComputePrivateLinkScopeListResult"]: - """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either HybridComputePrivateLinkScopeListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - 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('HybridComputePrivateLinkScopeListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.HybridComputePrivateLinkScopeListResult"]: - """Gets a list of Azure Arc PrivateLinkScopes within a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either HybridComputePrivateLinkScopeListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - '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('HybridComputePrivateLinkScopeListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - scope_name: str, - **kwargs - ) -> None: - 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 = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - scope_name: str, - **kwargs - ) -> AsyncLROPoller[None]: - """Deletes a Azure Arc PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - scope_name=scope_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - scope_name: str, - **kwargs - ) -> "models.HybridComputePrivateLinkScope": - """Returns a Azure Arc PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HybridComputePrivateLinkScope, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - scope_name: str, - parameters: "models.HybridComputePrivateLinkScope", - **kwargs - ) -> "models.HybridComputePrivateLinkScope": - """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value - for InstrumentationKey nor AppId in the Put operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param parameters: Properties that need to be specified to create or update a Azure Arc for - Servers and Clusters PrivateLinkScope. - :type parameters: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HybridComputePrivateLinkScope, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'HybridComputePrivateLinkScope') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - scope_name: str, - private_link_scope_tags: "models.TagsResource", - **kwargs - ) -> "models.HybridComputePrivateLinkScope": - """Updates an existing PrivateLinkScope's tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope - instance. - :type private_link_scope_tags: ~azure.mgmt.hybridcompute.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HybridComputePrivateLinkScope, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - async def get_validation_details( - self, - location: str, - private_link_scope_id: str, - **kwargs - ) -> "models.PrivateLinkScopeValidationDetails": - """Returns a Azure Arc PrivateLinkScope's validation details. - - :param location: The location of the target resource. - :type location: str - :param private_link_scope_id: The id (Guid) of the Azure Arc PrivateLinkScope resource. - :type private_link_scope_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkScopeValidationDetails, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self.get_validation_details.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'privateLinkScopeId': self._serialize.url("private_link_scope_id", private_link_scope_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkScopeValidationDetails', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_validation_details.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'} # type: ignore - - async def get_validation_details_for_machine( - self, - resource_group_name: str, - machine_name: str, - **kwargs - ) -> "models.PrivateLinkScopeValidationDetails": - """Returns a Azure Arc PrivateLinkScope's validation details for a given machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the target machine to get the private link scope validation - details for. - :type machine_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkScopeValidationDetails, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self.get_validation_details_for_machine.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), - 'machineName': self._serialize.url("machine_name", machine_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkScopeValidationDetails', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_validation_details_for_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py deleted file mode 100644 index 9db77773a31..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py +++ /dev/null @@ -1,183 +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 AgentConfiguration - from ._models_py3 import CloudMetadata - from ._models_py3 import ConfigurationExtension - from ._models_py3 import ConnectionDetail - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import ExtensionTargetProperties - from ._models_py3 import HybridComputePrivateLinkScope - from ._models_py3 import HybridComputePrivateLinkScopeListResult - from ._models_py3 import HybridComputePrivateLinkScopeProperties - from ._models_py3 import Identity - from ._models_py3 import LocationData - from ._models_py3 import Machine - from ._models_py3 import MachineExtension - from ._models_py3 import MachineExtensionInstanceView - from ._models_py3 import MachineExtensionInstanceViewStatus - from ._models_py3 import MachineExtensionProperties - from ._models_py3 import MachineExtensionUpdate - from ._models_py3 import MachineExtensionUpdateProperties - from ._models_py3 import MachineExtensionUpgrade - from ._models_py3 import MachineExtensionsListResult - from ._models_py3 import MachineListResult - from ._models_py3 import MachineProperties - from ._models_py3 import MachineUpdate - from ._models_py3 import MachineUpdateProperties - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OperationValueDisplay - from ._models_py3 import OsProfile - from ._models_py3 import OsProfileLinuxConfiguration - from ._models_py3 import OsProfileWindowsConfiguration - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionDataModel - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateEndpointConnectionProperties - from ._models_py3 import PrivateEndpointProperty - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkResourceProperties - from ._models_py3 import PrivateLinkScopeValidationDetails - from ._models_py3 import PrivateLinkScopesResource - from ._models_py3 import PrivateLinkServiceConnectionStateProperty - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import ResourceUpdate - from ._models_py3 import ServiceStatus - from ._models_py3 import ServiceStatuses - from ._models_py3 import SystemData - from ._models_py3 import TagsResource - from ._models_py3 import TrackedResource -except (SyntaxError, ImportError): - from ._models import AgentConfiguration # type: ignore - from ._models import CloudMetadata # type: ignore - from ._models import ConfigurationExtension # type: ignore - from ._models import ConnectionDetail # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import ExtensionTargetProperties # type: ignore - from ._models import HybridComputePrivateLinkScope # type: ignore - from ._models import HybridComputePrivateLinkScopeListResult # type: ignore - from ._models import HybridComputePrivateLinkScopeProperties # type: ignore - from ._models import Identity # type: ignore - from ._models import LocationData # type: ignore - from ._models import Machine # type: ignore - from ._models import MachineExtension # type: ignore - from ._models import MachineExtensionInstanceView # type: ignore - from ._models import MachineExtensionInstanceViewStatus # type: ignore - from ._models import MachineExtensionProperties # type: ignore - from ._models import MachineExtensionUpdate # type: ignore - from ._models import MachineExtensionUpdateProperties # type: ignore - from ._models import MachineExtensionUpgrade # type: ignore - from ._models import MachineExtensionsListResult # type: ignore - from ._models import MachineListResult # type: ignore - from ._models import MachineProperties # type: ignore - from ._models import MachineUpdate # type: ignore - from ._models import MachineUpdateProperties # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OperationValueDisplay # type: ignore - from ._models import OsProfile # type: ignore - from ._models import OsProfileLinuxConfiguration # type: ignore - from ._models import OsProfileWindowsConfiguration # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionDataModel # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointConnectionProperties # type: ignore - from ._models import PrivateEndpointProperty # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkResourceProperties # type: ignore - from ._models import PrivateLinkScopeValidationDetails # type: ignore - from ._models import PrivateLinkScopesResource # type: ignore - from ._models import PrivateLinkServiceConnectionStateProperty # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceUpdate # type: ignore - from ._models import ServiceStatus # type: ignore - from ._models import ServiceStatuses # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsResource # type: ignore - from ._models import TrackedResource # type: ignore - -from ._connected_machine_enums import ( - AssessmentModeTypes, - CreatedByType, - InstanceViewTypes, - PatchModeTypes, - PublicNetworkAccessType, - StatusLevelTypes, - StatusTypes, -) - -__all__ = [ - 'AgentConfiguration', - 'CloudMetadata', - 'ConfigurationExtension', - 'ConnectionDetail', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'ExtensionTargetProperties', - 'HybridComputePrivateLinkScope', - 'HybridComputePrivateLinkScopeListResult', - 'HybridComputePrivateLinkScopeProperties', - 'Identity', - 'LocationData', - 'Machine', - 'MachineExtension', - 'MachineExtensionInstanceView', - 'MachineExtensionInstanceViewStatus', - 'MachineExtensionProperties', - 'MachineExtensionUpdate', - 'MachineExtensionUpdateProperties', - 'MachineExtensionUpgrade', - 'MachineExtensionsListResult', - 'MachineListResult', - 'MachineProperties', - 'MachineUpdate', - 'MachineUpdateProperties', - 'OperationListResult', - 'OperationValue', - 'OperationValueDisplay', - 'OsProfile', - 'OsProfileLinuxConfiguration', - 'OsProfileWindowsConfiguration', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionDataModel', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointConnectionProperties', - 'PrivateEndpointProperty', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkResourceProperties', - 'PrivateLinkScopeValidationDetails', - 'PrivateLinkScopesResource', - 'PrivateLinkServiceConnectionStateProperty', - 'ProxyResource', - 'Resource', - 'ResourceUpdate', - 'ServiceStatus', - 'ServiceStatuses', - 'SystemData', - 'TagsResource', - 'TrackedResource', - 'AssessmentModeTypes', - 'CreatedByType', - 'InstanceViewTypes', - 'PatchModeTypes', - 'PublicNetworkAccessType', - 'StatusLevelTypes', - 'StatusTypes', -] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py deleted file mode 100644 index c88ee3bbe4d..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py +++ /dev/null @@ -1,80 +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 AssessmentModeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the assessment mode. - """ - - IMAGE_DEFAULT = "ImageDefault" - AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" - -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class InstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - INSTANCE_VIEW = "instanceView" - -class PatchModeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the patch mode. - """ - - IMAGE_DEFAULT = "ImageDefault" - AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" - AUTOMATIC_BY_OS = "AutomaticByOS" - MANUAL = "Manual" - -class PublicNetworkAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The network access policy to determine if Azure Arc agents can use public Azure Arc service - endpoints. Defaults to disabled (access to Azure Arc services only via private link). - """ - - ENABLED = "Enabled" #: Allows Azure Arc agents to communicate with Azure Arc services over both public (internet) and private endpoints. - DISABLED = "Disabled" #: Does not allow Azure Arc agents to communicate with Azure Arc services over public (internet) endpoints. The agents must use the private link. - -class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The level code. - """ - - INFO = "Info" - WARNING = "Warning" - ERROR = "Error" - -class StatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the hybrid machine agent. - """ - - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - ERROR = "Error" diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py deleted file mode 100644 index 7bd70076bc2..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py +++ /dev/null @@ -1,1903 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AgentConfiguration(msrest.serialization.Model): - """Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar proxy_url: Specifies the URL of the proxy to be used. - :vartype proxy_url: str - :ivar incoming_connections_ports: Specifies the list of ports that the agent will be able to - listen on. - :vartype incoming_connections_ports: list[str] - :ivar extensions_allow_list: Array of extensions that are allowed to be installed or updated. - :vartype extensions_allow_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] - :ivar extensions_block_list: Array of extensions that are blocked (cannot be installed or - updated). - :vartype extensions_block_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] - :ivar proxy_bypass: List of service names which should not use the specified proxy server. - :vartype proxy_bypass: list[str] - :ivar extensions_enabled: Specifies whether the extension service is enabled or disabled. - :vartype extensions_enabled: str - :ivar guest_configuration_enabled: Specified whether the guest configuration service is enabled - or disabled. - :vartype guest_configuration_enabled: str - """ - - _validation = { - 'proxy_url': {'readonly': True}, - 'incoming_connections_ports': {'readonly': True}, - 'extensions_allow_list': {'readonly': True}, - 'extensions_block_list': {'readonly': True}, - 'proxy_bypass': {'readonly': True}, - 'extensions_enabled': {'readonly': True}, - 'guest_configuration_enabled': {'readonly': True}, - } - - _attribute_map = { - 'proxy_url': {'key': 'proxyUrl', 'type': 'str'}, - 'incoming_connections_ports': {'key': 'incomingConnectionsPorts', 'type': '[str]'}, - 'extensions_allow_list': {'key': 'extensionsAllowList', 'type': '[ConfigurationExtension]'}, - 'extensions_block_list': {'key': 'extensionsBlockList', 'type': '[ConfigurationExtension]'}, - 'proxy_bypass': {'key': 'proxyBypass', 'type': '[str]'}, - 'extensions_enabled': {'key': 'extensionsEnabled', 'type': 'str'}, - 'guest_configuration_enabled': {'key': 'guestConfigurationEnabled', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentConfiguration, self).__init__(**kwargs) - self.proxy_url = None - self.incoming_connections_ports = None - self.extensions_allow_list = None - self.extensions_block_list = None - self.proxy_bypass = None - self.extensions_enabled = None - self.guest_configuration_enabled = None - - -class CloudMetadata(msrest.serialization.Model): - """The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: Specifies the cloud provider (Azure/AWS/GCP...). - :vartype provider: str - """ - - _validation = { - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudMetadata, self).__init__(**kwargs) - self.provider = None - - -class ConfigurationExtension(msrest.serialization.Model): - """Describes properties that can identify extensions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar publisher: Publisher of the extension. - :vartype publisher: str - :ivar type: Type of the extension. - :vartype type: str - """ - - _validation = { - 'publisher': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationExtension, self).__init__(**kwargs) - self.publisher = None - self.type = None - - -class ConnectionDetail(msrest.serialization.Model): - """ConnectionDetail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource Id. - :vartype id: str - :ivar private_ip_address: The private endpoint connection private ip address. - :vartype private_ip_address: str - :ivar link_identifier: The private endpoint connection link identifier. - :vartype link_identifier: str - :ivar group_id: The private endpoint connection group id. - :vartype group_id: str - :ivar member_name: The private endpoint connection member name. - :vartype member_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'link_identifier': {'readonly': True}, - 'group_id': {'readonly': True}, - 'member_name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'member_name': {'key': 'memberName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectionDetail, self).__init__(**kwargs) - self.id = None - self.private_ip_address = None - self.link_identifier = None - self.group_id = None - self.member_name = None - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: object - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ExtensionTargetProperties(msrest.serialization.Model): - """Describes the Machine Extension Target Version Properties. - - :param target_version: Properties for the specified Extension to Upgrade. - :type target_version: str - """ - - _attribute_map = { - 'target_version': {'key': 'targetVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionTargetProperties, self).__init__(**kwargs) - self.target_version = kwargs.get('target_version', None) - - -class PrivateLinkScopesResource(msrest.serialization.Model): - """An azure resource object. - - 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: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkScopesResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class HybridComputePrivateLinkScope(PrivateLinkScopesResource): - """An Azure Arc PrivateLinkScope 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: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Properties that define a Azure Arc PrivateLinkScope resource. - :type properties: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'HybridComputePrivateLinkScopeProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(HybridComputePrivateLinkScope, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.system_data = None - - -class HybridComputePrivateLinkScopeListResult(msrest.serialization.Model): - """Describes the list of Azure Arc PrivateLinkScope resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Azure Arc PrivateLinkScope definitions. - :type value: list[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope] - :param next_link: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too - many PrivateLinkScopes where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[HybridComputePrivateLinkScope]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HybridComputePrivateLinkScopeListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): - """Properties that define a Azure Arc PrivateLinkScope resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param public_network_access: Indicates whether machines associated with the private link scope - can also use public Azure Arc service endpoints. Possible values include: "Enabled", - "Disabled". Default value: "Disabled". - :type public_network_access: str or ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType - :ivar provisioning_state: Current state of this PrivateLinkScope: whether or not is has been - provisioned within the resource group it is defined. Users cannot change this value but are - able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. - :vartype provisioning_state: str - :ivar private_link_scope_id: The Guid id of the private link scope. - :vartype private_link_scope_id: str - :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. - :vartype private_endpoint_connections: - list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionDataModel] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'private_link_scope_id': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - } - - _attribute_map = { - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionDataModel]'}, - } - - def __init__( - self, - **kwargs - ): - super(HybridComputePrivateLinkScopeProperties, self).__init__(**kwargs) - self.public_network_access = kwargs.get('public_network_access', "Disabled") - self.provisioning_state = None - self.private_link_scope_id = None - self.private_endpoint_connections = 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 LocationData(msrest.serialization.Model): - """Metadata pertaining to the geographic location of the resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. A canonical name for the geographic or physical location. - :type name: str - :param city: The city or locality where the resource is located. - :type city: str - :param district: The district, state, or province where the resource is located. - :type district: str - :param country_or_region: The country or region where the resource is located. - :type country_or_region: str - """ - - _validation = { - 'name': {'required': True, 'max_length': 256, 'min_length': 0}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'city': {'key': 'city', 'type': 'str'}, - 'district': {'key': 'district', 'type': 'str'}, - 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LocationData, self).__init__(**kwargs) - self.name = kwargs['name'] - self.city = kwargs.get('city', None) - self.district = kwargs.get('district', None) - self.country_or_region = kwargs.get('country_or_region', None) - - -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 TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class Machine(TrackedResource): - """Describes a hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param properties: Hybrid Compute Machine properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineProperties - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.hybridcompute.models.Identity - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MachineProperties'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(Machine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.system_data = None - - -class MachineExtension(TrackedResource): - """Describes a Machine Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param properties: Describes Machine Extension Properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MachineExtensionProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtension, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.system_data = None - - -class MachineExtensionInstanceView(msrest.serialization.Model): - """Describes the Machine Extension Instance View. - - :param name: The machine extension name. - :type name: str - :param type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param status: Instance view status. - :type status: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionInstanceView, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.status = kwargs.get('status', None) - - -class MachineExtensionInstanceViewStatus(msrest.serialization.Model): - """Instance view status. - - :param code: The status code. - :type code: str - :param level: The level code. Possible values include: "Info", "Warning", "Error". - :type level: str or ~azure.mgmt.hybridcompute.models.StatusLevelTypes - :param display_status: The short localizable label for the status. - :type display_status: str - :param message: The detailed status message, including for alerts and error messages. - :type message: str - :param time: The time of the status. - :type time: ~datetime.datetime - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.level = kwargs.get('level', None) - self.display_status = kwargs.get('display_status', None) - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - - -class MachineExtensionProperties(msrest.serialization.Model): - """Describes the properties of a Machine Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :param instance_view: The machine extension instance view. - :type instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'instanceView', 'type': 'MachineExtensionInstanceView'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionProperties, self).__init__(**kwargs) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.publisher = kwargs.get('publisher', None) - self.type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - self.provisioning_state = None - self.instance_view = kwargs.get('instance_view', None) - - -class MachineExtensionsListResult(msrest.serialization.Model): - """Describes the Machine Extensions List Result. - - :param value: The list of extensions. - :type value: list[~azure.mgmt.hybridcompute.models.MachineExtension] - :param next_link: The uri to fetch the next page of machine extensions. Call ListNext() with - this to fetch the next page of extensions. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MachineExtension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionsListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ResourceUpdate(msrest.serialization.Model): - """The Update Resource model definition. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class MachineExtensionUpdate(ResourceUpdate): - """Describes a Machine Extension Update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Describes Machine Extension Update Properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MachineExtensionUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionUpdate, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class MachineExtensionUpdateProperties(msrest.serialization.Model): - """Describes the properties of a Machine Extension. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - """ - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionUpdateProperties, self).__init__(**kwargs) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.publisher = kwargs.get('publisher', None) - self.type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - - -class MachineExtensionUpgrade(msrest.serialization.Model): - """Describes the Machine Extension Upgrade Properties. - - :param extension_targets: Describes the Extension Target Properties. - :type extension_targets: dict[str, ~azure.mgmt.hybridcompute.models.ExtensionTargetProperties] - """ - - _attribute_map = { - 'extension_targets': {'key': 'extensionTargets', 'type': '{ExtensionTargetProperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineExtensionUpgrade, self).__init__(**kwargs) - self.extension_targets = kwargs.get('extension_targets', None) - - -class MachineListResult(msrest.serialization.Model): - """The List hybrid machine operation response. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of hybrid machines. - :type value: list[~azure.mgmt.hybridcompute.models.Machine] - :param next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to - fetch the next page of hybrid machines. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Machine]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class MachineProperties(msrest.serialization.Model): - """Describes the properties of a hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~azure.mgmt.hybridcompute.models.LocationData - :ivar agent_configuration: Configurable properties that the user can set locally via the - azcmagent config command, or remotely via ARM. - :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration - :param service_statuses: Statuses of dependent services that are reported back to ARM. - :type service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses - :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", - "Disconnected", "Error". - :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes - :ivar last_status_change: The time of the last status change. - :vartype last_status_change: ~datetime.datetime - :ivar error_details: Details about the error state. - :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar agent_version: The hybrid machine agent full version. - :vartype agent_version: str - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :ivar display_name: Specifies the hybrid machine display name. - :vartype display_name: str - :ivar machine_fqdn: Specifies the hybrid machine FQDN. - :vartype machine_fqdn: str - :param client_public_key: Public Key that the client provides to be used during initial - resource onboarding. - :type client_public_key: str - :ivar os_name: The Operating System running on the hybrid machine. - :vartype os_name: str - :ivar os_version: The version of Operating System running on the hybrid machine. - :vartype os_version: str - :param os_type: The type of Operating System (windows/linux). - :type os_type: str - :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. - :vartype vm_uuid: str - :param extensions: Machine Extensions information. - :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] - :ivar os_sku: Specifies the Operating System product SKU. - :vartype os_sku: str - :ivar domain_name: Specifies the Windows domain name. - :vartype domain_name: str - :ivar ad_fqdn: Specifies the AD fully qualified display name. - :vartype ad_fqdn: str - :ivar dns_fqdn: Specifies the DNS fully qualified display name. - :vartype dns_fqdn: str - :param private_link_scope_resource_id: The resource id of the private link scope this machine - is assigned to, if any. - :type private_link_scope_resource_id: str - :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this - machine is assigned to, if any. - :type parent_cluster_resource_id: str - :param mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. - :type mssql_discovered: str - :ivar detected_properties: Detected properties from the machine. - :vartype detected_properties: dict[str, str] - """ - - _validation = { - 'agent_configuration': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - 'last_status_change': {'readonly': True}, - 'error_details': {'readonly': True}, - 'agent_version': {'readonly': True}, - 'display_name': {'readonly': True}, - 'machine_fqdn': {'readonly': True}, - 'os_name': {'readonly': True}, - 'os_version': {'readonly': True}, - 'vm_uuid': {'readonly': True}, - 'os_sku': {'readonly': True}, - 'domain_name': {'readonly': True}, - 'ad_fqdn': {'readonly': True}, - 'dns_fqdn': {'readonly': True}, - 'detected_properties': {'readonly': True}, - } - - _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentConfiguration'}, - 'service_statuses': {'key': 'serviceStatuses', 'type': 'ServiceStatuses'}, - 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, - 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, - 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, - 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, - 'os_name': {'key': 'osName', 'type': 'str'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, - 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, - 'os_sku': {'key': 'osSku', 'type': 'str'}, - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, - 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, - 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, - 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, - 'mssql_discovered': {'key': 'mssqlDiscovered', 'type': 'str'}, - 'detected_properties': {'key': 'detectedProperties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineProperties, self).__init__(**kwargs) - self.location_data = kwargs.get('location_data', None) - self.agent_configuration = None - self.service_statuses = kwargs.get('service_statuses', None) - self.cloud_metadata = kwargs.get('cloud_metadata', None) - self.os_profile = kwargs.get('os_profile', None) - self.provisioning_state = None - self.status = None - self.last_status_change = None - self.error_details = None - self.agent_version = None - self.vm_id = kwargs.get('vm_id', None) - self.display_name = None - self.machine_fqdn = None - self.client_public_key = kwargs.get('client_public_key', None) - self.os_name = None - self.os_version = None - self.os_type = kwargs.get('os_type', None) - self.vm_uuid = None - self.extensions = kwargs.get('extensions', None) - self.os_sku = None - self.domain_name = None - self.ad_fqdn = None - self.dns_fqdn = None - self.private_link_scope_resource_id = kwargs.get('private_link_scope_resource_id', None) - self.parent_cluster_resource_id = kwargs.get('parent_cluster_resource_id', None) - self.mssql_discovered = kwargs.get('mssql_discovered', None) - self.detected_properties = None - - -class MachineUpdate(ResourceUpdate): - """Describes a hybrid machine Update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.hybridcompute.models.Identity - :param properties: Hybrid Compute Machine properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'properties': {'key': 'properties', 'type': 'MachineUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineUpdate, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.properties = kwargs.get('properties', None) - - -class MachineUpdateProperties(msrest.serialization.Model): - """Describes the ARM updatable properties of a hybrid machine. - - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~azure.mgmt.hybridcompute.models.LocationData - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile - :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata - :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this - machine is assigned to, if any. - :type parent_cluster_resource_id: str - :param private_link_scope_resource_id: The resource id of the private link scope this machine - is assigned to, if any. - :type private_link_scope_resource_id: str - """ - - _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, - 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, - 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, - 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, - 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MachineUpdateProperties, self).__init__(**kwargs) - self.location_data = kwargs.get('location_data', None) - self.os_profile = kwargs.get('os_profile', None) - self.cloud_metadata = kwargs.get('cloud_metadata', None) - self.parent_cluster_resource_id = kwargs.get('parent_cluster_resource_id', None) - self.private_link_scope_resource_id = kwargs.get('private_link_scope_resource_id', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.hybridcompute.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :param display: Display properties. - :type display: ~azure.mgmt.hybridcompute.models.OperationValueDisplay - :ivar is_data_action: This property indicates if the operation is an action or a data action. - :vartype is_data_action: bool - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationValueDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.display = kwargs.get('display', None) - self.is_data_action = None - - -class OperationValueDisplay(msrest.serialization.Model): - """Describes the properties of a Hybrid Compute Operation Value Display. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValueDisplay, self).__init__(**kwargs) - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OsProfile(msrest.serialization.Model): - """Specifies the operating system settings for the hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar computer_name: Specifies the host OS name of the hybrid machine. - :vartype computer_name: str - :param windows_configuration: Specifies the windows configuration for update management. - :type windows_configuration: ~azure.mgmt.hybridcompute.models.OsProfileWindowsConfiguration - :param linux_configuration: Specifies the linux configuration for update management. - :type linux_configuration: ~azure.mgmt.hybridcompute.models.OsProfileLinuxConfiguration - """ - - _validation = { - 'computer_name': {'readonly': True}, - } - - _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, - 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(OsProfile, self).__init__(**kwargs) - self.computer_name = None - self.windows_configuration = kwargs.get('windows_configuration', None) - self.linux_configuration = kwargs.get('linux_configuration', None) - - -class OsProfileLinuxConfiguration(msrest.serialization.Model): - """Specifies the linux configuration for update management. - - :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", - "AutomaticByPlatform". - :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes - :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", - "AutomaticByPlatform", "AutomaticByOS", "Manual". - :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OsProfileLinuxConfiguration, self).__init__(**kwargs) - self.assessment_mode = kwargs.get('assessment_mode', None) - self.patch_mode = kwargs.get('patch_mode', None) - - -class OsProfileWindowsConfiguration(msrest.serialization.Model): - """Specifies the windows configuration for update management. - - :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", - "AutomaticByPlatform". - :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes - :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", - "AutomaticByPlatform", "AutomaticByOS", "Manual". - :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OsProfileWindowsConfiguration, self).__init__(**kwargs) - self.assessment_mode = kwargs.get('assessment_mode', None) - self.patch_mode = kwargs.get('patch_mode', None) - - -class PrivateEndpointConnection(Resource): - """A private endpoint connection. - - 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 properties: Resource properties. - :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.system_data = None - - -class PrivateEndpointConnectionDataModel(msrest.serialization.Model): - """The Data Model for a Private Endpoint Connection associated with a Private Link Scope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM Resource Id of the Private Endpoint. - :vartype id: str - :ivar name: The Name of the Private Endpoint. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param properties: The Private Endpoint Connection properties. - :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties - """ - - _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'}, - 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionDataModel, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.properties = kwargs.get('properties', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class PrivateEndpointConnectionProperties(msrest.serialization.Model): - """Properties of a private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param private_endpoint: Private endpoint which the connection belongs to. - :type private_endpoint: ~azure.mgmt.hybridcompute.models.PrivateEndpointProperty - :param private_link_service_connection_state: Connection state of the private endpoint - connection. - :type private_link_service_connection_state: - ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty - :ivar provisioning_state: State of the private endpoint connection. - :vartype provisioning_state: str - :ivar group_ids: List of group IDs. - :vartype group_ids: list[str] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'group_ids': {'readonly': True}, - } - - _attribute_map = { - 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, - 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'group_ids': {'key': 'groupIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = None - self.group_ids = None - - -class PrivateEndpointProperty(msrest.serialization.Model): - """Private endpoint which the connection belongs to. - - :param id: Resource id of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointProperty, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - 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 properties: Resource properties. - :type properties: ~azure.mgmt.hybridcompute.models.PrivateLinkResourceProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.system_data = None - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateLinkResource] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class PrivateLinkResourceProperties(msrest.serialization.Model): - """Properties of a private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: Required DNS zone names of the the private link resource. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - 'required_zone_names': {'readonly': True}, - } - - _attribute_map = { - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourceProperties, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = None - - -class PrivateLinkScopeValidationDetails(msrest.serialization.Model): - """PrivateLinkScopeValidationDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource Id. - :vartype id: str - :param public_network_access: Indicates whether machines associated with the private link scope - can also use public Azure Arc service endpoints. Possible values include: "Enabled", - "Disabled". Default value: "Disabled". - :type public_network_access: str or ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType - :param connection_details: List of Private Endpoint Connection details. - :type connection_details: list[~azure.mgmt.hybridcompute.models.ConnectionDetail] - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'connection_details': {'key': 'connectionDetails', 'type': '[ConnectionDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkScopeValidationDetails, self).__init__(**kwargs) - self.id = None - self.public_network_access = kwargs.get('public_network_access', "Disabled") - self.connection_details = kwargs.get('connection_details', None) - - -class PrivateLinkServiceConnectionStateProperty(msrest.serialization.Model): - """State of the private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param status: Required. The private link service connection status. - :type status: str - :param description: Required. The private link service connection description. - :type description: str - :ivar actions_required: The actions required for private link service connection. - :vartype actions_required: str - """ - - _validation = { - 'status': {'required': True}, - 'description': {'required': True}, - 'actions_required': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.description = kwargs['description'] - self.actions_required = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ServiceStatus(msrest.serialization.Model): - """Describes the status and behavior of a service. - - :param status: The current status of the service. - :type status: str - :param startup_type: The behavior of the service when the Arc-enabled machine starts up. - :type startup_type: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'startup_type': {'key': 'startupType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.startup_type = kwargs.get('startup_type', None) - - -class ServiceStatuses(msrest.serialization.Model): - """Reports the state and behavior of dependent services. - - :param extension_service: The state of the extension service on the Arc-enabled machine. - :type extension_service: ~azure.mgmt.hybridcompute.models.ServiceStatus - :param guest_configuration_service: The state of the guest configuration service on the Arc- - enabled machine. - :type guest_configuration_service: ~azure.mgmt.hybridcompute.models.ServiceStatus - """ - - _attribute_map = { - 'extension_service': {'key': 'extensionService', 'type': 'ServiceStatus'}, - 'guest_configuration_service': {'key': 'guestConfigurationService', 'type': 'ServiceStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceStatuses, self).__init__(**kwargs) - self.extension_service = kwargs.get('extension_service', None) - self.guest_configuration_service = kwargs.get('guest_configuration_service', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.hybridcompute.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.hybridcompute.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py deleted file mode 100644 index 7652ba1b973..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py +++ /dev/null @@ -1,2049 +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 - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._connected_machine_enums import * - - -class AgentConfiguration(msrest.serialization.Model): - """Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar proxy_url: Specifies the URL of the proxy to be used. - :vartype proxy_url: str - :ivar incoming_connections_ports: Specifies the list of ports that the agent will be able to - listen on. - :vartype incoming_connections_ports: list[str] - :ivar extensions_allow_list: Array of extensions that are allowed to be installed or updated. - :vartype extensions_allow_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] - :ivar extensions_block_list: Array of extensions that are blocked (cannot be installed or - updated). - :vartype extensions_block_list: list[~azure.mgmt.hybridcompute.models.ConfigurationExtension] - :ivar proxy_bypass: List of service names which should not use the specified proxy server. - :vartype proxy_bypass: list[str] - :ivar extensions_enabled: Specifies whether the extension service is enabled or disabled. - :vartype extensions_enabled: str - :ivar guest_configuration_enabled: Specified whether the guest configuration service is enabled - or disabled. - :vartype guest_configuration_enabled: str - """ - - _validation = { - 'proxy_url': {'readonly': True}, - 'incoming_connections_ports': {'readonly': True}, - 'extensions_allow_list': {'readonly': True}, - 'extensions_block_list': {'readonly': True}, - 'proxy_bypass': {'readonly': True}, - 'extensions_enabled': {'readonly': True}, - 'guest_configuration_enabled': {'readonly': True}, - } - - _attribute_map = { - 'proxy_url': {'key': 'proxyUrl', 'type': 'str'}, - 'incoming_connections_ports': {'key': 'incomingConnectionsPorts', 'type': '[str]'}, - 'extensions_allow_list': {'key': 'extensionsAllowList', 'type': '[ConfigurationExtension]'}, - 'extensions_block_list': {'key': 'extensionsBlockList', 'type': '[ConfigurationExtension]'}, - 'proxy_bypass': {'key': 'proxyBypass', 'type': '[str]'}, - 'extensions_enabled': {'key': 'extensionsEnabled', 'type': 'str'}, - 'guest_configuration_enabled': {'key': 'guestConfigurationEnabled', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentConfiguration, self).__init__(**kwargs) - self.proxy_url = None - self.incoming_connections_ports = None - self.extensions_allow_list = None - self.extensions_block_list = None - self.proxy_bypass = None - self.extensions_enabled = None - self.guest_configuration_enabled = None - - -class CloudMetadata(msrest.serialization.Model): - """The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: Specifies the cloud provider (Azure/AWS/GCP...). - :vartype provider: str - """ - - _validation = { - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudMetadata, self).__init__(**kwargs) - self.provider = None - - -class ConfigurationExtension(msrest.serialization.Model): - """Describes properties that can identify extensions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar publisher: Publisher of the extension. - :vartype publisher: str - :ivar type: Type of the extension. - :vartype type: str - """ - - _validation = { - 'publisher': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationExtension, self).__init__(**kwargs) - self.publisher = None - self.type = None - - -class ConnectionDetail(msrest.serialization.Model): - """ConnectionDetail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource Id. - :vartype id: str - :ivar private_ip_address: The private endpoint connection private ip address. - :vartype private_ip_address: str - :ivar link_identifier: The private endpoint connection link identifier. - :vartype link_identifier: str - :ivar group_id: The private endpoint connection group id. - :vartype group_id: str - :ivar member_name: The private endpoint connection member name. - :vartype member_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'link_identifier': {'readonly': True}, - 'group_id': {'readonly': True}, - 'member_name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'member_name': {'key': 'memberName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectionDetail, self).__init__(**kwargs) - self.id = None - self.private_ip_address = None - self.link_identifier = None - self.group_id = None - self.member_name = None - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: object - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ExtensionTargetProperties(msrest.serialization.Model): - """Describes the Machine Extension Target Version Properties. - - :param target_version: Properties for the specified Extension to Upgrade. - :type target_version: str - """ - - _attribute_map = { - 'target_version': {'key': 'targetVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - target_version: Optional[str] = None, - **kwargs - ): - super(ExtensionTargetProperties, self).__init__(**kwargs) - self.target_version = target_version - - -class PrivateLinkScopesResource(msrest.serialization.Model): - """An azure resource object. - - 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: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(PrivateLinkScopesResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - - -class HybridComputePrivateLinkScope(PrivateLinkScopesResource): - """An Azure Arc PrivateLinkScope 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: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Properties that define a Azure Arc PrivateLinkScope resource. - :type properties: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'HybridComputePrivateLinkScopeProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["HybridComputePrivateLinkScopeProperties"] = None, - **kwargs - ): - super(HybridComputePrivateLinkScope, self).__init__(location=location, tags=tags, **kwargs) - self.properties = properties - self.system_data = None - - -class HybridComputePrivateLinkScopeListResult(msrest.serialization.Model): - """Describes the list of Azure Arc PrivateLinkScope resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Azure Arc PrivateLinkScope definitions. - :type value: list[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope] - :param next_link: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too - many PrivateLinkScopes where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[HybridComputePrivateLinkScope]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: List["HybridComputePrivateLinkScope"], - next_link: Optional[str] = None, - **kwargs - ): - super(HybridComputePrivateLinkScopeListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): - """Properties that define a Azure Arc PrivateLinkScope resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param public_network_access: Indicates whether machines associated with the private link scope - can also use public Azure Arc service endpoints. Possible values include: "Enabled", - "Disabled". Default value: "Disabled". - :type public_network_access: str or ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType - :ivar provisioning_state: Current state of this PrivateLinkScope: whether or not is has been - provisioned within the resource group it is defined. Users cannot change this value but are - able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. - :vartype provisioning_state: str - :ivar private_link_scope_id: The Guid id of the private link scope. - :vartype private_link_scope_id: str - :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. - :vartype private_endpoint_connections: - list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionDataModel] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'private_link_scope_id': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - } - - _attribute_map = { - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionDataModel]'}, - } - - def __init__( - self, - *, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = "Disabled", - **kwargs - ): - super(HybridComputePrivateLinkScopeProperties, self).__init__(**kwargs) - self.public_network_access = public_network_access - self.provisioning_state = None - self.private_link_scope_id = None - self.private_endpoint_connections = 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 LocationData(msrest.serialization.Model): - """Metadata pertaining to the geographic location of the resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. A canonical name for the geographic or physical location. - :type name: str - :param city: The city or locality where the resource is located. - :type city: str - :param district: The district, state, or province where the resource is located. - :type district: str - :param country_or_region: The country or region where the resource is located. - :type country_or_region: str - """ - - _validation = { - 'name': {'required': True, 'max_length': 256, 'min_length': 0}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'city': {'key': 'city', 'type': 'str'}, - 'district': {'key': 'district', 'type': 'str'}, - 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - city: Optional[str] = None, - district: Optional[str] = None, - country_or_region: Optional[str] = None, - **kwargs - ): - super(LocationData, self).__init__(**kwargs) - self.name = name - self.city = city - self.district = district - self.country_or_region = country_or_region - - -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 TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class Machine(TrackedResource): - """Describes a hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param properties: Hybrid Compute Machine properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineProperties - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.hybridcompute.models.Identity - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MachineProperties'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["MachineProperties"] = None, - identity: Optional["Identity"] = None, - **kwargs - ): - super(Machine, self).__init__(tags=tags, location=location, **kwargs) - self.properties = properties - self.identity = identity - self.system_data = None - - -class MachineExtension(TrackedResource): - """Describes a Machine Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param properties: Describes Machine Extension Properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MachineExtensionProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["MachineExtensionProperties"] = None, - **kwargs - ): - super(MachineExtension, self).__init__(tags=tags, location=location, **kwargs) - self.properties = properties - self.system_data = None - - -class MachineExtensionInstanceView(msrest.serialization.Model): - """Describes the Machine Extension Instance View. - - :param name: The machine extension name. - :type name: str - :param type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param status: Instance view status. - :type status: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[str] = None, - type_handler_version: Optional[str] = None, - status: Optional["MachineExtensionInstanceViewStatus"] = None, - **kwargs - ): - super(MachineExtensionInstanceView, self).__init__(**kwargs) - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.status = status - - -class MachineExtensionInstanceViewStatus(msrest.serialization.Model): - """Instance view status. - - :param code: The status code. - :type code: str - :param level: The level code. Possible values include: "Info", "Warning", "Error". - :type level: str or ~azure.mgmt.hybridcompute.models.StatusLevelTypes - :param display_status: The short localizable label for the status. - :type display_status: str - :param message: The detailed status message, including for alerts and error messages. - :type message: str - :param time: The time of the status. - :type time: ~datetime.datetime - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - level: Optional[Union[str, "StatusLevelTypes"]] = None, - display_status: Optional[str] = None, - message: Optional[str] = None, - time: Optional[datetime.datetime] = None, - **kwargs - ): - super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time - - -class MachineExtensionProperties(msrest.serialization.Model): - """Describes the properties of a Machine Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :param instance_view: The machine extension instance view. - :type instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'instanceView', 'type': 'MachineExtensionInstanceView'}, - } - - def __init__( - self, - *, - force_update_tag: Optional[str] = None, - publisher: Optional[str] = None, - type: Optional[str] = None, - type_handler_version: Optional[str] = None, - enable_automatic_upgrade: Optional[bool] = None, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[object] = None, - protected_settings: Optional[object] = None, - instance_view: Optional["MachineExtensionInstanceView"] = None, - **kwargs - ): - super(MachineExtensionProperties, self).__init__(**kwargs) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.enable_automatic_upgrade = enable_automatic_upgrade - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - self.provisioning_state = None - self.instance_view = instance_view - - -class MachineExtensionsListResult(msrest.serialization.Model): - """Describes the Machine Extensions List Result. - - :param value: The list of extensions. - :type value: list[~azure.mgmt.hybridcompute.models.MachineExtension] - :param next_link: The uri to fetch the next page of machine extensions. Call ListNext() with - this to fetch the next page of extensions. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MachineExtension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["MachineExtension"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(MachineExtensionsListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ResourceUpdate(msrest.serialization.Model): - """The Update Resource model definition. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(ResourceUpdate, self).__init__(**kwargs) - self.tags = tags - - -class MachineExtensionUpdate(ResourceUpdate): - """Describes a Machine Extension Update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Describes Machine Extension Update Properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MachineExtensionUpdateProperties'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["MachineExtensionUpdateProperties"] = None, - **kwargs - ): - super(MachineExtensionUpdate, self).__init__(tags=tags, **kwargs) - self.properties = properties - - -class MachineExtensionUpdateProperties(msrest.serialization.Model): - """Describes the properties of a Machine Extension. - - :param force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param type: Specifies the type of the extension; an example is "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :type enable_automatic_upgrade: bool - :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object - """ - - _attribute_map = { - 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'enable_automatic_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, - 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, - } - - def __init__( - self, - *, - force_update_tag: Optional[str] = None, - publisher: Optional[str] = None, - type: Optional[str] = None, - type_handler_version: Optional[str] = None, - enable_automatic_upgrade: Optional[bool] = None, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[object] = None, - protected_settings: Optional[object] = None, - **kwargs - ): - super(MachineExtensionUpdateProperties, self).__init__(**kwargs) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.enable_automatic_upgrade = enable_automatic_upgrade - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - - -class MachineExtensionUpgrade(msrest.serialization.Model): - """Describes the Machine Extension Upgrade Properties. - - :param extension_targets: Describes the Extension Target Properties. - :type extension_targets: dict[str, ~azure.mgmt.hybridcompute.models.ExtensionTargetProperties] - """ - - _attribute_map = { - 'extension_targets': {'key': 'extensionTargets', 'type': '{ExtensionTargetProperties}'}, - } - - def __init__( - self, - *, - extension_targets: Optional[Dict[str, "ExtensionTargetProperties"]] = None, - **kwargs - ): - super(MachineExtensionUpgrade, self).__init__(**kwargs) - self.extension_targets = extension_targets - - -class MachineListResult(msrest.serialization.Model): - """The List hybrid machine operation response. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of hybrid machines. - :type value: list[~azure.mgmt.hybridcompute.models.Machine] - :param next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to - fetch the next page of hybrid machines. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Machine]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: List["Machine"], - next_link: Optional[str] = None, - **kwargs - ): - super(MachineListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class MachineProperties(msrest.serialization.Model): - """Describes the properties of a hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~azure.mgmt.hybridcompute.models.LocationData - :ivar agent_configuration: Configurable properties that the user can set locally via the - azcmagent config command, or remotely via ARM. - :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration - :param service_statuses: Statuses of dependent services that are reported back to ARM. - :type service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses - :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", - "Disconnected", "Error". - :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes - :ivar last_status_change: The time of the last status change. - :vartype last_status_change: ~datetime.datetime - :ivar error_details: Details about the error state. - :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar agent_version: The hybrid machine agent full version. - :vartype agent_version: str - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :ivar display_name: Specifies the hybrid machine display name. - :vartype display_name: str - :ivar machine_fqdn: Specifies the hybrid machine FQDN. - :vartype machine_fqdn: str - :param client_public_key: Public Key that the client provides to be used during initial - resource onboarding. - :type client_public_key: str - :ivar os_name: The Operating System running on the hybrid machine. - :vartype os_name: str - :ivar os_version: The version of Operating System running on the hybrid machine. - :vartype os_version: str - :param os_type: The type of Operating System (windows/linux). - :type os_type: str - :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. - :vartype vm_uuid: str - :param extensions: Machine Extensions information. - :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] - :ivar os_sku: Specifies the Operating System product SKU. - :vartype os_sku: str - :ivar domain_name: Specifies the Windows domain name. - :vartype domain_name: str - :ivar ad_fqdn: Specifies the AD fully qualified display name. - :vartype ad_fqdn: str - :ivar dns_fqdn: Specifies the DNS fully qualified display name. - :vartype dns_fqdn: str - :param private_link_scope_resource_id: The resource id of the private link scope this machine - is assigned to, if any. - :type private_link_scope_resource_id: str - :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this - machine is assigned to, if any. - :type parent_cluster_resource_id: str - :param mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. - :type mssql_discovered: str - :ivar detected_properties: Detected properties from the machine. - :vartype detected_properties: dict[str, str] - """ - - _validation = { - 'agent_configuration': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - 'last_status_change': {'readonly': True}, - 'error_details': {'readonly': True}, - 'agent_version': {'readonly': True}, - 'display_name': {'readonly': True}, - 'machine_fqdn': {'readonly': True}, - 'os_name': {'readonly': True}, - 'os_version': {'readonly': True}, - 'vm_uuid': {'readonly': True}, - 'os_sku': {'readonly': True}, - 'domain_name': {'readonly': True}, - 'ad_fqdn': {'readonly': True}, - 'dns_fqdn': {'readonly': True}, - 'detected_properties': {'readonly': True}, - } - - _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentConfiguration'}, - 'service_statuses': {'key': 'serviceStatuses', 'type': 'ServiceStatuses'}, - 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, - 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, - 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, - 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, - 'os_name': {'key': 'osName', 'type': 'str'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, - 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, - 'os_sku': {'key': 'osSku', 'type': 'str'}, - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, - 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, - 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, - 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, - 'mssql_discovered': {'key': 'mssqlDiscovered', 'type': 'str'}, - 'detected_properties': {'key': 'detectedProperties', 'type': '{str}'}, - } - - def __init__( - self, - *, - location_data: Optional["LocationData"] = None, - service_statuses: Optional["ServiceStatuses"] = None, - cloud_metadata: Optional["CloudMetadata"] = None, - os_profile: Optional["OsProfile"] = None, - vm_id: Optional[str] = None, - client_public_key: Optional[str] = None, - os_type: Optional[str] = None, - extensions: Optional[List["MachineExtensionInstanceView"]] = None, - private_link_scope_resource_id: Optional[str] = None, - parent_cluster_resource_id: Optional[str] = None, - mssql_discovered: Optional[str] = None, - **kwargs - ): - super(MachineProperties, self).__init__(**kwargs) - self.location_data = location_data - self.agent_configuration = None - self.service_statuses = service_statuses - self.cloud_metadata = cloud_metadata - self.os_profile = os_profile - self.provisioning_state = None - self.status = None - self.last_status_change = None - self.error_details = None - self.agent_version = None - self.vm_id = vm_id - self.display_name = None - self.machine_fqdn = None - self.client_public_key = client_public_key - self.os_name = None - self.os_version = None - self.os_type = os_type - self.vm_uuid = None - self.extensions = extensions - self.os_sku = None - self.domain_name = None - self.ad_fqdn = None - self.dns_fqdn = None - self.private_link_scope_resource_id = private_link_scope_resource_id - self.parent_cluster_resource_id = parent_cluster_resource_id - self.mssql_discovered = mssql_discovered - self.detected_properties = None - - -class MachineUpdate(ResourceUpdate): - """Describes a hybrid machine Update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.hybridcompute.models.Identity - :param properties: Hybrid Compute Machine properties. - :type properties: ~azure.mgmt.hybridcompute.models.MachineUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'properties': {'key': 'properties', 'type': 'MachineUpdateProperties'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - properties: Optional["MachineUpdateProperties"] = None, - **kwargs - ): - super(MachineUpdate, self).__init__(tags=tags, **kwargs) - self.identity = identity - self.properties = properties - - -class MachineUpdateProperties(msrest.serialization.Model): - """Describes the ARM updatable properties of a hybrid machine. - - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~azure.mgmt.hybridcompute.models.LocationData - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OsProfile - :param cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - :type cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata - :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this - machine is assigned to, if any. - :type parent_cluster_resource_id: str - :param private_link_scope_resource_id: The resource id of the private link scope this machine - is assigned to, if any. - :type private_link_scope_resource_id: str - """ - - _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, - 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, - 'cloud_metadata': {'key': 'cloudMetadata', 'type': 'CloudMetadata'}, - 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, - 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - location_data: Optional["LocationData"] = None, - os_profile: Optional["OsProfile"] = None, - cloud_metadata: Optional["CloudMetadata"] = None, - parent_cluster_resource_id: Optional[str] = None, - private_link_scope_resource_id: Optional[str] = None, - **kwargs - ): - super(MachineUpdateProperties, self).__init__(**kwargs) - self.location_data = location_data - self.os_profile = os_profile - self.cloud_metadata = cloud_metadata - self.parent_cluster_resource_id = parent_cluster_resource_id - self.private_link_scope_resource_id = private_link_scope_resource_id - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.hybridcompute.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :param display: Display properties. - :type display: ~azure.mgmt.hybridcompute.models.OperationValueDisplay - :ivar is_data_action: This property indicates if the operation is an action or a data action. - :vartype is_data_action: bool - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationValueDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - *, - display: Optional["OperationValueDisplay"] = None, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.display = display - self.is_data_action = None - - -class OperationValueDisplay(msrest.serialization.Model): - """Describes the properties of a Hybrid Compute Operation Value Display. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValueDisplay, self).__init__(**kwargs) - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OsProfile(msrest.serialization.Model): - """Specifies the operating system settings for the hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar computer_name: Specifies the host OS name of the hybrid machine. - :vartype computer_name: str - :param windows_configuration: Specifies the windows configuration for update management. - :type windows_configuration: ~azure.mgmt.hybridcompute.models.OsProfileWindowsConfiguration - :param linux_configuration: Specifies the linux configuration for update management. - :type linux_configuration: ~azure.mgmt.hybridcompute.models.OsProfileLinuxConfiguration - """ - - _validation = { - 'computer_name': {'readonly': True}, - } - - _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, - 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, - } - - def __init__( - self, - *, - windows_configuration: Optional["OsProfileWindowsConfiguration"] = None, - linux_configuration: Optional["OsProfileLinuxConfiguration"] = None, - **kwargs - ): - super(OsProfile, self).__init__(**kwargs) - self.computer_name = None - self.windows_configuration = windows_configuration - self.linux_configuration = linux_configuration - - -class OsProfileLinuxConfiguration(msrest.serialization.Model): - """Specifies the linux configuration for update management. - - :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", - "AutomaticByPlatform". - :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes - :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", - "AutomaticByPlatform", "AutomaticByOS", "Manual". - :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, - } - - def __init__( - self, - *, - assessment_mode: Optional[Union[str, "AssessmentModeTypes"]] = None, - patch_mode: Optional[Union[str, "PatchModeTypes"]] = None, - **kwargs - ): - super(OsProfileLinuxConfiguration, self).__init__(**kwargs) - self.assessment_mode = assessment_mode - self.patch_mode = patch_mode - - -class OsProfileWindowsConfiguration(msrest.serialization.Model): - """Specifies the windows configuration for update management. - - :param assessment_mode: Specifies the assessment mode. Possible values include: "ImageDefault", - "AutomaticByPlatform". - :type assessment_mode: str or ~azure.mgmt.hybridcompute.models.AssessmentModeTypes - :param patch_mode: Specifies the patch mode. Possible values include: "ImageDefault", - "AutomaticByPlatform", "AutomaticByOS", "Manual". - :type patch_mode: str or ~azure.mgmt.hybridcompute.models.PatchModeTypes - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - 'patch_mode': {'key': 'patchSettings.patchMode', 'type': 'str'}, - } - - def __init__( - self, - *, - assessment_mode: Optional[Union[str, "AssessmentModeTypes"]] = None, - patch_mode: Optional[Union[str, "PatchModeTypes"]] = None, - **kwargs - ): - super(OsProfileWindowsConfiguration, self).__init__(**kwargs) - self.assessment_mode = assessment_mode - self.patch_mode = patch_mode - - -class PrivateEndpointConnection(Resource): - """A private endpoint connection. - - 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 properties: Resource properties. - :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - properties: Optional["PrivateEndpointConnectionProperties"] = None, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.properties = properties - self.system_data = None - - -class PrivateEndpointConnectionDataModel(msrest.serialization.Model): - """The Data Model for a Private Endpoint Connection associated with a Private Link Scope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM Resource Id of the Private Endpoint. - :vartype id: str - :ivar name: The Name of the Private Endpoint. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param properties: The Private Endpoint Connection properties. - :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties - """ - - _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'}, - 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, - } - - def __init__( - self, - *, - properties: Optional["PrivateEndpointConnectionProperties"] = None, - **kwargs - ): - super(PrivateEndpointConnectionDataModel, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.properties = properties - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class PrivateEndpointConnectionProperties(msrest.serialization.Model): - """Properties of a private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param private_endpoint: Private endpoint which the connection belongs to. - :type private_endpoint: ~azure.mgmt.hybridcompute.models.PrivateEndpointProperty - :param private_link_service_connection_state: Connection state of the private endpoint - connection. - :type private_link_service_connection_state: - ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty - :ivar provisioning_state: State of the private endpoint connection. - :vartype provisioning_state: str - :ivar group_ids: List of group IDs. - :vartype group_ids: list[str] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'group_ids': {'readonly': True}, - } - - _attribute_map = { - 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, - 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'group_ids': {'key': 'groupIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - private_endpoint: Optional["PrivateEndpointProperty"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionStateProperty"] = None, - **kwargs - ): - super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = None - self.group_ids = None - - -class PrivateEndpointProperty(msrest.serialization.Model): - """Private endpoint which the connection belongs to. - - :param id: Resource id of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): - super(PrivateEndpointProperty, self).__init__(**kwargs) - self.id = id - - -class PrivateLinkResource(Resource): - """A private link resource. - - 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 properties: Resource properties. - :type properties: ~azure.mgmt.hybridcompute.models.PrivateLinkResourceProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - properties: Optional["PrivateLinkResourceProperties"] = None, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.properties = properties - self.system_data = None - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateLinkResource] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class PrivateLinkResourceProperties(msrest.serialization.Model): - """Properties of a private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: Required DNS zone names of the the private link resource. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - 'required_zone_names': {'readonly': True}, - } - - _attribute_map = { - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourceProperties, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = None - - -class PrivateLinkScopeValidationDetails(msrest.serialization.Model): - """PrivateLinkScopeValidationDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource Id. - :vartype id: str - :param public_network_access: Indicates whether machines associated with the private link scope - can also use public Azure Arc service endpoints. Possible values include: "Enabled", - "Disabled". Default value: "Disabled". - :type public_network_access: str or ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType - :param connection_details: List of Private Endpoint Connection details. - :type connection_details: list[~azure.mgmt.hybridcompute.models.ConnectionDetail] - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'connection_details': {'key': 'connectionDetails', 'type': '[ConnectionDetail]'}, - } - - def __init__( - self, - *, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = "Disabled", - connection_details: Optional[List["ConnectionDetail"]] = None, - **kwargs - ): - super(PrivateLinkScopeValidationDetails, self).__init__(**kwargs) - self.id = None - self.public_network_access = public_network_access - self.connection_details = connection_details - - -class PrivateLinkServiceConnectionStateProperty(msrest.serialization.Model): - """State of the private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param status: Required. The private link service connection status. - :type status: str - :param description: Required. The private link service connection description. - :type description: str - :ivar actions_required: The actions required for private link service connection. - :vartype actions_required: str - """ - - _validation = { - 'status': {'required': True}, - 'description': {'required': True}, - 'actions_required': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - *, - status: str, - description: str, - **kwargs - ): - super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ServiceStatus(msrest.serialization.Model): - """Describes the status and behavior of a service. - - :param status: The current status of the service. - :type status: str - :param startup_type: The behavior of the service when the Arc-enabled machine starts up. - :type startup_type: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'startup_type': {'key': 'startupType', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[str] = None, - startup_type: Optional[str] = None, - **kwargs - ): - super(ServiceStatus, self).__init__(**kwargs) - self.status = status - self.startup_type = startup_type - - -class ServiceStatuses(msrest.serialization.Model): - """Reports the state and behavior of dependent services. - - :param extension_service: The state of the extension service on the Arc-enabled machine. - :type extension_service: ~azure.mgmt.hybridcompute.models.ServiceStatus - :param guest_configuration_service: The state of the guest configuration service on the Arc- - enabled machine. - :type guest_configuration_service: ~azure.mgmt.hybridcompute.models.ServiceStatus - """ - - _attribute_map = { - 'extension_service': {'key': 'extensionService', 'type': 'ServiceStatus'}, - 'guest_configuration_service': {'key': 'guestConfigurationService', 'type': 'ServiceStatus'}, - } - - def __init__( - self, - *, - extension_service: Optional["ServiceStatus"] = None, - guest_configuration_service: Optional["ServiceStatus"] = None, - **kwargs - ): - super(ServiceStatuses, self).__init__(**kwargs) - self.extension_service = extension_service - self.guest_configuration_service = guest_configuration_service - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.hybridcompute.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.hybridcompute.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = tags diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py deleted file mode 100644 index 641a5a8b66c..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._machines_operations import MachinesOperations -from ._machine_extensions_operations import MachineExtensionsOperations -from ._connected_machine_operations import ConnectedMachineOperationsMixin -from ._operations import Operations -from ._private_link_scopes_operations import PrivateLinkScopesOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations - -__all__ = [ - 'MachinesOperations', - 'MachineExtensionsOperations', - 'ConnectedMachineOperationsMixin', - 'Operations', - 'PrivateLinkScopesOperations', - 'PrivateLinkResourcesOperations', - 'PrivateEndpointConnectionsOperations', -] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py deleted file mode 100644 index 5f958e2a2c3..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py +++ /dev/null @@ -1,148 +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.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ConnectedMachineOperationsMixin(object): - - def _upgrade_extensions_initial( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_upgrade_parameters, # type: "models.MachineExtensionUpgrade" - **kwargs # type: Any - ): - # type: (...) -> None - 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 = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._upgrade_extensions_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_upgrade_parameters, 'MachineExtensionUpgrade') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _upgrade_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore - - def begin_upgrade_extensions( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_upgrade_parameters, # type: "models.MachineExtensionUpgrade" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """The operation to Upgrade Machine Extensions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. - :type machine_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - :type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._upgrade_extensions_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_upgrade_parameters=extension_upgrade_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_upgrade_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py deleted file mode 100644 index d25ff8a68f0..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py +++ /dev/null @@ -1,583 +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.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -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 MachineExtensionsOperations(object): - """MachineExtensionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _create_or_update_initial( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - extension_parameters, # type: "models.MachineExtension" - **kwargs # type: Any - ): - # type: (...) -> Optional["models.MachineExtension"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'MachineExtension') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - extension_parameters, # type: "models.MachineExtension" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["models.MachineExtension"] - """The operation to create or update the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine where the extension should be created or updated. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param extension_parameters: Parameters supplied to the Create Machine Extension operation. - :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtension - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=extension_name, - extension_parameters=extension_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - extension_parameters, # type: "models.MachineExtensionUpdate" - **kwargs # type: Any - ): - # type: (...) -> Optional["models.MachineExtension"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'MachineExtensionUpdate') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - extension_parameters, # type: "models.MachineExtensionUpdate" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["models.MachineExtension"] - """The operation to create or update the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine where the extension should be created or updated. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param extension_parameters: Parameters supplied to the Create Machine Extension operation. - :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=extension_name, - extension_parameters=extension_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - 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 = "2022-03-10" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # 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, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """The operation to delete the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine where the extension should be deleted. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=extension_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - machine_name, # type: str - extension_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.MachineExtension" - """The operation to get the extension. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine containing the extension. - :type machine_name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - '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') - - # 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) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MachineExtension', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - machine_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.MachineExtensionsListResult"] - """The operation to get all extensions of a non-Azure machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the machine containing the extension. - :type machine_name: str - :param expand: The expand expression to apply on the operation. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MachineExtensionsListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineExtensionsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - '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] - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - 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('MachineExtensionsListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py deleted file mode 100644 index 07363987d22..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py +++ /dev/null @@ -1,310 +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 MachinesOperations(object): - """MachinesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def delete( - self, - resource_group_name, # type: str - machine_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """The operation to remove a hybrid machine identity in Azure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. - :type machine_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 = "2022-03-10" - 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), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - machine_name, # type: str - expand=None, # type: Optional[Union[str, "models.InstanceViewTypes"]] - **kwargs # type: Any - ): - # type: (...) -> "models.Machine" - """Retrieves information about the model view or the instance view of a hybrid machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the hybrid machine. - :type machine_name: str - :param expand: The expand expression to apply on the operation. - :type expand: str or ~azure.mgmt.hybridcompute.models.InstanceViewTypes - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Machine, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.Machine - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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), - 'machineName': self._serialize.url("machine_name", machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Machine', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.MachineListResult"] - """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the - response to get the next page of hybrid machines. - - :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 MachineListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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('MachineListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'} # type: ignore - - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.MachineListResult"] - """Lists all the hybrid machines in the specified subscription. Use the nextLink property in the - response to get the next page of hybrid machines. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MachineListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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('MachineListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py deleted file mode 100644 index 05a1c555a5f..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py +++ /dev/null @@ -1,110 +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 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: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.OperationListResult"] - """Gets a list of hybrid compute operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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 - # 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('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.HybridCompute/operations'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index d3cbcd3d380..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_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 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.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -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 PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get( - self, - resource_group_name, # type: str - scope_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.PrivateEndpointConnection" - """Gets a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - scope_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> Optional["models.PrivateEndpointConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - scope_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["models.PrivateEndpointConnection"] - """Approve or reject a private endpoint connection with a given name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. - :type private_endpoint_connection_name: str - :param parameters: - :type parameters: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - scope_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - 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 = "2022-03-10" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - scope_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a private endpoint connection with a given name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - def list_by_private_link_scope( - self, - resource_group_name, # type: str - scope_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] - """Gets all private endpoint connections on a private link scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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_private_link_scope.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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateEndpointConnectionListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py deleted file mode 100644 index b3da8697616..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,186 +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 PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_private_link_scope( - self, - resource_group_name, # type: str - scope_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.PrivateLinkResourceListResult"] - """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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_private_link_scope.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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateLinkResourceListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'} # type: ignore - - def get( - self, - resource_group_name, # type: str - scope_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.PrivateLinkResource" - """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param group_name: The name of the private link resource. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" - 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), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py deleted file mode 100644 index a5f464c401c..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py +++ /dev/null @@ -1,623 +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.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -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 PrivateLinkScopesOperations(object): - """PrivateLinkScopesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridcompute.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.HybridComputePrivateLinkScopeListResult"] - """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either HybridComputePrivateLinkScopeListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - 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('HybridComputePrivateLinkScopeListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.HybridComputePrivateLinkScopeListResult"] - """Gets a list of Azure Arc PrivateLinkScopes within a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either HybridComputePrivateLinkScopeListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - '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('HybridComputePrivateLinkScopeListResult', 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]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - scope_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - 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 = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - scope_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Azure Arc PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - scope_name=scope_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - scope_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.HybridComputePrivateLinkScope" - """Returns a Azure Arc PrivateLinkScope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HybridComputePrivateLinkScope, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - scope_name, # type: str - parameters, # type: "models.HybridComputePrivateLinkScope" - **kwargs # type: Any - ): - # type: (...) -> "models.HybridComputePrivateLinkScope" - """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value - for InstrumentationKey nor AppId in the Put operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param parameters: Properties that need to be specified to create or update a Azure Arc for - Servers and Clusters PrivateLinkScope. - :type parameters: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HybridComputePrivateLinkScope, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'HybridComputePrivateLinkScope') - 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) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - def update_tags( - self, - resource_group_name, # type: str - scope_name, # type: str - private_link_scope_tags, # type: "models.TagsResource" - **kwargs # type: Any - ): - # type: (...) -> "models.HybridComputePrivateLinkScope" - """Updates an existing PrivateLinkScope's tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param scope_name: The name of the Azure Arc PrivateLinkScope resource. - :type scope_name: str - :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope - instance. - :type private_link_scope_tags: ~azure.mgmt.hybridcompute.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HybridComputePrivateLinkScope, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') - 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) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore - - def get_validation_details( - self, - location, # type: str - private_link_scope_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.PrivateLinkScopeValidationDetails" - """Returns a Azure Arc PrivateLinkScope's validation details. - - :param location: The location of the target resource. - :type location: str - :param private_link_scope_id: The id (Guid) of the Azure Arc PrivateLinkScope resource. - :type private_link_scope_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkScopeValidationDetails, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self.get_validation_details.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'privateLinkScopeId': self._serialize.url("private_link_scope_id", private_link_scope_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkScopeValidationDetails', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_validation_details.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'} # type: ignore - - def get_validation_details_for_machine( - self, - resource_group_name, # type: str - machine_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.PrivateLinkScopeValidationDetails" - """Returns a Azure Arc PrivateLinkScope's validation details for a given machine. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param machine_name: The name of the target machine to get the private link scope validation - details for. - :type machine_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkScopeValidationDetails, or the result of cls(response) - :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-12-27" - accept = "application/json" - - # Construct URL - url = self.get_validation_details_for_machine.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), - 'machineName': self._serialize.url("machine_name", machine_name, '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') - - # 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) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkScopeValidationDetails', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_validation_details_for_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file