From 6e5399b4b05798ea316ef02680ccd3fbb99efdb3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 19 May 2021 20:33:41 +0000 Subject: [PATCH] CodeGen from PR 14486 in Azure/azure-rest-api-specs Merge 363ecb5cf482aa09f1479556eebaa877f4b9aa28 into 689766ce89ed3776328e34bde7ddba9ee257cf6d --- .../azure-mgmt-hybridcompute/_meta.json | 11 +- .../mgmt/hybridcompute/_configuration.py | 2 +- .../_hybrid_compute_management_client.py | 3 +- .../azure/mgmt/hybridcompute/_metadata.json | 38 ++++- .../azure/mgmt/hybridcompute/_version.py | 2 +- .../mgmt/hybridcompute/aio/_configuration.py | 2 +- .../aio/_hybrid_compute_management_client.py | 3 +- .../hybridcompute/aio/operations/__init__.py | 2 + ...id_compute_management_client_operations.py | 142 +++++++++++++++++ .../_machine_extensions_operations.py | 38 ++--- .../aio/operations/_machines_operations.py | 16 +- .../aio/operations/_operations.py | 4 +- ...private_endpoint_connections_operations.py | 28 ++-- .../_private_link_resources_operations.py | 8 +- .../_private_link_scopes_operations.py | 38 ++--- .../mgmt/hybridcompute/models/__init__.py | 6 + .../mgmt/hybridcompute/models/_models.py | 48 +++++- .../mgmt/hybridcompute/models/_models_py3.py | 62 ++++++-- .../mgmt/hybridcompute/operations/__init__.py | 2 + ...id_compute_management_client_operations.py | 148 ++++++++++++++++++ .../_machine_extensions_operations.py | 22 +-- .../operations/_machines_operations.py | 8 +- .../hybridcompute/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 16 +- .../_private_link_resources_operations.py | 4 +- .../_private_link_scopes_operations.py | 20 +-- 26 files changed, 545 insertions(+), 130 deletions(-) create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json index db826fa54add..e560bf4d9a82 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.3.0", - "use": "@autorest/python@5.6.6", - "commit": "a3a99cb1a7fac19acb046b4920fce6945dc7e8a2", + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.0", + "@autorest/modelerfour@4.19.1" + ], + "commit": "671cf4ec2d3942b6830db0b558fccea0042fc77a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0", + "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2", "readme": "specification/hybridcompute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py index 82da0fb7f0c1..e980ceff12f8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-25-preview" + self.api_version = "2021-05-20" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py index 58cea5eab691..f87cfe7c613a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py @@ -21,6 +21,7 @@ from ._configuration import HybridComputeManagementClientConfiguration from .operations import MachinesOperations from .operations import MachineExtensionsOperations +from .operations import HybridComputeManagementClientOperationsMixin from .operations import Operations from .operations import PrivateLinkScopesOperations from .operations import PrivateLinkResourcesOperations @@ -28,7 +29,7 @@ from . import models -class HybridComputeManagementClient(object): +class HybridComputeManagementClient(HybridComputeManagementClientOperationsMixin): """The Hybrid Compute Management Client. :ivar machines: MachinesOperations operations diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_metadata.json b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_metadata.json index a62da80bda41..06e91fdbfd92 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_metadata.json +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-03-25-preview", - "total_api_version_list": ["2021-03-25-preview"], + "chosen_version": "2021-05-20", + "total_api_version_list": ["2021-05-20"], "client": { "name": "HybridComputeManagementClient", "filename": "_hybrid_compute_management_client", @@ -10,8 +10,8 @@ "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"HybridComputeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"HybridComputeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"HybridComputeManagementClientConfiguration\"], \"._operations_mixin\": [\"HybridComputeManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"HybridComputeManagementClientConfiguration\"], \"._operations_mixin\": [\"HybridComputeManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -104,5 +104,35 @@ "private_link_scopes": "PrivateLinkScopesOperations", "private_link_resources": "PrivateLinkResourcesOperations", "private_endpoint_connections": "PrivateEndpointConnectionsOperations" + }, + "operation_mixins": { + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.mgmt.core.polling.arm_polling\": [\"ARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.mgmt.core.polling.async_arm_polling\": [\"AsyncARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "_upgrade_extensions_initial" : { + "sync": { + "signature": "def _upgrade_extensions_initial(\n self,\n resource_group_name, # type: str\n machine_name, # type: str\n extension_upgrade_parameters, # type: \"_models.MachineExtensionUpgrade\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param machine_name: The name of the hybrid machine.\n:type machine_name: str\n:param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation.\n:type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _upgrade_extensions_initial(\n self,\n resource_group_name: str,\n machine_name: str,\n extension_upgrade_parameters: \"_models.MachineExtensionUpgrade\",\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param machine_name: The name of the hybrid machine.\n:type machine_name: str\n:param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation.\n:type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, machine_name, extension_upgrade_parameters" + }, + "begin_upgrade_extensions" : { + "sync": { + "signature": "def begin_upgrade_extensions(\n self,\n resource_group_name, # type: str\n machine_name, # type: str\n extension_upgrade_parameters, # type: \"_models.MachineExtensionUpgrade\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"The operation to Upgrade Machine Extensions.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param machine_name: The name of the hybrid machine.\n:type machine_name: str\n:param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation.\n:type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_upgrade_extensions(\n self,\n resource_group_name: str,\n machine_name: str,\n extension_upgrade_parameters: \"_models.MachineExtensionUpgrade\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"The operation to Upgrade Machine Extensions.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param machine_name: The name of the hybrid machine.\n:type machine_name: str\n:param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation.\n:type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "resource_group_name, machine_name, extension_upgrade_parameters" + } + } } } \ No newline at end of file diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py index 364f3c906cf9..e5754a47ce68 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py index 80d85a139884..5503cbfa512e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-25-preview" + self.api_version = "2021-05-20" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-hybridcompute/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py index 7171b140384d..f901354845cc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py @@ -19,6 +19,7 @@ from ._configuration import HybridComputeManagementClientConfiguration from .operations import MachinesOperations from .operations import MachineExtensionsOperations +from .operations import HybridComputeManagementClientOperationsMixin from .operations import Operations from .operations import PrivateLinkScopesOperations from .operations import PrivateLinkResourcesOperations @@ -26,7 +27,7 @@ from .. import models -class HybridComputeManagementClient(object): +class HybridComputeManagementClient(HybridComputeManagementClientOperationsMixin): """The Hybrid Compute Management Client. :ivar machines: MachinesOperations operations diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py index 0459441055d9..f77aada04882 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py @@ -8,6 +8,7 @@ from ._machines_operations import MachinesOperations from ._machine_extensions_operations import MachineExtensionsOperations +from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin from ._operations import Operations from ._private_link_scopes_operations import PrivateLinkScopesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -16,6 +17,7 @@ __all__ = [ 'MachinesOperations', 'MachineExtensionsOperations', + 'HybridComputeManagementClientOperationsMixin', 'Operations', 'PrivateLinkScopesOperations', 'PrivateLinkResourcesOperations', diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py new file mode 100644 index 000000000000..9aafe9d44057 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py @@ -0,0 +1,142 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HybridComputeManagementClientOperationsMixin: + + async def _upgrade_extensions_initial( + self, + resource_group_name: str, + machine_name: str, + extension_upgrade_parameters: "_models.MachineExtensionUpgrade", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._upgrade_extensions_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_upgrade_parameters, 'MachineExtensionUpgrade') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _upgrade_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore + + async def begin_upgrade_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_upgrade_parameters: "_models.MachineExtensionUpgrade", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to Upgrade Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + :type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._upgrade_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extension_upgrade_parameters=extension_upgrade_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py index f52cebfc5b7f..54bef88b0286 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py @@ -49,14 +49,14 @@ async def _create_or_update_initial( machine_name: str, extension_name: str, extension_parameters: "_models.MachineExtension", - **kwargs + **kwargs: Any ) -> Optional["_models.MachineExtension"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MachineExtension"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -107,7 +107,7 @@ async def begin_create_or_update( machine_name: str, extension_name: str, extension_parameters: "_models.MachineExtension", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.MachineExtension"]: """The operation to create or update the extension. @@ -121,8 +121,8 @@ async def begin_create_or_update( :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: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) @@ -183,14 +183,14 @@ async def _update_initial( machine_name: str, extension_name: str, extension_parameters: "_models.MachineExtensionUpdate", - **kwargs + **kwargs: Any ) -> Optional["_models.MachineExtension"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MachineExtension"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -241,7 +241,7 @@ async def begin_update( machine_name: str, extension_name: str, extension_parameters: "_models.MachineExtensionUpdate", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.MachineExtension"]: """The operation to create or update the extension. @@ -255,8 +255,8 @@ async def begin_update( :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: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) @@ -316,14 +316,14 @@ async def _delete_initial( resource_group_name: str, machine_name: str, extension_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -363,7 +363,7 @@ async def begin_delete( resource_group_name: str, machine_name: str, extension_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """The operation to delete the extension. @@ -375,8 +375,8 @@ async def begin_delete( :type extension_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -432,7 +432,7 @@ async def get( resource_group_name: str, machine_name: str, extension_name: str, - **kwargs + **kwargs: Any ) -> "_models.MachineExtension": """The operation to get the extension. @@ -452,7 +452,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -495,7 +495,7 @@ def list( resource_group_name: str, machine_name: str, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MachineExtensionsListResult"]: """The operation to get all extensions of a non-Azure machine. @@ -515,7 +515,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py index ab8b801428b7..5d16cb1b780e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py @@ -45,7 +45,7 @@ async def delete( self, resource_group_name: str, machine_name: str, - **kwargs + **kwargs: Any ) -> None: """The operation to remove a hybrid machine identity in Azure. @@ -63,7 +63,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -102,7 +102,7 @@ async def get( resource_group_name: str, machine_name: str, expand: Optional[Union[str, "_models.InstanceViewTypes"]] = None, - **kwargs + **kwargs: Any ) -> "_models.Machine": """Retrieves information about the model view or the instance view of a hybrid machine. @@ -122,7 +122,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -164,7 +164,7 @@ async def get( def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MachineListResult"]: """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. @@ -181,7 +181,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -235,7 +235,7 @@ async def get_next(next_link=None): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MachineListResult"]: """Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. @@ -250,7 +250,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py index 6538f4d5f279..ef5db3df2553 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Gets a list of hybrid compute operations. @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py index 407544b50777..066b3c9056ad 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py @@ -48,7 +48,7 @@ async def get( resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets a private endpoint connection. @@ -68,7 +68,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -112,14 +112,14 @@ async def _create_or_update_initial( scope_name: str, private_endpoint_connection_name: str, parameters: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> Optional["_models.PrivateEndpointConnection"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -170,7 +170,7 @@ async def begin_create_or_update( scope_name: str, private_endpoint_connection_name: str, parameters: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Approve or reject a private endpoint connection with a given name. @@ -184,8 +184,8 @@ async def begin_create_or_update( :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: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -245,14 +245,14 @@ async def _delete_initial( resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -292,7 +292,7 @@ async def begin_delete( resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a private endpoint connection with a given name. @@ -304,8 +304,8 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -360,7 +360,7 @@ def list_by_private_link_scope( self, resource_group_name: str, scope_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private endpoint connections on a private link scope. @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py index f55ee660f3fd..d2712933e357 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py @@ -45,7 +45,7 @@ def list_by_private_link_scope( self, resource_group_name: str, scope_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -121,7 +121,7 @@ async def get( resource_group_name: str, scope_name: str, group_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResource": """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. @@ -141,7 +141,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py index bc6231f91be5..4b49d45a318a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.HybridComputePrivateLinkScopeListResult"]: """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -113,7 +113,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.HybridComputePrivateLinkScopeListResult"]: """Gets a list of Azure Arc PrivateLinkScopes within a resource group. @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -185,14 +185,14 @@ async def _delete_initial( self, resource_group_name: str, scope_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -230,7 +230,7 @@ async def begin_delete( self, resource_group_name: str, scope_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a Azure Arc PrivateLinkScope. @@ -240,8 +240,8 @@ async def begin_delete( :type scope_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -294,7 +294,7 @@ async def get( self, resource_group_name: str, scope_name: str, - **kwargs + **kwargs: Any ) -> "_models.HybridComputePrivateLinkScope": """Returns a Azure Arc PrivateLinkScope. @@ -312,7 +312,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -354,7 +354,7 @@ async def create_or_update( resource_group_name: str, scope_name: str, parameters: "_models.HybridComputePrivateLinkScope", - **kwargs + **kwargs: Any ) -> "_models.HybridComputePrivateLinkScope": """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. @@ -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-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -427,7 +427,7 @@ async def update_tags( resource_group_name: str, scope_name: str, private_link_scope_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.HybridComputePrivateLinkScope": """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. @@ -449,7 +449,7 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -495,7 +495,7 @@ async def get_validation_details( self, location: str, private_link_scope_id: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkScopeValidationDetails": """Returns a Azure Arc PrivateLinkScope's validation details. @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -554,7 +554,7 @@ async def get_validation_details_for_machine( self, resource_group_name: str, machine_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkScopeValidationDetails": """Returns a Azure Arc PrivateLinkScope's validation details for a given machine. @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py index 0c1697d950ed..c69361b552ad 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py @@ -11,6 +11,7 @@ from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import ExtensionTargetProperties from ._models_py3 import HybridComputePrivateLinkScope from ._models_py3 import HybridComputePrivateLinkScopeListResult from ._models_py3 import HybridComputePrivateLinkScopeProperties @@ -23,6 +24,7 @@ from ._models_py3 import MachineExtensionProperties from ._models_py3 import MachineExtensionUpdate from ._models_py3 import MachineExtensionUpdateProperties + from ._models_py3 import MachineExtensionUpgrade from ._models_py3 import MachineExtensionsListResult from ._models_py3 import MachineListResult from ._models_py3 import MachineProperties @@ -53,6 +55,7 @@ from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore + from ._models import ExtensionTargetProperties # type: ignore from ._models import HybridComputePrivateLinkScope # type: ignore from ._models import HybridComputePrivateLinkScopeListResult # type: ignore from ._models import HybridComputePrivateLinkScopeProperties # type: ignore @@ -65,6 +68,7 @@ from ._models import MachineExtensionProperties # type: ignore from ._models import MachineExtensionUpdate # type: ignore from ._models import MachineExtensionUpdateProperties # type: ignore + from ._models import MachineExtensionUpgrade # type: ignore from ._models import MachineExtensionsListResult # type: ignore from ._models import MachineListResult # type: ignore from ._models import MachineProperties # type: ignore @@ -104,6 +108,7 @@ 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', + 'ExtensionTargetProperties', 'HybridComputePrivateLinkScope', 'HybridComputePrivateLinkScopeListResult', 'HybridComputePrivateLinkScopeProperties', @@ -116,6 +121,7 @@ 'MachineExtensionProperties', 'MachineExtensionUpdate', 'MachineExtensionUpdateProperties', + 'MachineExtensionUpgrade', 'MachineExtensionsListResult', 'MachineListResult', 'MachineProperties', diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py index f6ff35982f58..b14e01209522 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py @@ -63,7 +63,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -149,6 +149,25 @@ def __init__( self.error = kwargs.get('error', None) +class ExtensionTargetProperties(msrest.serialization.Model): + """Describes the Machine Extension Target Version Properties. + + :param target_version: Properties for the specified Extension to Upgrade. + :type target_version: str + """ + + _attribute_map = { + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionTargetProperties, self).__init__(**kwargs) + self.target_version = kwargs.get('target_version', None) + + class PrivateLinkScopesResource(msrest.serialization.Model): """An azure resource object. @@ -661,10 +680,10 @@ class MachineExtensionProperties(msrest.serialization.Model): upgrade minor versions unless redeployed, even with this property set to true. :type auto_upgrade_minor_version: bool :param settings: Json formatted public settings for the extension. - :type settings: object + :type settings: any :param protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object + :type protected_settings: any :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :param instance_view: The machine extension instance view. @@ -785,10 +804,10 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): upgrade minor versions unless redeployed, even with this property set to true. :type auto_upgrade_minor_version: bool :param settings: Json formatted public settings for the extension. - :type settings: object + :type settings: any :param protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object + :type protected_settings: any """ _attribute_map = { @@ -815,6 +834,25 @@ def __init__( self.protected_settings = kwargs.get('protected_settings', None) +class MachineExtensionUpgrade(msrest.serialization.Model): + """Describes the Machine Extension Upgrade Properties. + + :param extension_targets: Describes the Extension Target Properties. + :type extension_targets: dict[str, ~azure.mgmt.hybridcompute.models.ExtensionTargetProperties] + """ + + _attribute_map = { + 'extension_targets': {'key': 'extensionTargets', 'type': '{ExtensionTargetProperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionUpgrade, self).__init__(**kwargs) + self.extension_targets = kwargs.get('extension_targets', None) + + class MachineListResult(msrest.serialization.Model): """The List hybrid machine operation response. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py index 67804dd2341b..f91ad63fd5e6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -68,7 +68,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -156,6 +156,27 @@ def __init__( self.error = error +class ExtensionTargetProperties(msrest.serialization.Model): + """Describes the Machine Extension Target Version Properties. + + :param target_version: Properties for the specified Extension to Upgrade. + :type target_version: str + """ + + _attribute_map = { + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + target_version: Optional[str] = None, + **kwargs + ): + super(ExtensionTargetProperties, self).__init__(**kwargs) + self.target_version = target_version + + class PrivateLinkScopesResource(msrest.serialization.Model): """An azure resource object. @@ -708,10 +729,10 @@ class MachineExtensionProperties(msrest.serialization.Model): upgrade minor versions unless redeployed, even with this property set to true. :type auto_upgrade_minor_version: bool :param settings: Json formatted public settings for the extension. - :type settings: object + :type settings: any :param protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object + :type protected_settings: any :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :param instance_view: The machine extension instance view. @@ -742,8 +763,8 @@ def __init__( type: Optional[str] = None, type_handler_version: Optional[str] = None, auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[object] = None, - protected_settings: Optional[object] = None, + settings: Optional[Any] = None, + protected_settings: Optional[Any] = None, instance_view: Optional["MachineExtensionInstanceView"] = None, **kwargs ): @@ -849,10 +870,10 @@ class MachineExtensionUpdateProperties(msrest.serialization.Model): upgrade minor versions unless redeployed, even with this property set to true. :type auto_upgrade_minor_version: bool :param settings: Json formatted public settings for the extension. - :type settings: object + :type settings: any :param protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - :type protected_settings: object + :type protected_settings: any """ _attribute_map = { @@ -873,8 +894,8 @@ def __init__( type: Optional[str] = None, type_handler_version: Optional[str] = None, auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[object] = None, - protected_settings: Optional[object] = None, + settings: Optional[Any] = None, + protected_settings: Optional[Any] = None, **kwargs ): super(MachineExtensionUpdateProperties, self).__init__(**kwargs) @@ -887,6 +908,27 @@ def __init__( self.protected_settings = protected_settings +class MachineExtensionUpgrade(msrest.serialization.Model): + """Describes the Machine Extension Upgrade Properties. + + :param extension_targets: Describes the Extension Target Properties. + :type extension_targets: dict[str, ~azure.mgmt.hybridcompute.models.ExtensionTargetProperties] + """ + + _attribute_map = { + 'extension_targets': {'key': 'extensionTargets', 'type': '{ExtensionTargetProperties}'}, + } + + def __init__( + self, + *, + extension_targets: Optional[Dict[str, "ExtensionTargetProperties"]] = None, + **kwargs + ): + super(MachineExtensionUpgrade, self).__init__(**kwargs) + self.extension_targets = extension_targets + + class MachineListResult(msrest.serialization.Model): """The List hybrid machine operation response. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py index 0459441055d9..f77aada04882 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py @@ -8,6 +8,7 @@ from ._machines_operations import MachinesOperations from ._machine_extensions_operations import MachineExtensionsOperations +from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin from ._operations import Operations from ._private_link_scopes_operations import PrivateLinkScopesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -16,6 +17,7 @@ __all__ = [ 'MachinesOperations', 'MachineExtensionsOperations', + 'HybridComputeManagementClientOperationsMixin', 'Operations', 'PrivateLinkScopesOperations', 'PrivateLinkResourcesOperations', diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py new file mode 100644 index 000000000000..6634c9be06fb --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HybridComputeManagementClientOperationsMixin(object): + + def _upgrade_extensions_initial( + self, + resource_group_name, # type: str + machine_name, # type: str + extension_upgrade_parameters, # type: "_models.MachineExtensionUpgrade" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._upgrade_extensions_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_upgrade_parameters, 'MachineExtensionUpgrade') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _upgrade_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore + + def begin_upgrade_extensions( + self, + resource_group_name, # type: str + machine_name, # type: str + extension_upgrade_parameters, # type: "_models.MachineExtensionUpgrade" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to Upgrade Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + :type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._upgrade_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extension_upgrade_parameters=extension_upgrade_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py index ce6b02db7ed6..020cfccf38c4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py @@ -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-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -127,8 +127,8 @@ def begin_create_or_update( :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: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) @@ -197,7 +197,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -263,8 +263,8 @@ def begin_update( :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: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) @@ -332,7 +332,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -385,8 +385,8 @@ def begin_delete( :type extension_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -463,7 +463,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -527,7 +527,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py index 82afee18fc09..a903b82e01bb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py @@ -68,7 +68,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -128,7 +128,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -188,7 +188,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -258,7 +258,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py index 5968af873a33..2b989539cadb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py index 27ad1dc31b52..69f29ac889b2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py @@ -73,7 +73,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -125,7 +125,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -191,8 +191,8 @@ def begin_create_or_update( :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: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -260,7 +260,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -313,8 +313,8 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py index 53554fc620ab..0f6d91357899 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -147,7 +147,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py index 39b8582eafb1..613f5641aee4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" def prepare_request(next_link=None): @@ -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-03-25-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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -248,8 +248,8 @@ def begin_delete( :type scope_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -321,7 +321,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -386,7 +386,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -460,7 +460,7 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -525,7 +525,7 @@ def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL @@ -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-03-25-preview" + api_version = "2021-05-20" accept = "application/json" # Construct URL