Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR azure-mgmt-storage] [SRP] Add default response status code #9343

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def get(
:return: ManagementPolicy or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.storage.v2019_06_01.models.ErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
Expand Down Expand Up @@ -92,9 +93,7 @@ def get(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand Down Expand Up @@ -131,7 +130,8 @@ def create_or_update(
:return: ManagementPolicy or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.storage.v2019_06_01.models.ErrorResponseException>`
"""
properties = models.ManagementPolicy(policy=policy)

Expand Down Expand Up @@ -168,9 +168,7 @@ def create_or_update(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def _create_initial(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

Expand Down Expand Up @@ -186,7 +184,8 @@ def create(
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2019_06_01.models.StorageAccount]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2019_06_01.models.StorageAccount]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.storage.v2019_06_01.models.ErrorResponseException>`
"""
raw_result = self._create_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -298,7 +297,8 @@ def get_properties(
:return: StorageAccount or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.storage.v2019_06_01.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_properties.metadata['url']
Expand Down Expand Up @@ -330,9 +330,7 @@ def get_properties(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand Down Expand Up @@ -376,7 +374,8 @@ def update(
:return: StorageAccount or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.storage.v2019_06_01.models.ErrorResponseException>`
"""
# Construct URL
url = self.update.metadata['url']
Expand Down Expand Up @@ -410,9 +409,7 @@ def update(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand Down Expand Up @@ -661,7 +658,8 @@ def regenerate_key(
:rtype:
~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.storage.v2019_06_01.models.ErrorResponseException>`
"""
regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name)

Expand Down Expand Up @@ -697,9 +695,7 @@ def regenerate_key(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand Down