diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9e70a6488bb4..175c95641deb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -17,7 +17,7 @@ /sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS /sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft /sdk/applicationinsights/ @alexeldeib -/sdk/batch/ @bgklein @matthchr @xingwu1 +/sdk/batch/ @bgklein @xingwu1 /sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish /sdk/keyvault/ @schaabs @chlowell @iscai-msft /sdk/loganalytics/ @alexeldeib diff --git a/sdk/batch/azure-mgmt-batch/CHANGELOG.md b/sdk/batch/azure-mgmt-batch/CHANGELOG.md index 99d93aad96fe..ffe3910bacbd 100644 --- a/sdk/batch/azure-mgmt-batch/CHANGELOG.md +++ b/sdk/batch/azure-mgmt-batch/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 8.0.1 (2020-05-26) +### Bugfixes +- Fix issues in PrivateEndpointConnection get and update methods due to mistakes in the Swagger specification causing validation to fail. + ## 8.0.0 (2020-04-10) ### REST API version - This version targets REST API version 2020-03-01. 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 e53ad109f0c3..3691ba99ac03 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 @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -145,7 +147,7 @@ def get( 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), '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]+$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$') + '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-]*$') } url = self._client.format_url(url, **path_format_arguments) @@ -183,39 +185,9 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} - def update( - self, resource_group_name, account_name, private_endpoint_connection_name, if_match=None, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): - """Updates the properties of an existing private endpoint connection. - :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 private_endpoint_connection_name: The private endpoint - connection name. This must be unique within the account. - :type private_endpoint_connection_name: str - :param if_match: The state (ETag) version of the private endpoint - connection to update. This value can be omitted or set to "*" to apply - the operation unconditionally. - :type if_match: str - :param private_endpoint: The ARM resource identifier of the private - endpoint. - :type private_endpoint: ~azure.mgmt.batch.models.PrivateEndpoint - :param private_link_service_connection_state: The private link service - connection state of the private endpoint connection. - :type private_link_service_connection_state: - ~azure.mgmt.batch.models.PrivateLinkServiceConnectionState - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PrivateEndpointConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.batch.models.PrivateEndpointConnection or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _update_initial( + self, resource_group_name, account_name, private_endpoint_connection_name, if_match=None, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): parameters = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) # Construct URL @@ -224,7 +196,7 @@ def update( 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), '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]+$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$') + '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-]*$') } url = self._client.format_url(url, **path_format_arguments) @@ -252,17 +224,19 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - header_dict = {} deserialized = None + header_dict = {} + if response.status_code == 200: deserialized = self._deserialize('PrivateEndpointConnection', response) header_dict = { - 'ETag': 'str', + 'Location': 'str', + 'Retry-After': 'int', } if raw: @@ -271,4 +245,75 @@ def update( return client_raw_response return deserialized + + def update( + self, resource_group_name, account_name, private_endpoint_connection_name, if_match=None, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the properties of an existing private endpoint connection. + + :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 private_endpoint_connection_name: The private endpoint + connection name. This must be unique within the account. + :type private_endpoint_connection_name: str + :param if_match: The state (ETag) version of the private endpoint + connection to update. This value can be omitted or set to "*" to apply + the operation unconditionally. + :type if_match: str + :param private_endpoint: The ARM resource identifier of the private + endpoint. + :type private_endpoint: ~azure.mgmt.batch.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service + connection state of the private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.batch.models.PrivateLinkServiceConnectionState + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.batch.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.batch.models.PrivateEndpointConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + if_match=if_match, + private_endpoint=private_endpoint, + private_link_service_connection_state=private_link_service_connection_state, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} 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 b48210b748a9..c1022230cd6d 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 @@ -145,7 +145,7 @@ def get( 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), '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]+$'), - 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$') + 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str', max_length=101, min_length=1, pattern=r'^[a-zA-Z0-9_-]+\.?[a-fA-F0-9-]*$') } url = self._client.format_url(url, **path_format_arguments) 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 84f10e0b7af6..54f477b1e2e9 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/version.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "8.0.1" diff --git a/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml b/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml index 800818d8a602..23163b00a363 100644 --- a/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml +++ b/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml @@ -14,7 +14,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -57,7 +57,7 @@ interactions: - keep-alive User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_batch_test_mgmt_batch_account3e1b0fe5/providers/Microsoft.Batch/batchAccounts/batch3e1b0fe5/operationResults/a4f17142-743a-4052-ba45-8b09bc57ba33?api-version=2020-03-01 response: @@ -104,7 +104,7 @@ interactions: - keep-alive User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: GET @@ -153,7 +153,7 @@ interactions: - keep-alive User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: GET @@ -200,7 +200,7 @@ interactions: - '0' User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: POST @@ -251,7 +251,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: POST @@ -302,7 +302,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: PATCH @@ -355,7 +355,7 @@ interactions: - '0' User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python accept-language: - en-US method: DELETE @@ -398,7 +398,7 @@ interactions: - keep-alive User-Agent: - python/3.7.3 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-batch/8.0.0 Azure-SDK-For-Python + azure-mgmt-batch/8.0.1 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Batch/locations/westcentralus/accountOperationResults/batch3e1b0fe5-1495797e-f9af-436d-ad44-ec39195f19a5?api-version=2020-03-01 response: