diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management.py index 9d6e9d76b9af..39895f567cf2 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management.py @@ -74,7 +74,6 @@ 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.batch_account = BatchAccountOperations( diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py index c5f339ec7859..ed8e7a23e834 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-09-01" + self.api_version = "2021-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-batch/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_metadata.json b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_metadata.json new file mode 100644 index 000000000000..48c70ba2589f --- /dev/null +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_metadata.json @@ -0,0 +1,69 @@ +{ + "chosen_version": "2021-01-01", + "total_api_version_list": ["2021-01-01"], + "client": { + "name": "BatchManagement", + "filename": "_batch_management", + "description": "BatchManagement.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "batch_account": "BatchAccountOperations", + "application_package": "ApplicationPackageOperations", + "application": "ApplicationOperations", + "location": "LocationOperations", + "operations": "Operations", + "certificate": "CertificateOperations", + "private_link_resource": "PrivateLinkResourceOperations", + "private_endpoint_connection": "PrivateEndpointConnectionOperations", + "pool": "PoolOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py index 5e2af93ed464..c23f64adb662 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "14.0.0" +VERSION = "14.0.0b1" diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management.py index 3f0f8a7442d0..d249e8776e1a 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management.py @@ -71,7 +71,6 @@ 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.batch_account = BatchAccountOperations( diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py index 54daed31e868..9796a92d8f37 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-09-01" + self.api_version = "2021-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-batch/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py index feb075df436f..9ecfd4a97cf0 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py @@ -69,7 +69,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -139,7 +139,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -198,7 +198,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -263,7 +263,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -330,7 +330,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py index 026b6253c956..0531798f35d2 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py @@ -74,7 +74,7 @@ async def activate( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -150,7 +150,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -224,7 +224,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -287,7 +287,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -353,7 +353,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py index ad4396a2cd0c..a365b66623bc 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py @@ -55,7 +55,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -165,7 +165,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -204,7 +204,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -256,7 +256,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -344,7 +344,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -380,7 +380,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -432,7 +432,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -501,7 +501,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -575,7 +575,7 @@ async def synchronize_auto_storage_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -633,7 +633,7 @@ async def regenerate_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -701,7 +701,7 @@ async def get_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py index fde1f96d2bee..b186aad4a97e 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py @@ -77,7 +77,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -135,7 +135,7 @@ async def get_next(next_link=None): ) list_by_batch_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates'} # type: ignore - async def _create_initial( + async def create( self, resource_group_name: str, account_name: str, @@ -145,17 +145,41 @@ async def _create_initial( if_none_match: Optional[str] = None, **kwargs ) -> "_models.Certificate": + """Creates a new certificate inside the specified account. + + :param resource_group_name: The name of the resource group that contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param certificate_name: The identifier for the certificate. This must be made up of algorithm + and thumbprint separated by a dash, and must match the certificate data in the request. For + example SHA1-a3d1c5. + :type certificate_name: str + :param parameters: Additional parameters for certificate creation. + :type parameters: ~azure.mgmt.batch.models.CertificateCreateOrUpdateParameters + :param if_match: The entity state (ETag) version of the certificate to update. A value of "*" + can be used to apply the operation only if the certificate already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param if_none_match: Set to '*' to allow a new certificate to be created, but to prevent + updating an existing certificate. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.batch.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self._create_initial.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), @@ -196,99 +220,7 @@ async def _create_initial( return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}'} # type: ignore - - async def begin_create( - self, - resource_group_name: str, - account_name: str, - certificate_name: str, - parameters: "_models.CertificateCreateOrUpdateParameters", - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["_models.Certificate"]: - """Creates a new certificate inside the specified account. - - :param resource_group_name: The name of the resource group that contains the Batch account. - :type resource_group_name: str - :param account_name: The name of the Batch account. - :type account_name: str - :param certificate_name: The identifier for the certificate. This must be made up of algorithm - and thumbprint separated by a dash, and must match the certificate data in the request. For - example SHA1-a3d1c5. - :type certificate_name: str - :param parameters: Additional parameters for certificate creation. - :type parameters: ~azure.mgmt.batch.models.CertificateCreateOrUpdateParameters - :param if_match: The entity state (ETag) version of the certificate to update. A value of "*" - can be used to apply the operation only if the certificate already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param if_none_match: Set to '*' to allow a new certificate to be created, but to prevent - updating an existing certificate. Other values will be ignored. - :type if_none_match: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Certificate or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.batch.models.Certificate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - certificate_name=certificate_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('Certificate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), - 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}'} # type: ignore async def update( self, @@ -324,7 +256,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -382,7 +314,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -478,7 +410,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -519,7 +451,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -592,7 +524,7 @@ async def cancel_deletion( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py index bc6d36e1e760..3ccf31f9e3a3 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py @@ -59,7 +59,7 @@ async def get_quotas( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -116,7 +116,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py index a467c001102d..fdf8f325da6d 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py index f713ff1895f6..f836c4dfe9fb 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py @@ -88,7 +88,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get_next(next_link=None): ) list_by_batch_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools'} # type: ignore - async def _create_initial( + async def create( self, resource_group_name: str, account_name: str, @@ -156,17 +156,39 @@ async def _create_initial( if_none_match: Optional[str] = None, **kwargs ) -> "_models.Pool": + """Creates a new pool inside the specified account. + + :param resource_group_name: The name of the resource group that contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param pool_name: The pool name. This must be unique within the account. + :type pool_name: str + :param parameters: Additional parameters for pool creation. + :type parameters: ~azure.mgmt.batch.models.Pool + :param if_match: The entity state (ETag) version of the pool to update. A value of "*" can be + used to apply the operation only if the pool already exists. If omitted, this operation will + always be applied. + :type if_match: str + :param if_none_match: Set to '*' to allow a new pool to be created, but to prevent updating an + existing pool. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Pool, or the result of cls(response) + :rtype: ~azure.mgmt.batch.models.Pool + :raises: ~azure.core.exceptions.HttpResponseError + """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Pool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self._create_initial.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), @@ -207,97 +229,7 @@ async def _create_initial( return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}'} # type: ignore - - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - parameters: "_models.Pool", - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["_models.Pool"]: - """Creates a new pool inside the specified account. - - :param resource_group_name: The name of the resource group that contains the Batch account. - :type resource_group_name: str - :param account_name: The name of the Batch account. - :type account_name: str - :param pool_name: The pool name. This must be unique within the account. - :type pool_name: str - :param parameters: Additional parameters for pool creation. - :type parameters: ~azure.mgmt.batch.models.Pool - :param if_match: The entity state (ETag) version of the pool to update. A value of "*" can be - used to apply the operation only if the pool already exists. If omitted, this operation will - always be applied. - :type if_match: str - :param if_none_match: Set to '*' to allow a new pool to be created, but to prevent updating an - existing pool. Other values will be ignored. - :type if_none_match: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Pool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.batch.models.Pool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Pool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('Pool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), - 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}'} # type: ignore async def update( self, @@ -332,7 +264,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -390,7 +322,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -484,7 +416,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -523,7 +455,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -587,7 +519,7 @@ async def disable_auto_scale( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -658,7 +590,7 @@ async def stop_resize( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py index 678d2e873fc0..80f8d92298b2 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py @@ -68,7 +68,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -199,7 +199,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,17 +235,12 @@ async def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None if response.status_code == 200: deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, {}) return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore @@ -319,7 +314,7 @@ def get_long_running_output(pipeline_response): 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str', max_length=101, min_length=1, pattern=r'^[a-zA-Z0-9_-]+\.?[a-fA-F0-9-]*$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py index e3889258c5cd..fe2b13884966 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py @@ -66,7 +66,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py index 83750898185c..668b7511eaa2 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py @@ -27,6 +27,7 @@ from ._models_py3 import BatchAccountRegenerateKeyParameters from ._models_py3 import BatchAccountUpdateParameters from ._models_py3 import BatchLocationQuota + from ._models_py3 import BatchPoolIdentity from ._models_py3 import CIFSMountConfiguration from ._models_py3 import Certificate from ._models_py3 import CertificateBaseProperties @@ -38,6 +39,8 @@ from ._models_py3 import CheckNameAvailabilityResult from ._models_py3 import CloudErrorBody from ._models_py3 import CloudServiceConfiguration + from ._models_py3 import Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ContainerConfiguration from ._models_py3 import ContainerRegistry from ._models_py3 import DataDisk @@ -63,6 +66,7 @@ from ._models_py3 import NFSMountConfiguration from ._models_py3 import NetworkConfiguration from ._models_py3 import NetworkSecurityGroupRule + from ._models_py3 import NodePlacementConfiguration from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult @@ -84,6 +88,7 @@ from ._models_py3 import TaskSchedulingPolicy from ._models_py3 import UserAccount from ._models_py3 import UserIdentity + from ._models_py3 import VMExtension from ._models_py3 import VirtualMachineConfiguration from ._models_py3 import VirtualMachineFamilyCoreQuota from ._models_py3 import WindowsConfiguration @@ -109,6 +114,7 @@ from ._models import BatchAccountRegenerateKeyParameters # type: ignore from ._models import BatchAccountUpdateParameters # type: ignore from ._models import BatchLocationQuota # type: ignore + from ._models import BatchPoolIdentity # type: ignore from ._models import CIFSMountConfiguration # type: ignore from ._models import Certificate # type: ignore from ._models import CertificateBaseProperties # type: ignore @@ -120,6 +126,8 @@ from ._models import CheckNameAvailabilityResult # type: ignore from ._models import CloudErrorBody # type: ignore from ._models import CloudServiceConfiguration # type: ignore + from ._models import Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ContainerConfiguration # type: ignore from ._models import ContainerRegistry # type: ignore from ._models import DataDisk # type: ignore @@ -145,6 +153,7 @@ from ._models import NFSMountConfiguration # type: ignore from ._models import NetworkConfiguration # type: ignore from ._models import NetworkSecurityGroupRule # type: ignore + from ._models import NodePlacementConfiguration # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore @@ -166,6 +175,7 @@ from ._models import TaskSchedulingPolicy # type: ignore from ._models import UserAccount # type: ignore from ._models import UserIdentity # type: ignore + from ._models import VMExtension # type: ignore from ._models import VirtualMachineConfiguration # type: ignore from ._models import VirtualMachineFamilyCoreQuota # type: ignore from ._models import WindowsConfiguration # type: ignore @@ -192,8 +202,10 @@ LoginMode, NameAvailabilityReason, NetworkSecurityGroupRuleAccess, + NodePlacementPolicyType, PackageState, PoolAllocationMode, + PoolIdentityType, PoolProvisioningState, PrivateEndpointConnectionProvisioningState, PrivateLinkServiceConnectionStatus, @@ -224,6 +236,7 @@ 'BatchAccountRegenerateKeyParameters', 'BatchAccountUpdateParameters', 'BatchLocationQuota', + 'BatchPoolIdentity', 'CIFSMountConfiguration', 'Certificate', 'CertificateBaseProperties', @@ -235,6 +248,8 @@ 'CheckNameAvailabilityResult', 'CloudErrorBody', 'CloudServiceConfiguration', + 'Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties', + 'Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ContainerConfiguration', 'ContainerRegistry', 'DataDisk', @@ -260,6 +275,7 @@ 'NFSMountConfiguration', 'NetworkConfiguration', 'NetworkSecurityGroupRule', + 'NodePlacementConfiguration', 'Operation', 'OperationDisplay', 'OperationListResult', @@ -281,6 +297,7 @@ 'TaskSchedulingPolicy', 'UserAccount', 'UserIdentity', + 'VMExtension', 'VirtualMachineConfiguration', 'VirtualMachineFamilyCoreQuota', 'WindowsConfiguration', @@ -305,8 +322,10 @@ 'LoginMode', 'NameAvailabilityReason', 'NetworkSecurityGroupRuleAccess', + 'NodePlacementPolicyType', 'PackageState', 'PoolAllocationMode', + 'PoolIdentityType', 'PoolProvisioningState', 'PrivateEndpointConnectionProvisioningState', 'PrivateLinkServiceConnectionStatus', diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_enums.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_enums.py index c0fbab89b85e..7706a62afdef 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_enums.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_enums.py @@ -184,6 +184,13 @@ class NetworkSecurityGroupRuleAccess(with_metaclass(_CaseInsensitiveEnumMeta, st ALLOW = "Allow" #: Allow access. DENY = "Deny" #: Deny access. +class NodePlacementPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default value is regional. + """ + + REGIONAL = "Regional" #: All nodes in the pool will be allocated in the same region. + ZONAL = "Zonal" #: Nodes in the pool will be spread across different zones with best effort balancing. + class PackageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current state of the application package. """ @@ -198,6 +205,13 @@ class PoolAllocationMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): BATCH_SERVICE = "BatchService" #: Pools will be allocated in subscriptions owned by the Batch service. USER_SUBSCRIPTION = "UserSubscription" #: Pools will be allocated in a subscription owned by the user. +class PoolIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity used for the Batch Pool. + """ + + USER_ASSIGNED = "UserAssigned" #: Batch pool has user assigned identities with it. + NONE = "None" #: Batch pool has no identity associated with it. Setting ``None`` in update pool will remove existing identities. + class PoolProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current state of the pool. """ @@ -245,6 +259,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """ SYSTEM_ASSIGNED = "SystemAssigned" #: Batch account has a system assigned identity with it. + USER_ASSIGNED = "UserAssigned" #: Batch account has user assigned identities with it. NONE = "None" #: Batch account has no identity associated with it. Setting ``None`` in update account will remove existing identities. class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py index cae44baf5a87..c998938bfd70 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py @@ -751,8 +751,13 @@ class BatchAccountIdentity(msrest.serialization.Model): provided for a system assigned identity. :vartype tenant_id: str :param type: Required. The type of identity used for the Batch account. Possible values - include: "SystemAssigned", "None". + include: "SystemAssigned", "UserAssigned", "None". :type type: str or ~azure.mgmt.batch.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the Batch account. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.batch.models.Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -765,6 +770,7 @@ class BatchAccountIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, } def __init__( @@ -775,6 +781,7 @@ def __init__( self.principal_id = None self.tenant_id = None self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) class BatchAccountKeys(msrest.serialization.Model): @@ -920,6 +927,39 @@ def __init__( self.account_quota = None +class BatchPoolIdentity(msrest.serialization.Model): + """The identity of the Batch pool, if configured. If the pool identity is updated during update an existing pool, only the new vms which are created after the pool shrinks to 0 will have the updated identities. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of identity used for the Batch Pool. Possible values include: + "UserAssigned", "None". + :type type: str or ~azure.mgmt.batch.models.PoolIdentityType + :param user_assigned_identities: The list of user identities associated with the Batch pool. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.batch.models.Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchPoolIdentity, self).__init__(**kwargs) + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + class Certificate(ProxyResource): """Contains information about a certificate. @@ -1434,6 +1474,66 @@ def __init__( self.os_version = kwargs.get('os_version', None) +class Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class ContainerConfiguration(msrest.serialization.Model): """The configuration for container-enabled pools. @@ -2259,6 +2359,26 @@ def __init__( self.mount_options = kwargs.get('mount_options', None) +class NodePlacementConfiguration(msrest.serialization.Model): + """Allocation configuration used by Batch Service to provision the nodes. + + :param policy: Allocation policy used by Batch Service to provision the nodes. If not + specified, Batch will use the regional policy. Possible values include: "Regional", "Zonal". + :type policy: str or ~azure.mgmt.batch.models.NodePlacementPolicyType + """ + + _attribute_map = { + 'policy': {'key': 'policy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodePlacementConfiguration, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) + + class Operation(msrest.serialization.Model): """A REST API operation. @@ -2357,6 +2477,8 @@ class Pool(ProxyResource): :vartype type: str :ivar etag: The ETag of the resource, used for concurrency statements. :vartype etag: str + :param identity: The type of identity used for the Batch Pool. + :type identity: ~azure.mgmt.batch.models.BatchPoolIdentity :param display_name: The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. :type display_name: str @@ -2471,6 +2593,7 @@ class Pool(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'BatchPoolIdentity'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, @@ -2503,6 +2626,7 @@ def __init__( **kwargs ): super(Pool, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) self.display_name = kwargs.get('display_name', None) self.last_modified = None self.creation_time = None @@ -2794,7 +2918,7 @@ class ResizeOperationStatus(msrest.serialization.Model): :param target_dedicated_nodes: The desired number of dedicated compute nodes in the pool. :type target_dedicated_nodes: int - :param target_low_priority_nodes: The desired number of low-priority compute nodes in the pool. + :param target_low_priority_nodes: The desired number of low priority compute nodes in the pool. :type target_low_priority_nodes: int :param resize_timeout: The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the @@ -3157,6 +3281,12 @@ class VirtualMachineConfiguration(msrest.serialization.Model): :param disk_encryption_configuration: If specified, encryption is performed on each node in the pool during node provisioning. :type disk_encryption_configuration: ~azure.mgmt.batch.models.DiskEncryptionConfiguration + :param node_placement_configuration: This configuration will specify rules on how nodes in the + pool will be physically allocated. + :type node_placement_configuration: ~azure.mgmt.batch.models.NodePlacementConfiguration + :param extensions: If specified, the extensions mentioned in this configuration will be + installed on each node. + :type extensions: list[~azure.mgmt.batch.models.VMExtension] """ _validation = { @@ -3172,6 +3302,8 @@ class VirtualMachineConfiguration(msrest.serialization.Model): 'license_type': {'key': 'licenseType', 'type': 'str'}, 'container_configuration': {'key': 'containerConfiguration', 'type': 'ContainerConfiguration'}, 'disk_encryption_configuration': {'key': 'diskEncryptionConfiguration', 'type': 'DiskEncryptionConfiguration'}, + 'node_placement_configuration': {'key': 'nodePlacementConfiguration', 'type': 'NodePlacementConfiguration'}, + 'extensions': {'key': 'extensions', 'type': '[VMExtension]'}, } def __init__( @@ -3186,6 +3318,8 @@ def __init__( self.license_type = kwargs.get('license_type', None) self.container_configuration = kwargs.get('container_configuration', None) self.disk_encryption_configuration = kwargs.get('disk_encryption_configuration', None) + self.node_placement_configuration = kwargs.get('node_placement_configuration', None) + self.extensions = kwargs.get('extensions', None) class VirtualMachineFamilyCoreQuota(msrest.serialization.Model): @@ -3218,6 +3352,65 @@ def __init__( self.core_quota = None +class VMExtension(msrest.serialization.Model): + """The configuration for virtual machine extensions. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the virtual machine extension. + :type name: str + :param publisher: Required. The name of the extension handler publisher. + :type publisher: str + :param type: Required. The type of the extensions. + :type type: str + :param type_handler_version: The version of script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Any object. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :param provision_after_extensions: Collection of extension names after which this extension + needs to be provisioned. + :type provision_after_extensions: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provision_after_extensions': {'key': 'provisionAfterExtensions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VMExtension, self).__init__(**kwargs) + self.name = kwargs['name'] + self.publisher = kwargs['publisher'] + self.type = kwargs['type'] + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provision_after_extensions = kwargs.get('provision_after_extensions', None) + + class WindowsConfiguration(msrest.serialization.Model): """Windows operating system settings to apply to the virtual machine. diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py index b4e256959713..584f7cbd85bb 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py @@ -808,8 +808,13 @@ class BatchAccountIdentity(msrest.serialization.Model): provided for a system assigned identity. :vartype tenant_id: str :param type: Required. The type of identity used for the Batch account. Possible values - include: "SystemAssigned", "None". + include: "SystemAssigned", "UserAssigned", "None". :type type: str or ~azure.mgmt.batch.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the Batch account. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.batch.models.Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -822,18 +827,21 @@ class BatchAccountIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, } def __init__( self, *, type: Union[str, "ResourceIdentityType"], + user_assigned_identities: Optional[Dict[str, "Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ): super(BatchAccountIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type + self.user_assigned_identities = user_assigned_identities class BatchAccountKeys(msrest.serialization.Model): @@ -989,6 +997,42 @@ def __init__( self.account_quota = None +class BatchPoolIdentity(msrest.serialization.Model): + """The identity of the Batch pool, if configured. If the pool identity is updated during update an existing pool, only the new vms which are created after the pool shrinks to 0 will have the updated identities. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of identity used for the Batch Pool. Possible values include: + "UserAssigned", "None". + :type type: str or ~azure.mgmt.batch.models.PoolIdentityType + :param user_assigned_identities: The list of user identities associated with the Batch pool. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.batch.models.Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Union[str, "PoolIdentityType"], + user_assigned_identities: Optional[Dict[str, "Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(BatchPoolIdentity, self).__init__(**kwargs) + self.type = type + self.user_assigned_identities = user_assigned_identities + + class Certificate(ProxyResource): """Contains information about a certificate. @@ -1548,6 +1592,66 @@ def __init__( self.os_version = os_version +class Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components19E4Rl9SchemasBatchaccountidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class ContainerConfiguration(msrest.serialization.Model): """The configuration for container-enabled pools. @@ -2467,6 +2571,28 @@ def __init__( self.mount_options = mount_options +class NodePlacementConfiguration(msrest.serialization.Model): + """Allocation configuration used by Batch Service to provision the nodes. + + :param policy: Allocation policy used by Batch Service to provision the nodes. If not + specified, Batch will use the regional policy. Possible values include: "Regional", "Zonal". + :type policy: str or ~azure.mgmt.batch.models.NodePlacementPolicyType + """ + + _attribute_map = { + 'policy': {'key': 'policy', 'type': 'str'}, + } + + def __init__( + self, + *, + policy: Optional[Union[str, "NodePlacementPolicyType"]] = None, + **kwargs + ): + super(NodePlacementConfiguration, self).__init__(**kwargs) + self.policy = policy + + class Operation(msrest.serialization.Model): """A REST API operation. @@ -2578,6 +2704,8 @@ class Pool(ProxyResource): :vartype type: str :ivar etag: The ETag of the resource, used for concurrency statements. :vartype etag: str + :param identity: The type of identity used for the Batch Pool. + :type identity: ~azure.mgmt.batch.models.BatchPoolIdentity :param display_name: The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. :type display_name: str @@ -2692,6 +2820,7 @@ class Pool(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'BatchPoolIdentity'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, @@ -2722,6 +2851,7 @@ class Pool(ProxyResource): def __init__( self, *, + identity: Optional["BatchPoolIdentity"] = None, display_name: Optional[str] = None, vm_size: Optional[str] = None, deployment_configuration: Optional["DeploymentConfiguration"] = None, @@ -2740,6 +2870,7 @@ def __init__( **kwargs ): super(Pool, self).__init__(**kwargs) + self.identity = identity self.display_name = display_name self.last_modified = None self.creation_time = None @@ -3046,7 +3177,7 @@ class ResizeOperationStatus(msrest.serialization.Model): :param target_dedicated_nodes: The desired number of dedicated compute nodes in the pool. :type target_dedicated_nodes: int - :param target_low_priority_nodes: The desired number of low-priority compute nodes in the pool. + :param target_low_priority_nodes: The desired number of low priority compute nodes in the pool. :type target_low_priority_nodes: int :param resize_timeout: The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the @@ -3450,6 +3581,12 @@ class VirtualMachineConfiguration(msrest.serialization.Model): :param disk_encryption_configuration: If specified, encryption is performed on each node in the pool during node provisioning. :type disk_encryption_configuration: ~azure.mgmt.batch.models.DiskEncryptionConfiguration + :param node_placement_configuration: This configuration will specify rules on how nodes in the + pool will be physically allocated. + :type node_placement_configuration: ~azure.mgmt.batch.models.NodePlacementConfiguration + :param extensions: If specified, the extensions mentioned in this configuration will be + installed on each node. + :type extensions: list[~azure.mgmt.batch.models.VMExtension] """ _validation = { @@ -3465,6 +3602,8 @@ class VirtualMachineConfiguration(msrest.serialization.Model): 'license_type': {'key': 'licenseType', 'type': 'str'}, 'container_configuration': {'key': 'containerConfiguration', 'type': 'ContainerConfiguration'}, 'disk_encryption_configuration': {'key': 'diskEncryptionConfiguration', 'type': 'DiskEncryptionConfiguration'}, + 'node_placement_configuration': {'key': 'nodePlacementConfiguration', 'type': 'NodePlacementConfiguration'}, + 'extensions': {'key': 'extensions', 'type': '[VMExtension]'}, } def __init__( @@ -3477,6 +3616,8 @@ def __init__( license_type: Optional[str] = None, container_configuration: Optional["ContainerConfiguration"] = None, disk_encryption_configuration: Optional["DiskEncryptionConfiguration"] = None, + node_placement_configuration: Optional["NodePlacementConfiguration"] = None, + extensions: Optional[List["VMExtension"]] = None, **kwargs ): super(VirtualMachineConfiguration, self).__init__(**kwargs) @@ -3487,6 +3628,8 @@ def __init__( self.license_type = license_type self.container_configuration = container_configuration self.disk_encryption_configuration = disk_encryption_configuration + self.node_placement_configuration = node_placement_configuration + self.extensions = extensions class VirtualMachineFamilyCoreQuota(msrest.serialization.Model): @@ -3519,6 +3662,74 @@ def __init__( self.core_quota = None +class VMExtension(msrest.serialization.Model): + """The configuration for virtual machine extensions. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the virtual machine extension. + :type name: str + :param publisher: Required. The name of the extension handler publisher. + :type publisher: str + :param type: Required. The type of the extensions. + :type type: str + :param type_handler_version: The version of script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Any object. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :param provision_after_extensions: Collection of extension names after which this extension + needs to be provisioned. + :type provision_after_extensions: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provision_after_extensions': {'key': 'provisionAfterExtensions', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: str, + publisher: str, + type: str, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + provision_after_extensions: Optional[List[str]] = None, + **kwargs + ): + super(VMExtension, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provision_after_extensions = provision_after_extensions + + class WindowsConfiguration(msrest.serialization.Model): """Windows operating system settings to apply to the virtual machine. diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py index 37d6e20acc9f..d86c7d976676 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py @@ -74,7 +74,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -145,7 +145,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -205,7 +205,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -271,7 +271,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -339,7 +339,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py index 1a24747b23f8..891f83cc6154 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py @@ -79,7 +79,7 @@ def activate( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -156,7 +156,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -231,7 +231,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -295,7 +295,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -362,7 +362,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py index 38aa40686eae..f75f8917b143 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py @@ -60,7 +60,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -171,7 +171,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -211,7 +211,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -264,7 +264,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -353,7 +353,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -390,7 +390,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -443,7 +443,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -513,7 +513,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -588,7 +588,7 @@ def synchronize_auto_storage_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -647,7 +647,7 @@ def regenerate_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -716,7 +716,7 @@ def get_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py index 4484a137dc69..460052244c3a 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py @@ -82,7 +82,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -140,7 +140,7 @@ def get_next(next_link=None): ) list_by_batch_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates'} # type: ignore - def _create_initial( + def create( self, resource_group_name, # type: str account_name, # type: str @@ -151,17 +151,41 @@ def _create_initial( **kwargs # type: Any ): # type: (...) -> "_models.Certificate" + """Creates a new certificate inside the specified account. + + :param resource_group_name: The name of the resource group that contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param certificate_name: The identifier for the certificate. This must be made up of algorithm + and thumbprint separated by a dash, and must match the certificate data in the request. For + example SHA1-a3d1c5. + :type certificate_name: str + :param parameters: Additional parameters for certificate creation. + :type parameters: ~azure.mgmt.batch.models.CertificateCreateOrUpdateParameters + :param if_match: The entity state (ETag) version of the certificate to update. A value of "*" + can be used to apply the operation only if the certificate already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param if_none_match: Set to '*' to allow a new certificate to be created, but to prevent + updating an existing certificate. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.batch.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self._create_initial.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), @@ -202,100 +226,7 @@ def _create_initial( return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}'} # type: ignore - - def begin_create( - self, - resource_group_name, # type: str - account_name, # type: str - certificate_name, # type: str - parameters, # type: "_models.CertificateCreateOrUpdateParameters" - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Certificate"] - """Creates a new certificate inside the specified account. - - :param resource_group_name: The name of the resource group that contains the Batch account. - :type resource_group_name: str - :param account_name: The name of the Batch account. - :type account_name: str - :param certificate_name: The identifier for the certificate. This must be made up of algorithm - and thumbprint separated by a dash, and must match the certificate data in the request. For - example SHA1-a3d1c5. - :type certificate_name: str - :param parameters: Additional parameters for certificate creation. - :type parameters: ~azure.mgmt.batch.models.CertificateCreateOrUpdateParameters - :param if_match: The entity state (ETag) version of the certificate to update. A value of "*" - can be used to apply the operation only if the certificate already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param if_none_match: Set to '*' to allow a new certificate to be created, but to prevent - updating an existing certificate. Other values will be ignored. - :type if_none_match: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Certificate or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.batch.models.Certificate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - certificate_name=certificate_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('Certificate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), - 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}'} # type: ignore def update( self, @@ -332,7 +263,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -391,7 +322,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -488,7 +419,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -530,7 +461,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -604,7 +535,7 @@ def cancel_deletion( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py index 09cfe293f5d5..f2fb344096b9 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py @@ -64,7 +64,7 @@ def get_quotas( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py index a4b7c82d6ecc..1830b8297b6c 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py index bb71a8ee6a35..ba4d46fb4394 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py @@ -93,7 +93,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -151,7 +151,7 @@ def get_next(next_link=None): ) list_by_batch_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools'} # type: ignore - def _create_initial( + def create( self, resource_group_name, # type: str account_name, # type: str @@ -162,17 +162,39 @@ def _create_initial( **kwargs # type: Any ): # type: (...) -> "_models.Pool" + """Creates a new pool inside the specified account. + + :param resource_group_name: The name of the resource group that contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param pool_name: The pool name. This must be unique within the account. + :type pool_name: str + :param parameters: Additional parameters for pool creation. + :type parameters: ~azure.mgmt.batch.models.Pool + :param if_match: The entity state (ETag) version of the pool to update. A value of "*" can be + used to apply the operation only if the pool already exists. If omitted, this operation will + always be applied. + :type if_match: str + :param if_none_match: Set to '*' to allow a new pool to be created, but to prevent updating an + existing pool. Other values will be ignored. + :type if_none_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Pool, or the result of cls(response) + :rtype: ~azure.mgmt.batch.models.Pool + :raises: ~azure.core.exceptions.HttpResponseError + """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Pool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self._create_initial.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), @@ -213,98 +235,7 @@ def _create_initial( return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}'} # type: ignore - - def begin_create( - self, - resource_group_name, # type: str - account_name, # type: str - pool_name, # type: str - parameters, # type: "_models.Pool" - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Pool"] - """Creates a new pool inside the specified account. - - :param resource_group_name: The name of the resource group that contains the Batch account. - :type resource_group_name: str - :param account_name: The name of the Batch account. - :type account_name: str - :param pool_name: The pool name. This must be unique within the account. - :type pool_name: str - :param parameters: Additional parameters for pool creation. - :type parameters: ~azure.mgmt.batch.models.Pool - :param if_match: The entity state (ETag) version of the pool to update. A value of "*" can be - used to apply the operation only if the pool already exists. If omitted, this operation will - always be applied. - :type if_match: str - :param if_none_match: Set to '*' to allow a new pool to be created, but to prevent updating an - existing pool. Other values will be ignored. - :type if_none_match: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Pool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.batch.models.Pool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Pool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('Pool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), - 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}'} # type: ignore def update( self, @@ -340,7 +271,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -399,7 +330,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -494,7 +425,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,7 +465,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -599,7 +530,7 @@ def disable_auto_scale( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -671,7 +602,7 @@ def stop_resize( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py index 07bef26a8500..c38ebb5217e0 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py @@ -73,7 +73,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -154,7 +154,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -206,7 +206,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -242,17 +242,12 @@ def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None if response.status_code == 200: deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, {}) return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore @@ -327,7 +322,7 @@ def get_long_running_output(pipeline_response): 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str', max_length=101, min_length=1, pattern=r'^[a-zA-Z0-9_-]+\.?[a-fA-F0-9-]*$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py index 41b591d5a669..6abac30c500d 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py @@ -71,7 +71,7 @@ def list_by_batch_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL