Skip to content

Commit e907228

Browse files
authored
[AutoPR netapp/resource-manager] Initial stable version (#4890)
* Generated from 0d5ee15214bbfdeb6cf1e6c406014d7f7f5dbf41 Merge pull request #16 from leonardbf/NFSAAS-2185-R4-swagger-standard NFSAAS-2185 update to R4 standard * Packaging update of azure-mgmt-netapp * Generated from 8153135b38dbcaf4b145bad5db7d4e662b053ef5 Merge pull request #17 from leonardbf/NFSAAS-2185-R4-swagger-standard NFSAAS-2185 update to R4 RP standard * Generated from 194e44a6ce8900ab9dcdc934c61e527e45f685af Merge pull request #19 from leonardbf/NFSAAS-2185-R4-swagger-standard NFSAAS-2185 update to R4 RP standard
1 parent d4ad751 commit e907228

29 files changed

+578
-243
lines changed

azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py

Lines changed: 128 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
from msrest import Serializer, Deserializer
1414
from msrestazure import AzureConfiguration
1515
from .version import VERSION
16+
from msrest.pipeline import ClientRawResponse
17+
from msrestazure.azure_exceptions import CloudError
18+
from msrest.polling import LROPoller, NoPolling
19+
from msrestazure.polling.arm_polling import ARMPolling
20+
import uuid
1621
from .operations.operations import Operations
1722
from .operations.accounts_operations import AccountsOperations
1823
from .operations.pools_operations import PoolsOperations
@@ -92,7 +97,7 @@ def __init__(
9297
super(AzureNetAppFilesManagementClient, self).__init__(self.config.credentials, self.config)
9398

9499
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
95-
self.api_version = '2017-08-15'
100+
self.api_version = '2019-05-01'
96101
self._serialize = Serializer(client_models)
97102
self._deserialize = Deserializer(client_models)
98103

@@ -108,3 +113,125 @@ def __init__(
108113
self._client, self.config, self._serialize, self._deserialize)
109114
self.snapshots = SnapshotsOperations(
110115
self._client, self.config, self._serialize, self._deserialize)
116+
117+
def check_name_availability(
118+
self, location, custom_headers=None, raw=False, **operation_config):
119+
"""Check resource name availability.
120+
121+
Check if a resource name is available.
122+
123+
:param location: The location
124+
:type location: str
125+
:param dict custom_headers: headers that will be added to the request
126+
:param bool raw: returns the direct response alongside the
127+
deserialized response
128+
:param operation_config: :ref:`Operation configuration
129+
overrides<msrest:optionsforoperations>`.
130+
:return: ResourceNameAvailability or ClientRawResponse if raw=true
131+
:rtype: ~azure.mgmt.netapp.models.ResourceNameAvailability or
132+
~msrest.pipeline.ClientRawResponse
133+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
134+
"""
135+
# Construct URL
136+
url = self.check_name_availability.metadata['url']
137+
path_format_arguments = {
138+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
139+
'location': self._serialize.url("location", location, 'str')
140+
}
141+
url = self._client.format_url(url, **path_format_arguments)
142+
143+
# Construct parameters
144+
query_parameters = {}
145+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
146+
147+
# Construct headers
148+
header_parameters = {}
149+
header_parameters['Accept'] = 'application/json'
150+
if self.config.generate_client_request_id:
151+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
152+
if custom_headers:
153+
header_parameters.update(custom_headers)
154+
if self.config.accept_language is not None:
155+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
156+
157+
# Construct and send request
158+
request = self._client.post(url, query_parameters, header_parameters)
159+
response = self._client.send(request, stream=False, **operation_config)
160+
161+
if response.status_code not in [200]:
162+
exp = CloudError(response)
163+
exp.request_id = response.headers.get('x-ms-request-id')
164+
raise exp
165+
166+
deserialized = None
167+
168+
if response.status_code == 200:
169+
deserialized = self._deserialize('ResourceNameAvailability', response)
170+
171+
if raw:
172+
client_raw_response = ClientRawResponse(deserialized, response)
173+
return client_raw_response
174+
175+
return deserialized
176+
check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability'}
177+
178+
def check_file_path_availability(
179+
self, location, custom_headers=None, raw=False, **operation_config):
180+
"""Check file path availability.
181+
182+
Check if a file path is available.
183+
184+
:param location: The location
185+
:type location: str
186+
:param dict custom_headers: headers that will be added to the request
187+
:param bool raw: returns the direct response alongside the
188+
deserialized response
189+
:param operation_config: :ref:`Operation configuration
190+
overrides<msrest:optionsforoperations>`.
191+
:return: ResourceNameAvailability or ClientRawResponse if raw=true
192+
:rtype: ~azure.mgmt.netapp.models.ResourceNameAvailability or
193+
~msrest.pipeline.ClientRawResponse
194+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
195+
"""
196+
# Construct URL
197+
url = self.check_file_path_availability.metadata['url']
198+
path_format_arguments = {
199+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
200+
'location': self._serialize.url("location", location, 'str')
201+
}
202+
url = self._client.format_url(url, **path_format_arguments)
203+
204+
# Construct parameters
205+
query_parameters = {}
206+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
207+
208+
# Construct headers
209+
header_parameters = {}
210+
header_parameters['Accept'] = 'application/json'
211+
if self.config.generate_client_request_id:
212+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
213+
if custom_headers:
214+
header_parameters.update(custom_headers)
215+
if self.config.accept_language is not None:
216+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
217+
218+
# Construct and send request
219+
request = self._client.post(url, query_parameters, header_parameters)
220+
response = self._client.send(request, stream=False, **operation_config)
221+
222+
if response.status_code not in [200]:
223+
exp = CloudError(response)
224+
exp.request_id = response.headers.get('x-ms-request-id')
225+
raise exp
226+
227+
deserialized = None
228+
229+
if response.status_code == 200:
230+
deserialized = self._deserialize('ResourceNameAvailability', response)
231+
232+
if raw:
233+
client_raw_response = ClientRawResponse(deserialized, response)
234+
return client_raw_response
235+
236+
return deserialized
237+
check_file_path_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability'}

azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from .metric_specification_py3 import MetricSpecification
1616
from .service_specification_py3 import ServiceSpecification
1717
from .operation_py3 import Operation
18+
from .resource_name_availability_py3 import ResourceNameAvailability
19+
from .resource_name_availability_request_py3 import ResourceNameAvailabilityRequest
1820
from .active_directory_py3 import ActiveDirectory
1921
from .net_app_account_py3 import NetAppAccount
2022
from .net_app_account_patch_py3 import NetAppAccountPatch
@@ -28,13 +30,14 @@
2830
from .mount_target_py3 import MountTarget
2931
from .snapshot_py3 import Snapshot
3032
from .snapshot_patch_py3 import SnapshotPatch
31-
from .error_py3 import Error, ErrorException
3233
except (SyntaxError, ImportError):
3334
from .operation_display import OperationDisplay
3435
from .dimension import Dimension
3536
from .metric_specification import MetricSpecification
3637
from .service_specification import ServiceSpecification
3738
from .operation import Operation
39+
from .resource_name_availability import ResourceNameAvailability
40+
from .resource_name_availability_request import ResourceNameAvailabilityRequest
3841
from .active_directory import ActiveDirectory
3942
from .net_app_account import NetAppAccount
4043
from .net_app_account_patch import NetAppAccountPatch
@@ -48,14 +51,15 @@
4851
from .mount_target import MountTarget
4952
from .snapshot import Snapshot
5053
from .snapshot_patch import SnapshotPatch
51-
from .error import Error, ErrorException
5254
from .operation_paged import OperationPaged
5355
from .net_app_account_paged import NetAppAccountPaged
5456
from .capacity_pool_paged import CapacityPoolPaged
5557
from .volume_paged import VolumePaged
5658
from .mount_target_paged import MountTargetPaged
5759
from .snapshot_paged import SnapshotPaged
5860
from .azure_net_app_files_management_client_enums import (
61+
InAvailabilityReasonType,
62+
CheckNameResourceTypes,
5963
ServiceLevel,
6064
)
6165

@@ -65,6 +69,8 @@
6569
'MetricSpecification',
6670
'ServiceSpecification',
6771
'Operation',
72+
'ResourceNameAvailability',
73+
'ResourceNameAvailabilityRequest',
6874
'ActiveDirectory',
6975
'NetAppAccount',
7076
'NetAppAccountPatch',
@@ -78,12 +84,13 @@
7884
'MountTarget',
7985
'Snapshot',
8086
'SnapshotPatch',
81-
'Error', 'ErrorException',
8287
'OperationPaged',
8388
'NetAppAccountPaged',
8489
'CapacityPoolPaged',
8590
'VolumePaged',
8691
'MountTargetPaged',
8792
'SnapshotPaged',
93+
'InAvailabilityReasonType',
94+
'CheckNameResourceTypes',
8895
'ServiceLevel',
8996
]

azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class ActiveDirectory(Model):
2424
:type password: str
2525
:param domain: Name of the Active Directory domain
2626
:type domain: str
27-
:param d_ns: Comma separated list of DNS server IP addresses for the
28-
Active Directory domain
29-
:type d_ns: str
27+
:param dns: Comma separated list of DNS server IP addresses for the Active
28+
Directory domain
29+
:type dns: str
3030
:param status: Status of the Active Directory
3131
:type status: str
32-
:param s_mb_server_name: NetBIOS name of the SMB server. This name will be
32+
:param smb_server_name: NetBIOS name of the SMB server. This name will be
3333
registered as a computer account in the AD and used to mount volumes
34-
:type s_mb_server_name: str
34+
:type smb_server_name: str
3535
:param organizational_unit: The Organizational Unit (OU) within the
3636
Windows Active Directory
3737
:type organizational_unit: str
@@ -42,9 +42,9 @@ class ActiveDirectory(Model):
4242
'username': {'key': 'username', 'type': 'str'},
4343
'password': {'key': 'password', 'type': 'str'},
4444
'domain': {'key': 'domain', 'type': 'str'},
45-
'd_ns': {'key': 'dNS', 'type': 'str'},
45+
'dns': {'key': 'dns', 'type': 'str'},
4646
'status': {'key': 'status', 'type': 'str'},
47-
's_mb_server_name': {'key': 'sMBServerName', 'type': 'str'},
47+
'smb_server_name': {'key': 'smbServerName', 'type': 'str'},
4848
'organizational_unit': {'key': 'organizationalUnit', 'type': 'str'},
4949
}
5050

@@ -54,7 +54,7 @@ def __init__(self, **kwargs):
5454
self.username = kwargs.get('username', None)
5555
self.password = kwargs.get('password', None)
5656
self.domain = kwargs.get('domain', None)
57-
self.d_ns = kwargs.get('d_ns', None)
57+
self.dns = kwargs.get('dns', None)
5858
self.status = kwargs.get('status', None)
59-
self.s_mb_server_name = kwargs.get('s_mb_server_name', None)
59+
self.smb_server_name = kwargs.get('smb_server_name', None)
6060
self.organizational_unit = kwargs.get('organizational_unit', None)

azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class ActiveDirectory(Model):
2424
:type password: str
2525
:param domain: Name of the Active Directory domain
2626
:type domain: str
27-
:param d_ns: Comma separated list of DNS server IP addresses for the
28-
Active Directory domain
29-
:type d_ns: str
27+
:param dns: Comma separated list of DNS server IP addresses for the Active
28+
Directory domain
29+
:type dns: str
3030
:param status: Status of the Active Directory
3131
:type status: str
32-
:param s_mb_server_name: NetBIOS name of the SMB server. This name will be
32+
:param smb_server_name: NetBIOS name of the SMB server. This name will be
3333
registered as a computer account in the AD and used to mount volumes
34-
:type s_mb_server_name: str
34+
:type smb_server_name: str
3535
:param organizational_unit: The Organizational Unit (OU) within the
3636
Windows Active Directory
3737
:type organizational_unit: str
@@ -42,19 +42,19 @@ class ActiveDirectory(Model):
4242
'username': {'key': 'username', 'type': 'str'},
4343
'password': {'key': 'password', 'type': 'str'},
4444
'domain': {'key': 'domain', 'type': 'str'},
45-
'd_ns': {'key': 'dNS', 'type': 'str'},
45+
'dns': {'key': 'dns', 'type': 'str'},
4646
'status': {'key': 'status', 'type': 'str'},
47-
's_mb_server_name': {'key': 'sMBServerName', 'type': 'str'},
47+
'smb_server_name': {'key': 'smbServerName', 'type': 'str'},
4848
'organizational_unit': {'key': 'organizationalUnit', 'type': 'str'},
4949
}
5050

51-
def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, d_ns: str=None, status: str=None, s_mb_server_name: str=None, organizational_unit: str=None, **kwargs) -> None:
51+
def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, dns: str=None, status: str=None, smb_server_name: str=None, organizational_unit: str=None, **kwargs) -> None:
5252
super(ActiveDirectory, self).__init__(**kwargs)
5353
self.active_directory_id = active_directory_id
5454
self.username = username
5555
self.password = password
5656
self.domain = domain
57-
self.d_ns = d_ns
57+
self.dns = dns
5858
self.status = status
59-
self.s_mb_server_name = s_mb_server_name
59+
self.smb_server_name = smb_server_name
6060
self.organizational_unit = organizational_unit

azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@
1212
from enum import Enum
1313

1414

15+
class InAvailabilityReasonType(str, Enum):
16+
17+
invalid = "Invalid"
18+
already_exists = "AlreadyExists"
19+
20+
21+
class CheckNameResourceTypes(str, Enum):
22+
23+
microsoft_net_appnet_app_account = "Microsoft.NetApp/netAppAccount"
24+
microsoft_net_appnet_app_accountcapacity_pools = "Microsoft.NetApp/netAppAccount/capacityPools"
25+
microsoft_net_appnet_app_accountcapacity_poolsvolumes = "Microsoft.NetApp/netAppAccount/capacityPools/volumes"
26+
microsoft_net_appnet_app_accountcapacity_poolsvolumessnapshots = "Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots"
27+
28+
1529
class ServiceLevel(str, Enum):
1630

1731
standard = "Standard" #: Standard service level

azure-mgmt-netapp/azure/mgmt/netapp/models/error.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)