Skip to content
Open
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 @@ -194,7 +194,6 @@ def _delete_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -211,21 +210,10 @@ def _delete_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

def delete(
self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Schedules a Cache for deletion.
Expand All @@ -239,10 +227,10 @@ def delete(
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 object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._delete_initial(
Expand All @@ -254,14 +242,10 @@ def delete(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down Expand Up @@ -529,7 +513,6 @@ def _flush_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -546,21 +529,10 @@ def _flush_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

def flush(
self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Tells a Cache to write all dirty data to the Storage Target(s). During
Expand All @@ -576,10 +548,10 @@ def flush(
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 object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._flush_initial(
Expand All @@ -591,14 +563,10 @@ def flush(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down Expand Up @@ -626,7 +594,6 @@ def _start_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -643,21 +610,10 @@ def _start_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

def start(
self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Tells a Stopped state Cache to transition to Active state.
Expand All @@ -671,10 +627,10 @@ def start(
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 object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._start_initial(
Expand All @@ -686,14 +642,10 @@ def start(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down Expand Up @@ -721,7 +673,6 @@ def _stop_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -738,21 +689,10 @@ def _stop_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

def stop(
self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Tells an Active Cache to transition to Stopped state.
Expand All @@ -766,10 +706,10 @@ def stop(
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 object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._stop_initial(
Expand All @@ -781,14 +721,10 @@ def stop(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down Expand Up @@ -816,7 +752,6 @@ def _upgrade_firmware_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -833,21 +768,10 @@ def _upgrade_firmware_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 201:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

def upgrade_firmware(
self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Upgrade a Cache's firmware if a new version is available. Otherwise,
Expand All @@ -862,10 +786,10 @@ def upgrade_firmware(
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 object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._upgrade_firmware_initial(
Expand All @@ -877,14 +801,10 @@ def upgrade_firmware(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def _delete_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -149,21 +148,10 @@ def _delete_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

def delete(
self, resource_group_name, cache_name, storage_target_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Removes a Storage Target from a Cache. This operation is allowed at any
Expand All @@ -183,10 +171,10 @@ def delete(
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 object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._delete_initial(
Expand All @@ -199,14 +187,10 @@ def delete(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down