Skip to content

Commit

Permalink
[AutoPR] netapp/resource-manager (#5675)
Browse files Browse the repository at this point in the history
* Generated from 81ff9dd1f123face9e3dae304a8971234c6a5542 (#5674)

Merge pull request #28 from leonardbf/NFSAAS-2436-R4-corrections

NFSAAS-2436 corrections to R4 standard

* [AutoPR netapp/resource-manager] chore: jsonfmt netapp (#5614)

* Generated from 8722da4ff95c7dfbc5482dede05a49d6e81ca1be

chore: jsonfmt netapp

Ran `jsonfmt -w "specification/netapp/**/*.json"`

* Generated from 8722da4ff95c7dfbc5482dede05a49d6e81ca1be

chore: jsonfmt netapp

Ran `jsonfmt -w "specification/netapp/**/*.json"`

* [AutoPR netapp/resource-manager] NetApp update swagger for R4.5 (#5986)

* Generated from 6735d945dca2ce331221084de6b3880471234f73

updated readme

* Generated from 3774c22dc6a9601494bd6d033406b97cb403a688

Fix params structure

* Generated from fa202ee43cd1263e159ae365977dc2bdb54eb4e3

Fix Swaggers to get the diff working

* Packaging update of azure-mgmt-netapp

* NFSAAS-2843 update tests for R4.5 (#6218)

* ChangeLog
  • Loading branch information
AutorestCI authored and lmazuel committed Jul 4, 2019
1 parent 845ce8f commit 09ecebc
Show file tree
Hide file tree
Showing 42 changed files with 16,840 additions and 8,631 deletions.
15 changes: 15 additions & 0 deletions sdk/netapp/azure-mgmt-netapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
Release History
===============

0.5.0 (2019-07-03)
++++++++++++++++++

**Features**

- Model Volume has a new parameter protocol_types
- Model Volume has a new parameter mount_targets

**Breaking changes**

- Parameter subnet_id of model Volume is now required
- Parameter usage_threshold of model Volume is now required
- Parameter service_level of model CapacityPool is now required
- Parameter size of model CapacityPool is now required

0.4.0 (2019-04-29)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion sdk/netapp/azure-mgmt-netapp/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure NetApp Files Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
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,13 +115,23 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)

def check_name_availability(
self, 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 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 @@ -132,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 @@ -147,15 +159,19 @@ def check_name_availability(
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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 body
body_content = self._serialize.body(body, 'ResourceNameAvailabilityRequest')

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

if response.status_code not in [200]:
Expand All @@ -176,13 +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, 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 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 @@ -193,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 @@ -208,15 +236,19 @@ def check_file_path_availability(
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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 body
body_content = self._serialize.body(body, 'ResourceNameAvailabilityRequest')

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

if response.status_code not in [200]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class InAvailabilityReasonType(str, Enum):

class CheckNameResourceTypes(str, Enum):

microsoft_net_appnet_app_account = "Microsoft.NetApp/netAppAccount"
microsoft_net_appnet_app_accountcapacity_pools = "Microsoft.NetApp/netAppAccount/capacityPools"
microsoft_net_appnet_app_accountcapacity_poolsvolumes = "Microsoft.NetApp/netAppAccount/capacityPools/volumes"
microsoft_net_appnet_app_accountcapacity_poolsvolumessnapshots = "Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots"
microsoft_net_appnet_app_accounts = "Microsoft.NetApp/netAppAccounts"
microsoft_net_appnet_app_accountscapacity_pools = "Microsoft.NetApp/netAppAccounts/capacityPools"
microsoft_net_appnet_app_accountscapacity_poolsvolumes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
microsoft_net_appnet_app_accountscapacity_poolsvolumessnapshots = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"


class ServiceLevel(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class CapacityPool(Model):
:type tags: object
:ivar pool_id: poolId. UUID v4 used to identify the Pool
:vartype pool_id: str
:param size: size. Provisioned size of the pool (in bytes). Allowed values
are in 4TiB chunks (value must be multiply of 4398046511104). Default
value: 4398046511104 .
:param size: Required. size. Provisioned size of the pool (in bytes).
Allowed values are in 4TiB chunks (value must be multiply of
4398046511104).
:type size: long
:param service_level: serviceLevel. The service level of the file system.
Possible values include: 'Standard', 'Premium', 'Ultra'. Default value:
"Premium" .
:param service_level: Required. serviceLevel. The service level of the
file system. Possible values include: 'Standard', 'Premium', 'Ultra'.
Default value: "Premium" .
:type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
Expand All @@ -50,7 +50,8 @@ class CapacityPool(Model):
'name': {'readonly': True},
'type': {'readonly': True},
'pool_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}$'},
'size': {'maximum': 549755813888000, 'minimum': 4398046511104},
'size': {'required': True, 'maximum': 549755813888000, 'minimum': 4398046511104},
'service_level': {'required': True},
'provisioning_state': {'readonly': True},
}

Expand All @@ -74,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 @@ -32,13 +32,13 @@ class CapacityPool(Model):
:type tags: object
:ivar pool_id: poolId. UUID v4 used to identify the Pool
:vartype pool_id: str
:param size: size. Provisioned size of the pool (in bytes). Allowed values
are in 4TiB chunks (value must be multiply of 4398046511104). Default
value: 4398046511104 .
:param size: Required. size. Provisioned size of the pool (in bytes).
Allowed values are in 4TiB chunks (value must be multiply of
4398046511104).
:type size: long
:param service_level: serviceLevel. The service level of the file system.
Possible values include: 'Standard', 'Premium', 'Ultra'. Default value:
"Premium" .
:param service_level: Required. serviceLevel. The service level of the
file system. Possible values include: 'Standard', 'Premium', 'Ultra'.
Default value: "Premium" .
:type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
Expand All @@ -50,7 +50,8 @@ class CapacityPool(Model):
'name': {'readonly': True},
'type': {'readonly': True},
'pool_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}$'},
'size': {'maximum': 549755813888000, 'minimum': 4398046511104},
'size': {'required': True, 'maximum': 549755813888000, 'minimum': 4398046511104},
'service_level': {'required': True},
'provisioning_state': {'readonly': True},
}

Expand All @@ -66,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 @@ -20,10 +20,10 @@ class ResourceNameAvailabilityRequest(Model):
:param name: Required. Resource name to verify.
:type name: str
:param type: Required. Resource type used for verification. Possible
values include: 'Microsoft.NetApp/netAppAccount',
'Microsoft.NetApp/netAppAccount/capacityPools',
'Microsoft.NetApp/netAppAccount/capacityPools/volumes',
'Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots'
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: Required. Resource group name.
:type resource_group: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class ResourceNameAvailabilityRequest(Model):
:param name: Required. Resource name to verify.
:type name: str
:param type: Required. Resource type used for verification. Possible
values include: 'Microsoft.NetApp/netAppAccount',
'Microsoft.NetApp/netAppAccount/capacityPools',
'Microsoft.NetApp/netAppAccount/capacityPools/volumes',
'Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots'
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: Required. Resource group name.
:type resource_group: str
Expand Down
35 changes: 22 additions & 13 deletions sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,33 @@ class Volume(Model):
:param creation_token: Required. Creation Token or File Path. A unique
file path for the volume. Used when creating mount targets
:type creation_token: str
:param service_level: Required. serviceLevel. The service level of the
file system. Possible values include: 'Standard', 'Premium', 'Ultra'.
Default value: "Premium" .
:param service_level: serviceLevel. The service level of the file system.
Possible values include: 'Standard', 'Premium', 'Ultra'. Default value:
"Premium" .
:type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:param usage_threshold: usageThreshold. Maximum storage quota allowed for
a file system in bytes. This is a soft quota used for alerting only.
Minimum size is 100 GiB. Upper limit is 100TiB. Default value:
107374182400 .
:param usage_threshold: Required. usageThreshold. Maximum storage quota
allowed for a file system in bytes. This is a soft quota used for alerting
only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
Default value: 107374182400 .
:type usage_threshold: long
:param export_policy: exportPolicy. Set of export policy rules
:type export_policy:
~azure.mgmt.netapp.models.VolumePropertiesExportPolicy
:param protocol_types: protocolTypes. Set of protocol types
: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.
:vartype baremetal_tenant_id: str
:param subnet_id: The Azure Resource URI for a delegated subnet. Must have
the delegation Microsoft.NetApp/volumes
:param subnet_id: Required. The Azure Resource URI for a delegated subnet.
Must have the delegation Microsoft.NetApp/volumes
:type subnet_id: str
:param mount_targets: mountTargets. List of mount targets
:type mount_targets: object
"""

_validation = {
Expand All @@ -66,11 +71,11 @@ class Volume(Model):
'type': {'readonly': True},
'file_system_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}$'},
'creation_token': {'required': True},
'service_level': {'required': True},
'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400},
'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},
}

_attribute_map = {
Expand All @@ -84,10 +89,12 @@ class Volume(Model):
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'},
'protocol_types': {'key': 'properties.protocolTypes', 'type': '[str]'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'},
'baremetal_tenant_id': {'key': 'properties.baremetalTenantId', 'type': 'str'},
'subnet_id': {'key': 'properties.subnetId', 'type': 'str'},
'mount_targets': {'key': 'properties.mountTargets', 'type': 'object'},
}

def __init__(self, **kwargs):
Expand All @@ -102,7 +109,9 @@ def __init__(self, **kwargs):
self.service_level = kwargs.get('service_level', "Premium")
self.usage_threshold = kwargs.get('usage_threshold', 107374182400)
self.export_policy = kwargs.get('export_policy', None)
self.protocol_types = kwargs.get('protocol_types', None)
self.provisioning_state = None
self.snapshot_id = kwargs.get('snapshot_id', None)
self.baremetal_tenant_id = None
self.subnet_id = kwargs.get('subnet_id', None)
self.mount_targets = kwargs.get('mount_targets', None)
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class VolumePatch(Model):
:type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:param usage_threshold: usageThreshold. Maximum storage quota allowed for
a file system in bytes. This is a soft quota used for alerting only.
Minimum size is 100 GiB. Upper limit is 100TiB. Default value:
107374182400 .
Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
Default value: 107374182400 .
:type usage_threshold: long
:param export_policy: exportPolicy. Set of export policy rules
:type export_policy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class VolumePatch(Model):
:type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:param usage_threshold: usageThreshold. Maximum storage quota allowed for
a file system in bytes. This is a soft quota used for alerting only.
Minimum size is 100 GiB. Upper limit is 100TiB. Default value:
107374182400 .
Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
Default value: 107374182400 .
:type usage_threshold: long
:param export_policy: exportPolicy. Set of export policy rules
:type export_policy:
Expand Down
Loading

0 comments on commit 09ecebc

Please sign in to comment.