Skip to content

Commit

Permalink
[AutoPR netapp/resource-manager] NetApp update swagger for R4.5 (#5986)
Browse files Browse the repository at this point in the history
* Generated from 6735d945dca2ce331221084de6b3880471234f73

updated readme

* Generated from 3774c22dc6a9601494bd6d033406b97cb403a688

Fix params structure

* Generated from fa202ee43cd1263e159ae365977dc2bdb54eb4e3

Fix Swaggers to get the diff working
  • Loading branch information
AutorestCI authored Jun 27, 2019
1 parent a14e9c2 commit 3ba9310
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(
super(AzureNetAppFilesManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-05-01'
self.api_version = '2019-06-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand All @@ -115,15 +115,23 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)

def check_name_availability(
self, body, location, custom_headers=None, raw=False, **operation_config):
self, location, name, type, resource_group, custom_headers=None, raw=False, **operation_config):
"""Check resource name availability.
Check if a resource name is available.
:param body: Name availability request.
:type body: object
:param location: The location
:type location: str
:param name: Resource name to verify.
:type name: str
:param type: Resource type used for verification. Possible values
include: 'Microsoft.NetApp/netAppAccounts',
'Microsoft.NetApp/netAppAccounts/capacityPools',
'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
:type type: str or ~azure.mgmt.netapp.models.CheckNameResourceTypes
:param resource_group: Resource group name.
:type resource_group: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -134,6 +142,8 @@ def check_name_availability(
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
body = models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group)

# Construct URL
url = self.check_name_availability.metadata['url']
path_format_arguments = {
Expand All @@ -158,7 +168,7 @@ def check_name_availability(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(body, 'object')
body_content = self._serialize.body(body, 'ResourceNameAvailabilityRequest')

# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
Expand All @@ -182,15 +192,23 @@ def check_name_availability(
check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability'}

def check_file_path_availability(
self, body, location, custom_headers=None, raw=False, **operation_config):
self, location, name, type, resource_group, custom_headers=None, raw=False, **operation_config):
"""Check file path availability.
Check if a file path is available.
:param body: File path availability request.
:type body: object
:param location: The location
:type location: str
:param name: Resource name to verify.
:type name: str
:param type: Resource type used for verification. Possible values
include: 'Microsoft.NetApp/netAppAccounts',
'Microsoft.NetApp/netAppAccounts/capacityPools',
'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
:type type: str or ~azure.mgmt.netapp.models.CheckNameResourceTypes
:param resource_group: Resource group name.
:type resource_group: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -201,6 +219,8 @@ def check_file_path_availability(
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
body = models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group)

# Construct URL
url = self.check_file_path_availability.metadata['url']
path_format_arguments = {
Expand All @@ -225,7 +245,7 @@ def check_file_path_availability(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(body, 'object')
body_content = self._serialize.body(body, 'ResourceNameAvailabilityRequest')

# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CapacityPool(Model):
:vartype pool_id: str
:param size: Required. size. Provisioned size of the pool (in bytes).
Allowed values are in 4TiB chunks (value must be multiply of
4398046511104). Default value: 4398046511104 .
4398046511104).
:type size: long
:param service_level: Required. serviceLevel. The service level of the
file system. Possible values include: 'Standard', 'Premium', 'Ultra'.
Expand Down Expand Up @@ -75,6 +75,6 @@ def __init__(self, **kwargs):
self.type = None
self.tags = kwargs.get('tags', None)
self.pool_id = None
self.size = kwargs.get('size', 4398046511104)
self.size = kwargs.get('size', None)
self.service_level = kwargs.get('service_level', "Premium")
self.provisioning_state = None
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CapacityPool(Model):
:vartype pool_id: str
:param size: Required. size. Provisioned size of the pool (in bytes).
Allowed values are in 4TiB chunks (value must be multiply of
4398046511104). Default value: 4398046511104 .
4398046511104).
:type size: long
:param service_level: Required. serviceLevel. The service level of the
file system. Possible values include: 'Standard', 'Premium', 'Ultra'.
Expand Down Expand Up @@ -67,7 +67,7 @@ class CapacityPool(Model):
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}

def __init__(self, *, location: str, tags=None, size: int=4398046511104, service_level="Premium", **kwargs) -> None:
def __init__(self, *, location: str, size: int, tags=None, service_level="Premium", **kwargs) -> None:
super(CapacityPool, self).__init__(**kwargs)
self.location = location
self.id = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class Volume(Model):
:type protocol_types: list[str]
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param snapshot_id: Snapshot ID. UUID v4 used to identify the Snapshot
:param snapshot_id: Snapshot ID. UUID v4 or resource identifier used to
identify the Snapshot.
:type snapshot_id: str
:ivar baremetal_tenant_id: Baremetal Tenant ID. Unique Baremetal Tenant
Identifier.
Expand All @@ -72,7 +73,7 @@ class Volume(Model):
'creation_token': {'required': True},
'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400},
'provisioning_state': {'readonly': True},
'snapshot_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'},
'snapshot_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$'},
'baremetal_tenant_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'},
'subnet_id': {'required': True},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class Volume(Model):
:type protocol_types: list[str]
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param snapshot_id: Snapshot ID. UUID v4 used to identify the Snapshot
:param snapshot_id: Snapshot ID. UUID v4 or resource identifier used to
identify the Snapshot.
:type snapshot_id: str
:ivar baremetal_tenant_id: Baremetal Tenant ID. Unique Baremetal Tenant
Identifier.
Expand All @@ -72,7 +73,7 @@ class Volume(Model):
'creation_token': {'required': True},
'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400},
'provisioning_state': {'readonly': True},
'snapshot_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'},
'snapshot_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$'},
'baremetal_tenant_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'},
'subnet_id': {'required': True},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AccountsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01".
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-05-01"
self.api_version = "2019-06-01"

self.config = config

Expand Down Expand Up @@ -413,7 +413,7 @@ 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]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MountTargetsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01".
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-05-01"
self.api_version = "2019-06-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Operations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01".
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-05-01"
self.api_version = "2019-06-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PoolsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01".
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-05-01"
self.api_version = "2019-06-01"

self.config = config

Expand Down Expand Up @@ -344,7 +344,7 @@ 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]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SnapshotsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01".
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-05-01"
self.api_version = "2019-06-01"

self.config = config

Expand Down Expand Up @@ -368,7 +368,7 @@ 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]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class VolumesOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01".
:ivar api_version: Version of the API to be used with the client request. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-05-01"
self.api_version = "2019-06-01"

self.config = config

Expand Down Expand Up @@ -355,7 +355,7 @@ 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]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
Expand Down

0 comments on commit 3ba9310

Please sign in to comment.