diff --git a/src/ssh/azext_ssh/_client_factory.py b/src/ssh/azext_ssh/_client_factory.py index f2b14f3e0b1..e91e3a9b8bc 100644 --- a/src/ssh/azext_ssh/_client_factory.py +++ b/src/ssh/azext_ssh/_client_factory.py @@ -8,9 +8,20 @@ # regenerated. # -------------------------------------------------------------------------- +from azure.cli.core.commands.client_factory import get_mgmt_service_client + + +def cf_hybridconnectivity_cl(cli_ctx, *_): + from azext_ssh.vendored_sdks.hybridconnectivity import HybridConnectivityManagementAPI + return get_mgmt_service_client(cli_ctx, + HybridConnectivityManagementAPI) + + +def cf_endpoint(cli_ctx, *_): + return cf_hybridconnectivity_cl(cli_ctx).endpoints + def cf_connectedmachine_cl(cli_ctx, *_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client from azext_ssh.vendored_sdks.connectedmachine import ConnectedMachine return get_mgmt_service_client(cli_ctx, ConnectedMachine) @@ -18,19 +29,3 @@ def cf_connectedmachine_cl(cli_ctx, *_): 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/ssh/azext_ssh/constants.py b/src/ssh/azext_ssh/constants.py index 9be7ef75418..a52b8019402 100644 --- a/src/ssh/azext_ssh/constants.py +++ b/src/ssh/azext_ssh/constants.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -CLIENT_PROXY_VERSION = "1.3.017131" -CLIENT_PROXY_RELEASE = "release10-09-21" +CLIENT_PROXY_VERSION = "1.3.017634" +CLIENT_PROXY_RELEASE = "release01-11-21" CLIENT_PROXY_STORAGE_URL = "https://sshproxysa.blob.core.windows.net" CLEANUP_TOTAL_TIME_LIMIT_IN_SECONDS = 120 CLEANUP_TIME_INTERVAL_IN_SECONDS = 10 diff --git a/src/ssh/azext_ssh/custom.py b/src/ssh/azext_ssh/custom.py index 4d2198f8af3..b89adb3a79e 100644 --- a/src/ssh/azext_ssh/custom.py +++ b/src/ssh/azext_ssh/custom.py @@ -295,16 +295,24 @@ def _arc_get_client_side_proxy(): # Get the Access Details to connect to Arc Connectivity platform from the HybridCompute Resource Provider # TO DO: This is a temporary API call to get the relay info. We will move to a different one in the future. def _arc_list_access_details(cmd, resource_group, vm_name): - from azext_ssh._client_factory import cf_machine - client = cf_machine(cmd.cli_ctx) - status_code, result = client.list_access_details(resource_group_name=resource_group, machine_name=vm_name) - if status_code in [501, 404]: - error = {404: 'Not Found', 501: 'Not Implemented'} - raise azclierror.BadRequestError("REST API request for access information returned an invalid status " - f"\"{error[status_code]}\". Please update the current version of the SSH" - "extension by runing \"az extension update ssh\".") - result = result.replace("\'", "\"") - result_bytes = result.encode("ascii") + from azext_ssh._client_factory import cf_endpoint + client = cf_endpoint(cmd.cli_ctx) + try: + result = client.list_credentials(resource_group_name=resource_group, machine_name=vm_name, endpoint_name="default") + except Exception as e: + raise azclierror.ClientRequestError(f"Request for Azure Relay Information Failed: {str(e)}") + + result_string = json.dumps( + { + "relay": { + "namespaceName": result.namespace_name, + "namespaceNameSuffix": result.namespace_name_suffix, + "hybridConnectionName": result.hybrid_connection_name, + "accessKey": result.access_key, + "expiresOn": result.expires_on + } + }) + result_bytes = result_string.encode("ascii") enc = base64.b64encode(result_bytes) base64_result_string = enc.decode("ascii") return base64_result_string @@ -334,8 +342,8 @@ def _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, conf raise azclierror.InvalidArgumentValueError(error) else: - is_azure_vm = _check_if_azure_vm(cmd, resource_group_name, vm_name) - is_arc_server = _check_if_arc_server(cmd, resource_group_name, vm_name) + vm_error, is_azure_vm = _check_if_azure_vm(cmd, resource_group_name, vm_name) + arc_error, is_arc_server = _check_if_arc_server(cmd, resource_group_name, vm_name) if is_azure_vm and is_arc_server: raise azclierror.BadRequestError(f"{resource_group_name} has Azure VM and Arc Server with the " @@ -343,8 +351,12 @@ def _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, conf "of --vm-name and --resource-group") if not is_azure_vm and not is_arc_server: from azure.core.exceptions import ResourceNotFoundError - raise ResourceNotFoundError(f"The Resource {vm_name} under resource group '{resource_group_name}' " - "was not found.") + if isinstance(arc_error, ResourceNotFoundError) and isinstance(vm_error, ResourceNotFoundError): + raise azclierror.ResourceNotFoundError(f"The resource {vm_name} in the resource group " + "{resource_group_name} was not found. Erros:\n" + f"{str(arc_error)}\n{str(vm_error)}") + raise azclierror.BadRequestError("Unable to determine the target machine type as Azure VM or " + f"Arc Server. Errors:\n{str(arc_error)}\n{str(vm_error)}") if config_path: op_call = functools.partial(ssh_utils.write_ssh_config, config_path=config_path, overwrite=overwrite, @@ -361,21 +373,27 @@ def _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, conf def _check_if_azure_vm(cmd, resource_group_name, vm_name): from azure.cli.core.commands import client_factory from azure.cli.core import profiles - from azure.core.exceptions import ResourceNotFoundError + from azure.core.exceptions import ResourceNotFoundError, HttpResponseError try: compute_client = client_factory.get_mgmt_service_client(cmd.cli_ctx, profiles.ResourceType.MGMT_COMPUTE) compute_client.virtual_machines.get(resource_group_name, vm_name) - except ResourceNotFoundError: - return False - return True + except ResourceNotFoundError as e: + return e, False + # If user is not authorized to get the VM, it will throw a HttpResponseError + except HttpResponseError as e: + return e, False + return None, True def _check_if_arc_server(cmd, resource_group_name, vm_name): - from azure.core.exceptions import ResourceNotFoundError + from azure.core.exceptions import ResourceNotFoundError, HttpResponseError from azext_ssh._client_factory import cf_machine client = cf_machine(cmd.cli_ctx) try: client.get(resource_group_name=resource_group_name, machine_name=vm_name) - except ResourceNotFoundError: - return False - return True + except ResourceNotFoundError as e: + return e, False + # If user is not authorized to get the arc server, it will throw a HttpResponseError + except HttpResponseError as e: + return e, False + return None, True diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/__init__.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/__init__.py index 35ef17cd924..9a8a1b4dcf8 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/__init__.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._connected_machine import ConnectedMachine +from ._version import VERSION + +__version__ = VERSION __all__ = ['ConnectedMachine'] try: diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_configuration.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_configuration.py index a369296810e..102684e1826 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_configuration.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_configuration.py @@ -12,13 +12,14 @@ 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 -VERSION = "unknown" class ConnectedMachineConfiguration(Configuration): """Configuration for ConnectedMachine. @@ -47,9 +48,9 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-10-preview" + self.api_version = "2021-05-20" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'connectedmachine/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_connected_machine.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_connected_machine.py index a740f6f0196..75b9809af78 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_connected_machine.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_connected_machine.py @@ -32,17 +32,17 @@ class ConnectedMachine(ConnectedMachineOperationsMixin): """The Hybrid Compute Management Client. :ivar machines: MachinesOperations operations - :vartype machines: connected_machine.operations.MachinesOperations + :vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations :ivar machine_extensions: MachineExtensionsOperations operations - :vartype machine_extensions: connected_machine.operations.MachineExtensionsOperations + :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations :ivar operations: Operations operations - :vartype operations: connected_machine.operations.Operations + :vartype operations: azure.mgmt.hybridcompute.operations.Operations :ivar private_link_scopes: PrivateLinkScopesOperations operations - :vartype private_link_scopes: connected_machine.operations.PrivateLinkScopesOperations + :vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: connected_machine.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: azure.mgmt.hybridcompute.operations.PrivateLinkResourcesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: connected_machine.operations.PrivateEndpointConnectionsOperations + :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. @@ -66,6 +66,7 @@ def __init__( 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( diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_version.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_version.py new file mode 100644 index 00000000000..e5754a47ce6 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/_version.py @@ -0,0 +1,9 @@ +# 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/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_configuration.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_configuration.py index 248e7a48540..04e5e5f423c 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_configuration.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_configuration.py @@ -12,11 +12,12 @@ 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 -VERSION = "unknown" class ConnectedMachineConfiguration(Configuration): """Configuration for ConnectedMachine. @@ -44,9 +45,9 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-10-preview" + self.api_version = "2021-05-20" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'connectedmachine/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_connected_machine.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_connected_machine.py index 5eea54c2534..e5dbf9451bd 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_connected_machine.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/_connected_machine.py @@ -30,17 +30,17 @@ class ConnectedMachine(ConnectedMachineOperationsMixin): """The Hybrid Compute Management Client. :ivar machines: MachinesOperations operations - :vartype machines: connected_machine.aio.operations.MachinesOperations + :vartype machines: azure.mgmt.hybridcompute.aio.operations.MachinesOperations :ivar machine_extensions: MachineExtensionsOperations operations - :vartype machine_extensions: connected_machine.aio.operations.MachineExtensionsOperations + :vartype machine_extensions: azure.mgmt.hybridcompute.aio.operations.MachineExtensionsOperations :ivar operations: Operations operations - :vartype operations: connected_machine.aio.operations.Operations + :vartype operations: azure.mgmt.hybridcompute.aio.operations.Operations :ivar private_link_scopes: PrivateLinkScopesOperations operations - :vartype private_link_scopes: connected_machine.aio.operations.PrivateLinkScopesOperations + :vartype private_link_scopes: azure.mgmt.hybridcompute.aio.operations.PrivateLinkScopesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: connected_machine.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: azure.mgmt.hybridcompute.aio.operations.PrivateLinkResourcesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: connected_machine.aio.operations.PrivateEndpointConnectionsOperations + :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. @@ -63,6 +63,7 @@ def __init__( 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( diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py index 67684c5203e..b05efa22595 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py @@ -34,7 +34,7 @@ async def _upgrade_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -87,7 +87,7 @@ async def begin_upgrade_extensions( :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: ~connected_machine.models.MachineExtensionUpgrade + :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 diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py index 8ff9c9cc8ff..b9868deb183 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py @@ -28,7 +28,7 @@ class MachineExtensionsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -118,7 +118,7 @@ async def begin_create_or_update( :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: ~connected_machine.models.MachineExtension + :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 @@ -126,7 +126,7 @@ async def begin_create_or_update( :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[~connected_machine.models.MachineExtension] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -190,7 +190,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -252,7 +252,7 @@ async def begin_update( :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: ~connected_machine.models.MachineExtensionUpdate + :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 @@ -260,7 +260,7 @@ async def begin_update( :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[~connected_machine.models.MachineExtension] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +323,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -444,7 +444,7 @@ async def get( :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: ~connected_machine.models.MachineExtension + :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] @@ -452,7 +452,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -507,7 +507,7 @@ def list( :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[~connected_machine.models.MachineExtensionsListResult] + :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"] @@ -515,7 +515,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py index ca11a2e9b14..c066f92566e 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py @@ -26,7 +26,7 @@ class MachinesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,198 +41,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def list_access_details( - self, - resource_group_name: str, - machine_name: str, - **kwargs - ) -> str: - """The operation to create or update a hybrid machine resource 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: str, or the result of cls(response) - :rtype: str - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[str] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" - accept = "application/json" - - # Construct URL - url = self.list_access_details.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.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_access_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/listAccessDetails'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - machine_name: str, - parameters: "models.Machine", - **kwargs - ) -> "models.Machine": - """The operation to create or update a hybrid machine resource 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 - :param parameters: Parameters supplied to the Create hybrid machine operation. - :type parameters: ~connected_machine.models.Machine - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Machine, or the result of cls(response) - :rtype: ~connected_machine.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 = "2021-06-10-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - '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(parameters, 'Machine') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Machine', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - machine_name: str, - parameters: "models.MachineUpdate", - **kwargs - ) -> "models.Machine": - """The operation to update 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 parameters: Parameters supplied to the Update hybrid machine operation. - :type parameters: ~connected_machine.models.MachineUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Machine, or the result of cls(response) - :rtype: ~connected_machine.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 = "2021-06-10-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - '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(parameters, 'MachineUpdate') - 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('Machine', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - async def delete( self, resource_group_name: str, @@ -255,7 +63,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -303,10 +111,10 @@ async def get( :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 ~connected_machine.models.InstanceViewTypes + :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: ~connected_machine.models.Machine + :rtype: ~azure.mgmt.hybridcompute.models.Machine :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] @@ -314,7 +122,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -365,7 +173,7 @@ def list_by_resource_group( :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[~connected_machine.models.MachineListResult] + :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"] @@ -373,7 +181,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -434,7 +242,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MachineListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.MachineListResult] + :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"] @@ -442,7 +250,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_operations.py index eb7be25ef1f..581f88b893a 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_operations.py @@ -26,7 +26,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,7 +49,7 @@ def list( :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[~connected_machine.models.OperationListResult] + :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"] @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py index c4a9770a927..29a4616941d 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py @@ -28,7 +28,7 @@ class PrivateEndpointConnectionsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ async def get( :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: ~connected_machine.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] @@ -68,7 +68,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -106,7 +106,7 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - async def _create_or_update_initial( + async def _update_initial( self, resource_group_name: str, scope_name: str, @@ -119,12 +119,12 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore + 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), @@ -162,9 +162,9 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - async def begin_create_or_update( + async def begin_update( self, resource_group_name: str, scope_name: str, @@ -181,7 +181,7 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. :type private_endpoint_connection_name: str :param parameters: - :type parameters: ~connected_machine.models.PrivateEndpointConnection + :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 @@ -189,7 +189,7 @@ async def begin_create_or_update( :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[~connected_machine.models.PrivateEndpointConnection] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -200,7 +200,7 @@ async def begin_create_or_update( ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -238,7 +238,7 @@ def get_long_running_output(pipeline_response): ) 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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore async def _delete_initial( self, @@ -252,7 +252,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -370,7 +370,7 @@ def list_by_private_link_scope( :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[~connected_machine.models.PrivateEndpointConnectionListResult] + :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"] @@ -378,7 +378,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py index b474778b42e..59d91002542 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py @@ -26,7 +26,7 @@ class PrivateLinkResourcesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_private_link_scope( :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[~connected_machine.models.PrivateLinkResourceListResult] + :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"] @@ -63,7 +63,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -133,7 +133,7 @@ async def get( :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: ~connected_machine.models.PrivateLinkResource + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] @@ -141,7 +141,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py index b906775b085..dcc71ced523 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py @@ -28,7 +28,7 @@ class PrivateLinkScopesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list( :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[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :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"] @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -121,7 +121,7 @@ def list_by_resource_group( :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[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :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"] @@ -129,7 +129,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -192,7 +192,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -304,7 +304,7 @@ async def get( :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: ~connected_machine.models.HybridComputePrivateLinkScope + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] @@ -312,7 +312,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -365,10 +365,10 @@ async def create_or_update( :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: ~connected_machine.models.HybridComputePrivateLinkScope + :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: ~connected_machine.models.HybridComputePrivateLinkScope + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] @@ -376,7 +376,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -438,10 +438,10 @@ async def update_tags( :type scope_name: str :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope instance. - :type private_link_scope_tags: ~connected_machine.models.TagsResource + :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: ~connected_machine.models.HybridComputePrivateLinkScope + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] @@ -449,7 +449,7 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -505,7 +505,7 @@ async def get_validation_details( :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: ~connected_machine.models.PrivateLinkScopeValidationDetails + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] @@ -513,7 +513,7 @@ async def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -565,7 +565,7 @@ async def get_validation_details_for_machine( :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: ~connected_machine.models.PrivateLinkScopeValidationDetails + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] @@ -573,7 +573,7 @@ async def get_validation_details_for_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/__init__.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/__init__.py index ecac1656673..1046533c5d8 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/__init__.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/__init__.py @@ -34,10 +34,7 @@ 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 @@ -81,10 +78,7 @@ 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 @@ -137,10 +131,7 @@ 'OperationValue', 'OperationValueDisplay', 'OsProfile', - 'OsProfileLinuxConfiguration', - 'OsProfileWindowsConfiguration', 'PrivateEndpointConnection', - 'PrivateEndpointConnectionDataModel', 'PrivateEndpointConnectionListResult', 'PrivateEndpointConnectionProperties', 'PrivateEndpointProperty', diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models.py index 483bb7efb0b..c430690dd8d 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models.py @@ -97,9 +97,9 @@ class ErrorDetail(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~connected_machine.models.ErrorDetail] + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~connected_machine.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] """ _validation = { @@ -134,7 +134,7 @@ 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: ~connected_machine.models.ErrorDetail + :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail """ _attribute_map = { @@ -232,9 +232,9 @@ class HybridComputePrivateLinkScope(PrivateLinkScopesResource): :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: ~connected_machine.models.HybridComputePrivateLinkScopeProperties + :type properties: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -270,7 +270,7 @@ class HybridComputePrivateLinkScopeListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. List of Azure Arc PrivateLinkScope definitions. - :type value: list[~connected_machine.models.HybridComputePrivateLinkScope] + :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 @@ -302,29 +302,24 @@ class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): :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 ~connected_machine.models.PublicNetworkAccessType + :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[~connected_machine.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__( @@ -335,7 +330,6 @@ def __init__( 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): @@ -513,11 +507,11 @@ class Machine(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param properties: Hybrid Compute Machine properties. - :type properties: ~connected_machine.models.MachineProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineProperties :param identity: Identity for the resource. - :type identity: ~connected_machine.models.Identity + :type identity: ~azure.mgmt.hybridcompute.models.Identity :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -569,9 +563,9 @@ class MachineExtension(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param properties: Describes Machine Extension Properties. - :type properties: ~connected_machine.models.MachineExtensionProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -611,7 +605,7 @@ class MachineExtensionInstanceView(msrest.serialization.Model): :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str :param status: Instance view status. - :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + :type status: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus """ _attribute_map = { @@ -638,7 +632,7 @@ class MachineExtensionInstanceViewStatus(msrest.serialization.Model): :param code: The status code. :type code: str :param level: The level code. Possible values include: "Info", "Warning", "Error". - :type level: str or ~connected_machine.models.StatusLevelTypes + :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. @@ -681,6 +675,9 @@ class MachineExtensionProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str + :param enable_auto_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_auto_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. @@ -693,7 +690,7 @@ class MachineExtensionProperties(msrest.serialization.Model): :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: ~connected_machine.models.MachineExtensionInstanceView + :type instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView """ _validation = { @@ -705,6 +702,7 @@ class MachineExtensionProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -721,6 +719,7 @@ def __init__( self.publisher = kwargs.get('publisher', None) self.type = kwargs.get('type', None) self.type_handler_version = kwargs.get('type_handler_version', None) + self.enable_auto_upgrade = kwargs.get('enable_auto_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) @@ -732,7 +731,7 @@ class MachineExtensionsListResult(msrest.serialization.Model): """Describes the Machine Extensions List Result. :param value: The list of extensions. - :type value: list[~connected_machine.models.MachineExtension] + :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 @@ -777,7 +776,7 @@ class MachineExtensionUpdate(ResourceUpdate): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param properties: Describes Machine Extension Update Properties. - :type properties: ~connected_machine.models.MachineExtensionUpdateProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdateProperties """ _attribute_map = { @@ -805,6 +804,9 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str + :param enable_auto_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_auto_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. @@ -821,6 +823,7 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -835,6 +838,7 @@ def __init__( self.publisher = kwargs.get('publisher', None) self.type = kwargs.get('type', None) self.type_handler_version = kwargs.get('type_handler_version', None) + self.enable_auto_upgrade = kwargs.get('enable_auto_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) @@ -844,7 +848,7 @@ class MachineExtensionUpgrade(msrest.serialization.Model): """Describes the Machine Extension Upgrade Properties. :param extension_targets: Describes the Extension Target Properties. - :type extension_targets: dict[str, ~connected_machine.models.ExtensionTargetProperties] + :type extension_targets: dict[str, ~azure.mgmt.hybridcompute.models.ExtensionTargetProperties] """ _attribute_map = { @@ -865,7 +869,7 @@ class MachineListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The list of hybrid machines. - :type value: list[~connected_machine.models.Machine] + :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 @@ -895,18 +899,18 @@ class MachineProperties(msrest.serialization.Model): 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: ~connected_machine.models.LocationData - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~connected_machine.models.OsProfile + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype 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 ~connected_machine.models.StatusTypes + :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[~connected_machine.models.ErrorDetail] + :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. @@ -922,12 +926,10 @@ class MachineProperties(msrest.serialization.Model): :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[~connected_machine.models.MachineExtensionInstanceView] + :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. @@ -942,13 +944,12 @@ class MachineProperties(msrest.serialization.Model): :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 = { + 'os_profile': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, @@ -980,7 +981,6 @@ class MachineProperties(msrest.serialization.Model): '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'}, @@ -989,7 +989,6 @@ class MachineProperties(msrest.serialization.Model): '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}'}, } @@ -999,7 +998,7 @@ def __init__( ): super(MachineProperties, self).__init__(**kwargs) self.location_data = kwargs.get('location_data', None) - self.os_profile = kwargs.get('os_profile', None) + self.os_profile = None self.provisioning_state = None self.status = None self.last_status_change = None @@ -1011,7 +1010,6 @@ def __init__( 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 @@ -1020,7 +1018,6 @@ def __init__( 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 @@ -1030,9 +1027,9 @@ class MachineUpdate(ResourceUpdate): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param identity: Identity for the resource. - :type identity: ~connected_machine.models.Identity + :type identity: ~azure.mgmt.hybridcompute.models.Identity :param properties: Hybrid Compute Machine properties. - :type properties: ~connected_machine.models.MachineUpdateProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineUpdateProperties """ _attribute_map = { @@ -1054,9 +1051,7 @@ 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: ~connected_machine.models.LocationData - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~connected_machine.models.OsProfile + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData :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 @@ -1067,7 +1062,6 @@ class MachineUpdateProperties(msrest.serialization.Model): _attribute_map = { 'location_data': {'key': 'locationData', 'type': 'LocationData'}, - 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, } @@ -1078,7 +1072,6 @@ def __init__( ): super(MachineUpdateProperties, self).__init__(**kwargs) self.location_data = kwargs.get('location_data', None) - self.os_profile = kwargs.get('os_profile', 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) @@ -1089,7 +1082,7 @@ class OperationListResult(msrest.serialization.Model): 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[~connected_machine.models.OperationValue] + :vartype value: list[~azure.mgmt.hybridcompute.models.OperationValue] """ _validation = { @@ -1118,7 +1111,7 @@ class OperationValue(msrest.serialization.Model): :ivar name: The name of the compute operation. :vartype name: str :param display: Display properties. - :type display: ~connected_machine.models.OperationValueDisplay + :type display: ~azure.mgmt.hybridcompute.models.OperationValueDisplay """ _validation = { @@ -1189,10 +1182,6 @@ class OsProfile(msrest.serialization.Model): :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: ~connected_machine.models.OsProfileWindowsConfiguration - :param linux_configuration: Specifies the linux configuration for update management. - :type linux_configuration: ~connected_machine.models.OsProfileLinuxConfiguration """ _validation = { @@ -1201,8 +1190,6 @@ class OsProfile(msrest.serialization.Model): _attribute_map = { 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, - 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, } def __init__( @@ -1211,46 +1198,6 @@ def __init__( ): 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. - :type assessment_mode: str - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OsProfileLinuxConfiguration, self).__init__(**kwargs) - self.assessment_mode = kwargs.get('assessment_mode', None) - - -class OsProfileWindowsConfiguration(msrest.serialization.Model): - """Specifies the windows configuration for update management. - - :param assessment_mode: Specifies the assessment mode. - :type assessment_mode: str - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OsProfileWindowsConfiguration, self).__init__(**kwargs) - self.assessment_mode = kwargs.get('assessment_mode', None) class PrivateEndpointConnection(Resource): @@ -1267,9 +1214,9 @@ class PrivateEndpointConnection(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :param properties: Resource properties. - :type properties: ~connected_machine.models.PrivateEndpointConnectionProperties + :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -1296,52 +1243,13 @@ def __init__( 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: ~connected_machine.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[~connected_machine.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] :ivar next_link: Link to retrieve next page of results. :vartype next_link: str """ @@ -1371,11 +1279,11 @@ class PrivateEndpointConnectionProperties(msrest.serialization.Model): 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: ~connected_machine.models.PrivateEndpointProperty + :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: - ~connected_machine.models.PrivateLinkServiceConnectionStateProperty + ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty :ivar provisioning_state: State of the private endpoint connection. :vartype provisioning_state: str """ @@ -1433,9 +1341,9 @@ class PrivateLinkResource(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :param properties: Resource properties. - :type properties: ~connected_machine.models.PrivateLinkResourceProperties + :type properties: ~azure.mgmt.hybridcompute.models.PrivateLinkResourceProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -1468,7 +1376,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Array of results. - :vartype value: list[~connected_machine.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateLinkResource] :ivar next_link: Link to retrieve next page of results. :vartype next_link: str """ @@ -1537,9 +1445,9 @@ class PrivateLinkScopeValidationDetails(msrest.serialization.Model): :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 ~connected_machine.models.PublicNetworkAccessType + :type public_network_access: str or ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType :param connection_details: List of Private Endpoint Connection details. - :type connection_details: list[~connected_machine.models.ConnectionDetail] + :type connection_details: list[~azure.mgmt.hybridcompute.models.ConnectionDetail] """ _validation = { @@ -1640,14 +1548,14 @@ class SystemData(msrest.serialization.Model): :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 ~connected_machine.models.CreatedByType + :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 ~connected_machine.models.CreatedByType + :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 """ diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models_py3.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models_py3.py index 5b26cd7616b..53262b0d285 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models_py3.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/models/_models_py3.py @@ -102,9 +102,9 @@ class ErrorDetail(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~connected_machine.models.ErrorDetail] + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~connected_machine.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] """ _validation = { @@ -139,7 +139,7 @@ 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: ~connected_machine.models.ErrorDetail + :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail """ _attribute_map = { @@ -244,9 +244,9 @@ class HybridComputePrivateLinkScope(PrivateLinkScopesResource): :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: ~connected_machine.models.HybridComputePrivateLinkScopeProperties + :type properties: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -286,7 +286,7 @@ class HybridComputePrivateLinkScopeListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. List of Azure Arc PrivateLinkScope definitions. - :type value: list[~connected_machine.models.HybridComputePrivateLinkScope] + :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 @@ -321,29 +321,24 @@ class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): :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 ~connected_machine.models.PublicNetworkAccessType + :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[~connected_machine.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__( @@ -356,7 +351,6 @@ def __init__( 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): @@ -542,11 +536,11 @@ class Machine(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param properties: Hybrid Compute Machine properties. - :type properties: ~connected_machine.models.MachineProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineProperties :param identity: Identity for the resource. - :type identity: ~connected_machine.models.Identity + :type identity: ~azure.mgmt.hybridcompute.models.Identity :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -603,9 +597,9 @@ class MachineExtension(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param properties: Describes Machine Extension Properties. - :type properties: ~connected_machine.models.MachineExtensionProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -649,7 +643,7 @@ class MachineExtensionInstanceView(msrest.serialization.Model): :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str :param status: Instance view status. - :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + :type status: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus """ _attribute_map = { @@ -681,7 +675,7 @@ class MachineExtensionInstanceViewStatus(msrest.serialization.Model): :param code: The status code. :type code: str :param level: The level code. Possible values include: "Info", "Warning", "Error". - :type level: str or ~connected_machine.models.StatusLevelTypes + :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. @@ -730,6 +724,9 @@ class MachineExtensionProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str + :param enable_auto_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_auto_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. @@ -742,7 +739,7 @@ class MachineExtensionProperties(msrest.serialization.Model): :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: ~connected_machine.models.MachineExtensionInstanceView + :type instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView """ _validation = { @@ -754,6 +751,7 @@ class MachineExtensionProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -768,6 +766,7 @@ def __init__( publisher: Optional[str] = None, type: Optional[str] = None, type_handler_version: Optional[str] = None, + enable_auto_upgrade: Optional[bool] = None, auto_upgrade_minor_version: Optional[bool] = None, settings: Optional[object] = None, protected_settings: Optional[object] = None, @@ -779,6 +778,7 @@ def __init__( self.publisher = publisher self.type = type self.type_handler_version = type_handler_version + self.enable_auto_upgrade = enable_auto_upgrade self.auto_upgrade_minor_version = auto_upgrade_minor_version self.settings = settings self.protected_settings = protected_settings @@ -790,7 +790,7 @@ class MachineExtensionsListResult(msrest.serialization.Model): """Describes the Machine Extensions List Result. :param value: The list of extensions. - :type value: list[~connected_machine.models.MachineExtension] + :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 @@ -840,7 +840,7 @@ class MachineExtensionUpdate(ResourceUpdate): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param properties: Describes Machine Extension Update Properties. - :type properties: ~connected_machine.models.MachineExtensionUpdateProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdateProperties """ _attribute_map = { @@ -871,6 +871,9 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): :type type: str :param type_handler_version: Specifies the version of the script handler. :type type_handler_version: str + :param enable_auto_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :type enable_auto_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. @@ -887,6 +890,7 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): 'publisher': {'key': 'publisher', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'enable_auto_upgrade': {'key': 'enableAutomaticUpgrade', 'type': 'bool'}, 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'}, 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, @@ -899,6 +903,7 @@ def __init__( publisher: Optional[str] = None, type: Optional[str] = None, type_handler_version: Optional[str] = None, + enable_auto_upgrade: Optional[bool] = None, auto_upgrade_minor_version: Optional[bool] = None, settings: Optional[object] = None, protected_settings: Optional[object] = None, @@ -909,6 +914,7 @@ def __init__( self.publisher = publisher self.type = type self.type_handler_version = type_handler_version + self.enable_auto_upgrade = enable_auto_upgrade self.auto_upgrade_minor_version = auto_upgrade_minor_version self.settings = settings self.protected_settings = protected_settings @@ -918,7 +924,7 @@ class MachineExtensionUpgrade(msrest.serialization.Model): """Describes the Machine Extension Upgrade Properties. :param extension_targets: Describes the Extension Target Properties. - :type extension_targets: dict[str, ~connected_machine.models.ExtensionTargetProperties] + :type extension_targets: dict[str, ~azure.mgmt.hybridcompute.models.ExtensionTargetProperties] """ _attribute_map = { @@ -941,7 +947,7 @@ class MachineListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The list of hybrid machines. - :type value: list[~connected_machine.models.Machine] + :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 @@ -974,18 +980,18 @@ class MachineProperties(msrest.serialization.Model): 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: ~connected_machine.models.LocationData - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~connected_machine.models.OsProfile + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype 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 ~connected_machine.models.StatusTypes + :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[~connected_machine.models.ErrorDetail] + :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. @@ -1001,12 +1007,10 @@ class MachineProperties(msrest.serialization.Model): :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[~connected_machine.models.MachineExtensionInstanceView] + :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. @@ -1021,13 +1025,12 @@ class MachineProperties(msrest.serialization.Model): :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 = { + 'os_profile': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, @@ -1059,7 +1062,6 @@ class MachineProperties(msrest.serialization.Model): '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'}, @@ -1068,7 +1070,6 @@ class MachineProperties(msrest.serialization.Model): '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}'}, } @@ -1076,19 +1077,16 @@ def __init__( self, *, location_data: Optional["LocationData"] = 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.os_profile = os_profile + self.os_profile = None self.provisioning_state = None self.status = None self.last_status_change = None @@ -1100,7 +1098,6 @@ def __init__( 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 @@ -1109,7 +1106,6 @@ def __init__( 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 @@ -1119,9 +1115,9 @@ class MachineUpdate(ResourceUpdate): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param identity: Identity for the resource. - :type identity: ~connected_machine.models.Identity + :type identity: ~azure.mgmt.hybridcompute.models.Identity :param properties: Hybrid Compute Machine properties. - :type properties: ~connected_machine.models.MachineUpdateProperties + :type properties: ~azure.mgmt.hybridcompute.models.MachineUpdateProperties """ _attribute_map = { @@ -1147,9 +1143,7 @@ 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: ~connected_machine.models.LocationData - :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~connected_machine.models.OsProfile + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData :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 @@ -1160,7 +1154,6 @@ class MachineUpdateProperties(msrest.serialization.Model): _attribute_map = { 'location_data': {'key': 'locationData', 'type': 'LocationData'}, - 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, } @@ -1169,14 +1162,12 @@ def __init__( self, *, location_data: Optional["LocationData"] = None, - os_profile: Optional["OsProfile"] = 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.parent_cluster_resource_id = parent_cluster_resource_id self.private_link_scope_resource_id = private_link_scope_resource_id @@ -1187,7 +1178,7 @@ class OperationListResult(msrest.serialization.Model): 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[~connected_machine.models.OperationValue] + :vartype value: list[~azure.mgmt.hybridcompute.models.OperationValue] """ _validation = { @@ -1216,7 +1207,7 @@ class OperationValue(msrest.serialization.Model): :ivar name: The name of the compute operation. :vartype name: str :param display: Display properties. - :type display: ~connected_machine.models.OperationValueDisplay + :type display: ~azure.mgmt.hybridcompute.models.OperationValueDisplay """ _validation = { @@ -1289,10 +1280,6 @@ class OsProfile(msrest.serialization.Model): :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: ~connected_machine.models.OsProfileWindowsConfiguration - :param linux_configuration: Specifies the linux configuration for update management. - :type linux_configuration: ~connected_machine.models.OsProfileLinuxConfiguration """ _validation = { @@ -1301,63 +1288,14 @@ class OsProfile(msrest.serialization.Model): _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. - :type assessment_mode: str - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - } - - def __init__( - self, - *, - assessment_mode: Optional[str] = None, - **kwargs - ): - super(OsProfileLinuxConfiguration, self).__init__(**kwargs) - self.assessment_mode = assessment_mode - - -class OsProfileWindowsConfiguration(msrest.serialization.Model): - """Specifies the windows configuration for update management. - - :param assessment_mode: Specifies the assessment mode. - :type assessment_mode: str - """ - - _attribute_map = { - 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, - } - - def __init__( - self, - *, - assessment_mode: Optional[str] = None, - **kwargs - ): - super(OsProfileWindowsConfiguration, self).__init__(**kwargs) - self.assessment_mode = assessment_mode class PrivateEndpointConnection(Resource): @@ -1374,9 +1312,9 @@ class PrivateEndpointConnection(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :param properties: Resource properties. - :type properties: ~connected_machine.models.PrivateEndpointConnectionProperties + :type properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -1405,54 +1343,13 @@ def __init__( 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: ~connected_machine.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[~connected_machine.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] :ivar next_link: Link to retrieve next page of results. :vartype next_link: str """ @@ -1482,11 +1379,11 @@ class PrivateEndpointConnectionProperties(msrest.serialization.Model): 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: ~connected_machine.models.PrivateEndpointProperty + :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: - ~connected_machine.models.PrivateLinkServiceConnectionStateProperty + ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty :ivar provisioning_state: State of the private endpoint connection. :vartype provisioning_state: str """ @@ -1549,9 +1446,9 @@ class PrivateLinkResource(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :param properties: Resource properties. - :type properties: ~connected_machine.models.PrivateLinkResourceProperties + :type properties: ~azure.mgmt.hybridcompute.models.PrivateLinkResourceProperties :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~connected_machine.models.SystemData + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -1586,7 +1483,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Array of results. - :vartype value: list[~connected_machine.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.hybridcompute.models.PrivateLinkResource] :ivar next_link: Link to retrieve next page of results. :vartype next_link: str """ @@ -1655,9 +1552,9 @@ class PrivateLinkScopeValidationDetails(msrest.serialization.Model): :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 ~connected_machine.models.PublicNetworkAccessType + :type public_network_access: str or ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType :param connection_details: List of Private Endpoint Connection details. - :type connection_details: list[~connected_machine.models.ConnectionDetail] + :type connection_details: list[~azure.mgmt.hybridcompute.models.ConnectionDetail] """ _validation = { @@ -1764,14 +1661,14 @@ class SystemData(msrest.serialization.Model): :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 ~connected_machine.models.CreatedByType + :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 ~connected_machine.models.CreatedByType + :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 """ diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py index b2ce759835f..a3ba7e9ea79 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py @@ -39,7 +39,7 @@ def _upgrade_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -93,7 +93,7 @@ def begin_upgrade_extensions( :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: ~connected_machine.models.MachineExtensionUpgrade + :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 diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py index 77b77d6226d..63bc7c881c3 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py @@ -32,7 +32,7 @@ class MachineExtensionsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -124,7 +124,7 @@ def begin_create_or_update( :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: ~connected_machine.models.MachineExtension + :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 @@ -132,7 +132,7 @@ def begin_create_or_update( :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[~connected_machine.models.MachineExtension] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -197,7 +197,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -260,7 +260,7 @@ def begin_update( :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: ~connected_machine.models.MachineExtensionUpdate + :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 @@ -268,7 +268,7 @@ def begin_update( :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[~connected_machine.models.MachineExtension] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -332,7 +332,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -455,7 +455,7 @@ def get( :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: ~connected_machine.models.MachineExtension + :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] @@ -463,7 +463,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -519,7 +519,7 @@ def list( :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[~connected_machine.models.MachineExtensionsListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineExtensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] @@ -527,7 +527,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machines_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machines_operations.py index 74f0dd7cd4f..2c809786d69 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machines_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_machines_operations.py @@ -30,7 +30,7 @@ class MachinesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,201 +45,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def list_access_details( - self, - resource_group_name, # type: str - machine_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> str - """The operation to create or update a hybrid machine resource 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: str, or the result of cls(response) - :rtype: str - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[str] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" - accept = "application/json" - - # Construct URL - url = self.list_access_details.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.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 501, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return response.status_code, cls(pipeline_response, deserialized, {}) - - return response.status_code, deserialized - list_access_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/listAccessDetails'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - machine_name, # type: str - parameters, # type: "models.Machine" - **kwargs # type: Any - ): - # type: (...) -> "models.Machine" - """The operation to create or update a hybrid machine resource 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 - :param parameters: Parameters supplied to the Create hybrid machine operation. - :type parameters: ~connected_machine.models.Machine - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Machine, or the result of cls(response) - :rtype: ~connected_machine.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 = "2021-06-10-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - '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(parameters, 'Machine') - 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]: - 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 - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - machine_name, # type: str - parameters, # type: "models.MachineUpdate" - **kwargs # type: Any - ): - # type: (...) -> "models.Machine" - """The operation to update 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 parameters: Parameters supplied to the Update hybrid machine operation. - :type parameters: ~connected_machine.models.MachineUpdate - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Machine, or the result of cls(response) - :rtype: ~connected_machine.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 = "2021-06-10-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - '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(parameters, 'MachineUpdate') - 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('Machine', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore - def delete( self, resource_group_name, # type: str @@ -263,7 +68,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -312,10 +117,10 @@ def get( :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 ~connected_machine.models.InstanceViewTypes + :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: ~connected_machine.models.Machine + :rtype: ~azure.mgmt.hybridcompute.models.Machine :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] @@ -323,7 +128,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -375,7 +180,7 @@ def list_by_resource_group( :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[~connected_machine.models.MachineListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] @@ -383,7 +188,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -445,7 +250,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MachineListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.MachineListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] @@ -453,7 +258,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_operations.py index f3bfcef08e4..d5605a36454 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_operations.py @@ -30,7 +30,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ def list( :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[~connected_machine.models.OperationListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py index b9bf818d4bc..48c2e530400 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py @@ -32,7 +32,7 @@ class PrivateEndpointConnectionsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,7 +65,7 @@ def get( :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: ~connected_machine.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] @@ -73,7 +73,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -111,7 +111,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - def _create_or_update_initial( + def _update_initial( self, resource_group_name, # type: str scope_name, # type: str @@ -125,12 +125,12 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore + 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), @@ -168,9 +168,9 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - def begin_create_or_update( + def begin_update( self, resource_group_name, # type: str scope_name, # type: str @@ -188,7 +188,7 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. :type private_endpoint_connection_name: str :param parameters: - :type parameters: ~connected_machine.models.PrivateEndpointConnection + :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 @@ -196,7 +196,7 @@ def begin_create_or_update( :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[~connected_machine.models.PrivateEndpointConnection] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -207,7 +207,7 @@ def begin_create_or_update( ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -245,7 +245,7 @@ def get_long_running_output(pipeline_response): ) 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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def _delete_initial( self, @@ -260,7 +260,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -380,7 +380,7 @@ def list_by_private_link_scope( :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[~connected_machine.models.PrivateEndpointConnectionListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] @@ -388,7 +388,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py index 8bc4b5ff49e..07efc46cf79 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py @@ -30,7 +30,7 @@ class PrivateLinkResourcesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_private_link_scope( :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[~connected_machine.models.PrivateLinkResourceListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] @@ -68,7 +68,7 @@ def list_by_private_link_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -139,7 +139,7 @@ def get( :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: ~connected_machine.models.PrivateLinkResource + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] @@ -147,7 +147,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py index c0e63eaeeee..547e69394c8 100644 --- a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py @@ -32,7 +32,7 @@ class PrivateLinkScopesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~connected_machine.models + :type models: ~azure.mgmt.hybridcompute.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ def list( :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[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -127,7 +127,7 @@ def list_by_resource_group( :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[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] @@ -135,7 +135,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -199,7 +199,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -313,7 +313,7 @@ def get( :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: ~connected_machine.models.HybridComputePrivateLinkScope + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] @@ -321,7 +321,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -375,10 +375,10 @@ def create_or_update( :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: ~connected_machine.models.HybridComputePrivateLinkScope + :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: ~connected_machine.models.HybridComputePrivateLinkScope + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] @@ -386,7 +386,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -449,10 +449,10 @@ def update_tags( :type scope_name: str :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope instance. - :type private_link_scope_tags: ~connected_machine.models.TagsResource + :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: ~connected_machine.models.HybridComputePrivateLinkScope + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] @@ -460,7 +460,7 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -517,7 +517,7 @@ def get_validation_details( :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: ~connected_machine.models.PrivateLinkScopeValidationDetails + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] @@ -525,7 +525,7 @@ def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -578,7 +578,7 @@ def get_validation_details_for_machine( :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: ~connected_machine.models.PrivateLinkScopeValidationDetails + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkScopeValidationDetails :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] @@ -586,7 +586,7 @@ def get_validation_details_for_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-10-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/src/ssh/azext_ssh/vendored_sdks/connectedmachine/setup.py b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/setup.py new file mode 100644 index 00000000000..f0a42bc98f8 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/connectedmachine/setup.py @@ -0,0 +1,37 @@ +# 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. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "azure-mgmt-hybridcompute" +VERSION = "1.0.0b1" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.18", "azure-core<2.0.0,>=1.8.2", "azure-mgmt-core<2.0.0,>=1.2.1"] + +setup( + name=NAME, + version=VERSION, + description="azure-mgmt-hybridcompute", + author_email="", + url="", + keywords=["Swagger", "ConnectedMachine"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + The Hybrid Compute Management Client. + """ +) diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/__init__.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/__init__.py new file mode 100644 index 00000000000..9d5f8048ff1 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/__init__.py @@ -0,0 +1,16 @@ +# 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 ._hybrid_connectivity_management_api import HybridConnectivityManagementAPI +__all__ = ['HybridConnectivityManagementAPI'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/_configuration.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/_configuration.py new file mode 100644 index 00000000000..3d6b6c94096 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/_configuration.py @@ -0,0 +1,68 @@ +# 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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class HybridConnectivityManagementAPIConfiguration(Configuration): + """Configuration for HybridConnectivityManagementAPI. + + 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 + """ + + 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(HybridConnectivityManagementAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-10-06-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'hybridconnectivitymanagementapi/{}'.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/ssh/azext_ssh/vendored_sdks/hybridconnectivity/_hybrid_connectivity_management_api.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/_hybrid_connectivity_management_api.py new file mode 100644 index 00000000000..7b1c37cd7ea --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/_hybrid_connectivity_management_api.py @@ -0,0 +1,71 @@ +# 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 HybridConnectivityManagementAPIConfiguration +from .operations import Operations +from .operations import EndpointsOperations +from . import models + + +class HybridConnectivityManagementAPI(object): + """REST API for Hybrid Connectivity. + + :ivar operations: Operations operations + :vartype operations: hybrid_connectivity_management_api.operations.Operations + :ivar endpoints: EndpointsOperations operations + :vartype endpoints: hybrid_connectivity_management_api.operations.EndpointsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = HybridConnectivityManagementAPIConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.endpoints = EndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> HybridConnectivityManagementAPI + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/__init__.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/__init__.py new file mode 100644 index 00000000000..785b5445cc3 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._hybrid_connectivity_management_api import HybridConnectivityManagementAPI +__all__ = ['HybridConnectivityManagementAPI'] diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/_configuration.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/_configuration.py new file mode 100644 index 00000000000..41f28de96ba --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class HybridConnectivityManagementAPIConfiguration(Configuration): + """Configuration for HybridConnectivityManagementAPI. + + 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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(HybridConnectivityManagementAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.api_version = "2021-10-06-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'hybridconnectivitymanagementapi/{}'.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/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/_hybrid_connectivity_management_api.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/_hybrid_connectivity_management_api.py new file mode 100644 index 00000000000..837237055a5 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/_hybrid_connectivity_management_api.py @@ -0,0 +1,64 @@ +# 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 HybridConnectivityManagementAPIConfiguration +from .operations import Operations +from .operations import EndpointsOperations +from .. import models + + +class HybridConnectivityManagementAPI(object): + """REST API for Hybrid Connectivity. + + :ivar operations: Operations operations + :vartype operations: hybrid_connectivity_management_api.aio.operations.Operations + :ivar endpoints: EndpointsOperations operations + :vartype endpoints: hybrid_connectivity_management_api.aio.operations.EndpointsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = HybridConnectivityManagementAPIConfiguration(credential, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.endpoints = EndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "HybridConnectivityManagementAPI": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/__init__.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/__init__.py new file mode 100644 index 00000000000..d9149323f40 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._endpoints_operations import EndpointsOperations + +__all__ = [ + 'Operations', + 'EndpointsOperations', +] diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_endpoints_operations.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_endpoints_operations.py new file mode 100644 index 00000000000..16f77d06ff6 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_endpoints_operations.py @@ -0,0 +1,426 @@ +# 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 EndpointsOperations: + """EndpointsOperations 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: ~hybrid_connectivity_management_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_uri: str, + **kwargs + ) -> AsyncIterable["models.EndpointsList"]: + """List of endpoints to the target resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EndpointsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~hybrid_connectivity_management_api.models.EndpointsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-10-06-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + } + 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('EndpointsList', 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': '/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints'} # type: ignore + + async def get( + self, + resource_uri: str, + endpoint_name: str, + **kwargs + ) -> "models.EndpointResource": + """Gets the endpoint to the resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :param endpoint_name: The endpoint name. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EndpointResource, or the result of cls(response) + :rtype: ~hybrid_connectivity_management_api.models.EndpointResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-10-06-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str', skip_quote=True), + } + 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('EndpointResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}'} # type: ignore + + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: "models.EndpointResource", + **kwargs + ) -> "models.EndpointResource": + """Create or update the endpoint to the target resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :param endpoint_name: The endpoint name. + :type endpoint_name: str + :param endpoint_resource: Endpoint details. + :type endpoint_resource: ~hybrid_connectivity_management_api.models.EndpointResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EndpointResource, or the result of cls(response) + :rtype: ~hybrid_connectivity_management_api.models.EndpointResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-10-06-preview" + 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 = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str', skip_quote=True), + } + 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(endpoint_resource, 'EndpointResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EndpointResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}'} # type: ignore + + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: "models.EndpointResource", + **kwargs + ) -> "models.EndpointResource": + """Update the endpoint to the target resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :param endpoint_name: The endpoint name. + :type endpoint_name: str + :param endpoint_resource: Endpoint details. + :type endpoint_resource: ~hybrid_connectivity_management_api.models.EndpointResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EndpointResource, or the result of cls(response) + :rtype: ~hybrid_connectivity_management_api.models.EndpointResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-10-06-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str', skip_quote=True), + } + 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(endpoint_resource, 'EndpointResource') + 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('EndpointResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}'} # type: ignore + + async def delete( + self, + resource_uri: str, + endpoint_name: str, + **kwargs + ) -> None: + """Deletes the endpoint access to the target resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :param endpoint_name: The endpoint name. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-10-06-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str', skip_quote=True), + } + 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': '/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}'} # type: ignore + + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + expiresin: Optional[int] = 10800, + **kwargs + ) -> "models.EndpointAccessResource": + """Gets the endpoint access credentials to the resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :param endpoint_name: The endpoint name. + :type endpoint_name: str + :param expiresin: The is how long the endpoint access token is valid (in seconds). + :type expiresin: long + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EndpointAccessResource, or the result of cls(response) + :rtype: ~hybrid_connectivity_management_api.models.EndpointAccessResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointAccessResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-10-06-preview" + accept = "application/json" + + # Construct URL + url = self.list_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str', skip_quote=True), + } + 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 expiresin is not None: + query_parameters['expiresin'] = self._serialize.query("expiresin", expiresin, 'long', maximum=10800, minimum=600) + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EndpointAccessResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_credentials.metadata = {'url': '/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listCredentials'} # type: ignore diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_operations.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_operations.py new file mode 100644 index 00000000000..e06178d99d0 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# 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: ~hybrid_connectivity_management_api.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"]: + """Lists the available Hybrid Connectivity REST API 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[~hybrid_connectivity_management_api.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 = "2021-10-06-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.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 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': '/providers/Microsoft.HybridConnectivity/operations'} # type: ignore diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/__init__.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/__init__.py new file mode 100644 index 00000000000..a60914d57d3 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/__init__.py @@ -0,0 +1,57 @@ +# 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 EndpointAccessResource + from ._models_py3 import EndpointResource + from ._models_py3 import EndpointsList + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import ProxyResource + from ._models_py3 import Resource +except (SyntaxError, ImportError): + from ._models import EndpointAccessResource # type: ignore + from ._models import EndpointResource # type: ignore + from ._models import EndpointsList # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + +from ._hybrid_connectivity_management_api_enums import ( + ActionType, + CreatedByType, + Origin, + Type, +) + +__all__ = [ + 'EndpointAccessResource', + 'EndpointResource', + 'EndpointsList', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'ProxyResource', + 'Resource', + 'ActionType', + 'CreatedByType', + 'Origin', + 'Type', +] diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_hybrid_connectivity_management_api_enums.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_hybrid_connectivity_management_api_enums.py new file mode 100644 index 00000000000..fa857d49db8 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_hybrid_connectivity_management_api_enums.py @@ -0,0 +1,58 @@ +# 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 ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + """ + + INTERNAL = "Internal" + +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 Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system" + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" + +class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of endpoint. + """ + + DEFAULT = "default" + CUSTOM = "custom" diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_models.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_models.py new file mode 100644 index 00000000000..1dd6479ee07 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_models.py @@ -0,0 +1,438 @@ +# 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 EndpointAccessResource(msrest.serialization.Model): + """The endpoint access for the target resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param namespace_name: The namespace name. + :type namespace_name: str + :param namespace_name_suffix: The suffix domain name of relay namespace. + :type namespace_name_suffix: str + :param hybrid_connection_name: Azure Relay hybrid connection name for the resource. + :type hybrid_connection_name: str + :ivar access_key: Access key for hybrid connection. + :vartype access_key: str + :param expires_on: The expiration of access key in unix time. + :type expires_on: long + """ + + _validation = { + 'namespace_name': {'max_length': 200, 'min_length': 1}, + 'namespace_name_suffix': {'max_length': 100, 'min_length': 1}, + 'access_key': {'readonly': True}, + } + + _attribute_map = { + 'namespace_name': {'key': 'relay.namespaceName', 'type': 'str'}, + 'namespace_name_suffix': {'key': 'relay.namespaceNameSuffix', 'type': 'str'}, + 'hybrid_connection_name': {'key': 'relay.hybridConnectionName', 'type': 'str'}, + 'access_key': {'key': 'relay.accessKey', 'type': 'str'}, + 'expires_on': {'key': 'relay.expiresOn', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointAccessResource, self).__init__(**kwargs) + self.namespace_name = kwargs.get('namespace_name', None) + self.namespace_name_suffix = kwargs.get('namespace_name_suffix', None) + self.hybrid_connection_name = kwargs.get('hybrid_connection_name', None) + self.access_key = None + self.expires_on = kwargs.get('expires_on', 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 EndpointResource(Resource): + """The endpoint for the target 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 type_properties_type: The type of endpoint. Possible values include: "default", + "custom". + :type type_properties_type: str or ~hybrid_connectivity_management_api.models.Type + :param resource_id: The resource Id of the connectivity endpoint (optional). + :type resource_id: str + :ivar provisioning_state: + :vartype provisioning_state: str + :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 ~hybrid_connectivity_management_api.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 ~hybrid_connectivity_management_api.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, + 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'systemData.lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'systemData.lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'systemData.lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointResource, self).__init__(**kwargs) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.resource_id = kwargs.get('resource_id', None) + self.provisioning_state = None + 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 EndpointsList(msrest.serialization.Model): + """The list of endpoints. + + :param next_link: The link used to get the next page of endpoints list. + :type next_link: str + :param value: The list of endpoint. + :type value: list[~hybrid_connectivity_management_api.models.EndpointResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[EndpointResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointsList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', 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[~hybrid_connectivity_management_api.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~hybrid_connectivity_management_api.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: ~hybrid_connectivity_management_api.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 Operation(msrest.serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data- + plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular operation. + :type display: ~hybrid_connectivity_management_api.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", + "system", "user,system". + :vartype origin: str or ~hybrid_connectivity_management_api.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. Possible values include: "Internal". + :vartype action_type: str or ~hybrid_connectivity_management_api.models.ActionType + """ + + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = kwargs.get('display', None) + self.origin = None + self.action_type = None + + +class OperationDisplay(msrest.serialization.Model): + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(msrest.serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~hybrid_connectivity_management_api.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = 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) diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_models_py3.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_models_py3.py new file mode 100644 index 00000000000..97400905724 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/models/_models_py3.py @@ -0,0 +1,464 @@ +# 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 List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._hybrid_connectivity_management_api_enums import * + + +class EndpointAccessResource(msrest.serialization.Model): + """The endpoint access for the target resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param namespace_name: The namespace name. + :type namespace_name: str + :param namespace_name_suffix: The suffix domain name of relay namespace. + :type namespace_name_suffix: str + :param hybrid_connection_name: Azure Relay hybrid connection name for the resource. + :type hybrid_connection_name: str + :ivar access_key: Access key for hybrid connection. + :vartype access_key: str + :param expires_on: The expiration of access key in unix time. + :type expires_on: long + """ + + _validation = { + 'namespace_name': {'max_length': 200, 'min_length': 1}, + 'namespace_name_suffix': {'max_length': 100, 'min_length': 1}, + 'access_key': {'readonly': True}, + } + + _attribute_map = { + 'namespace_name': {'key': 'relay.namespaceName', 'type': 'str'}, + 'namespace_name_suffix': {'key': 'relay.namespaceNameSuffix', 'type': 'str'}, + 'hybrid_connection_name': {'key': 'relay.hybridConnectionName', 'type': 'str'}, + 'access_key': {'key': 'relay.accessKey', 'type': 'str'}, + 'expires_on': {'key': 'relay.expiresOn', 'type': 'long'}, + } + + def __init__( + self, + *, + namespace_name: Optional[str] = None, + namespace_name_suffix: Optional[str] = None, + hybrid_connection_name: Optional[str] = None, + expires_on: Optional[int] = None, + **kwargs + ): + super(EndpointAccessResource, self).__init__(**kwargs) + self.namespace_name = namespace_name + self.namespace_name_suffix = namespace_name_suffix + self.hybrid_connection_name = hybrid_connection_name + self.access_key = None + self.expires_on = expires_on + + +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 EndpointResource(Resource): + """The endpoint for the target 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 type_properties_type: The type of endpoint. Possible values include: "default", + "custom". + :type type_properties_type: str or ~hybrid_connectivity_management_api.models.Type + :param resource_id: The resource Id of the connectivity endpoint (optional). + :type resource_id: str + :ivar provisioning_state: + :vartype provisioning_state: str + :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 ~hybrid_connectivity_management_api.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 ~hybrid_connectivity_management_api.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, + 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'systemData.lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'systemData.lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'systemData.lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + type_properties_type: Optional[Union[str, "Type"]] = None, + resource_id: Optional[str] = None, + 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(EndpointResource, self).__init__(**kwargs) + self.type_properties_type = type_properties_type + self.resource_id = resource_id + self.provisioning_state = None + 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 EndpointsList(msrest.serialization.Model): + """The list of endpoints. + + :param next_link: The link used to get the next page of endpoints list. + :type next_link: str + :param value: The list of endpoint. + :type value: list[~hybrid_connectivity_management_api.models.EndpointResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[EndpointResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["EndpointResource"]] = None, + **kwargs + ): + super(EndpointsList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +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[~hybrid_connectivity_management_api.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~hybrid_connectivity_management_api.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: ~hybrid_connectivity_management_api.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 Operation(msrest.serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data- + plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular operation. + :type display: ~hybrid_connectivity_management_api.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", + "system", "user,system". + :vartype origin: str or ~hybrid_connectivity_management_api.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. Possible values include: "Internal". + :vartype action_type: str or ~hybrid_connectivity_management_api.models.ActionType + """ + + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None + + +class OperationDisplay(msrest.serialization.Model): + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(msrest.serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~hybrid_connectivity_management_api.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = 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) diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/__init__.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/__init__.py new file mode 100644 index 00000000000..d9149323f40 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._endpoints_operations import EndpointsOperations + +__all__ = [ + 'Operations', + 'EndpointsOperations', +] diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/_endpoints_operations.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/_endpoints_operations.py new file mode 100644 index 00000000000..b29bf835c13 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/_endpoints_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +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 EndpointsOperations(object): + """EndpointsOperations 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: ~hybrid_connectivity_management_api.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_credentials( + self, + resource_group_name, # type: str + machine_name, # type: str + endpoint_name, # type: str + expiresin=10800, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.EndpointAccessResource" + """Gets the endpoint access credentials to the resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to + be connected. + :type resource_uri: str + :param endpoint_name: The endpoint name. + :type endpoint_name: str + :param expiresin: The is how long the endpoint access token is valid (in seconds). + :type expiresin: long + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EndpointAccessResource, or the result of cls(response) + :rtype: ~hybrid_connectivity_management_api.models.EndpointAccessResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointAccessResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + # api_version = "2021-10-06-preview" + # api_version = "2021-10-01-privatepreview" + api_version = "2021-07-08-privatepreview" + accept = "application/json" + + # Construct URL + url = self.list_credentials.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'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str', skip_quote=True), + } + 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 expiresin is not None: + query_parameters['expiresin'] = self._serialize.query("expiresin", expiresin, 'long', maximum=10800, minimum=600) + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EndpointAccessResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listCredentials'} # type: ignore diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/_operations.py b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/_operations.py new file mode 100644 index 00000000000..02d52e6a4f6 --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/operations/_operations.py @@ -0,0 +1,110 @@ +# 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: ~hybrid_connectivity_management_api.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"] + """Lists the available Hybrid Connectivity REST API 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[~hybrid_connectivity_management_api.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 = "2021-10-06-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.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 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': '/providers/Microsoft.HybridConnectivity/operations'} # type: ignore diff --git a/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/py.typed b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/ssh/setup.py b/src/ssh/setup.py index 1615ce2dde6..860e04cb9b8 100644 --- a/src/ssh/setup.py +++ b/src/ssh/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages -VERSION = "0.1.9" +VERSION = "0.2.1" CLASSIFIERS = [ 'Development Status :: 4 - Beta',