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

[AutoPR netapp/resource-manager] Remove mount target get and add pool and volume put status #4046

Merged
merged 1 commit into from
Dec 14, 2018
Merged
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 @@ -110,73 +110,3 @@ def internal_paging(next_link=None, raw=False):

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets'}

def get(
self, resource_group, account_name, pool_name, volume_name, mount_target_name, custom_headers=None, raw=False, **operation_config):
"""Get a mount target.

:param resource_group: The name of the resource group.
:type resource_group: str
:param account_name: The name of the NetApp account
:type account_name: str
:param pool_name: The name of the capacity pool
:type pool_name: str
:param volume_name: The name of the volume
:type volume_name: str
:param mount_target_name: The name of the mount target
:type mount_target_name: str
: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<msrest:optionsforoperations>`.
:return: MountTarget or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.netapp.models.MountTarget or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorException<azure.mgmt.netapp.models.ErrorException>`
"""
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'),
'accountName': self._serialize.url("account_name", account_name, 'str'),
'poolName': self._serialize.url("pool_name", pool_name, 'str'),
'volumeName': self._serialize.url("volume_name", volume_name, 'str'),
'mountTargetName': self._serialize.url("mount_target_name", mount_target_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# 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:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('MountTarget', response)

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

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets/{mountTargetName}'}
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,13 @@ def _create_or_update_initial(
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [201, 202]:
if response.status_code not in [200, 201, 202]:
raise models.ErrorException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('CapacityPool', response)
if response.status_code == 201:
deserialized = self._deserialize('CapacityPool', response)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ def _create_or_update_initial(
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [201, 202]:
if response.status_code not in [200, 201, 202]:
raise models.ErrorException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('Volume', response)
if response.status_code == 201:
deserialized = self._deserialize('Volume', response)

Expand Down