Skip to content

Commit

Permalink
Generated from 81ff9dd1f123face9e3dae304a8971234c6a5542
Browse files Browse the repository at this point in the history
Merge pull request #28 from leonardbf/NFSAAS-2436-R4-corrections

NFSAAS-2436 corrections to R4 standard
  • Loading branch information
AutorestCI committed Jun 4, 2019
1 parent 2f39cf1 commit 51fe4a2
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)

def check_name_availability(
self, location, custom_headers=None, raw=False, **operation_config):
self, body, location, 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 dict custom_headers: headers that will be added to the request
Expand Down Expand Up @@ -147,15 +149,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, 'object')

# 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,11 +182,13 @@ 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, body, location, 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 dict custom_headers: headers that will be added to the request
Expand Down Expand Up @@ -208,15 +216,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, 'object')

# 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). Default value: 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 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). Default value: 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 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
30 changes: 19 additions & 11 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,32 @@ 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
: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 +70,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}$'},
'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 +88,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 +108,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
32 changes: 20 additions & 12 deletions sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,32 @@ 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
: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 +70,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}$'},
'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,13 +88,15 @@ 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, *, location: str, creation_token: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, snapshot_id: str=None, subnet_id: str=None, **kwargs) -> None:
def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, protocol_types=None, snapshot_id: str=None, mount_targets=None, **kwargs) -> None:
super(Volume, self).__init__(**kwargs)
self.location = location
self.id = None
Expand All @@ -102,7 +108,9 @@ def __init__(self, *, location: str, creation_token: str, tags=None, service_lev
self.service_level = service_level
self.usage_threshold = usage_threshold
self.export_policy = export_policy
self.protocol_types = protocol_types
self.provisioning_state = None
self.snapshot_id = snapshot_id
self.baremetal_tenant_id = None
self.subnet_id = subnet_id
self.mount_targets = mount_targets
Loading

0 comments on commit 51fe4a2

Please sign in to comment.