From 60be17ffec37ac5a6c5c052148299de297126c5a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 8 Feb 2021 10:19:52 +0000 Subject: [PATCH] CodeGen from PR 12367 in Azure/azure-rest-api-specs Merge 248fbe91c26176160782c0eead5168772ec86ed4 into 3227f9795b09642afb975f40d45ed481192b43a2 --- .../_azure_net_app_files_management_client.py | 2 +- .../azure/mgmt/netapp/models/__init__.py | 10 + ...e_net_app_files_management_client_enums.py | 13 ++ .../azure/mgmt/netapp/models/_models.py | 175 ++++++++++++++++-- .../azure/mgmt/netapp/models/_models_py3.py | 175 ++++++++++++++++-- .../operations/_account_backups_operations.py | 4 +- .../netapp/operations/_accounts_operations.py | 10 +- .../operations/_backup_policies_operations.py | 8 +- .../netapp/operations/_backups_operations.py | 4 +- .../_net_app_resource_operations.py | 4 +- .../mgmt/netapp/operations/_operations.py | 4 +- .../netapp/operations/_pools_operations.py | 6 +- .../_snapshot_policies_operations.py | 88 ++++++--- .../operations/_snapshots_operations.py | 4 +- .../netapp/operations/_vaults_operations.py | 4 +- .../netapp/operations/_volumes_operations.py | 4 +- 16 files changed, 431 insertions(+), 84 deletions(-) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py index 5a6c127085de..a29b1285e5a9 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py @@ -73,7 +73,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 = '2020-09-01' + self.api_version = '2020-11-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index ad20b7b9e5b6..462373d489c5 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AccountEncryption from ._models_py3 import ActiveDirectory from ._models_py3 import AuthorizeRequest from ._models_py3 import Backup @@ -45,6 +46,7 @@ from ._models_py3 import SnapshotPolicyDetails from ._models_py3 import SnapshotPolicyPatch from ._models_py3 import SnapshotPolicyVolumeList + from ._models_py3 import SystemData from ._models_py3 import Vault from ._models_py3 import Volume from ._models_py3 import VolumeBackupProperties @@ -58,6 +60,7 @@ from ._models_py3 import VolumeSnapshotProperties from ._models_py3 import WeeklySchedule except (SyntaxError, ImportError): + from ._models import AccountEncryption from ._models import ActiveDirectory from ._models import AuthorizeRequest from ._models import Backup @@ -93,6 +96,7 @@ from ._models import SnapshotPolicyDetails from ._models import SnapshotPolicyPatch from ._models import SnapshotPolicyVolumeList + from ._models import SystemData from ._models import Vault from ._models import Volume from ._models import VolumeBackupProperties @@ -119,6 +123,8 @@ CheckNameResourceTypes, CheckQuotaNameResourceTypes, ActiveDirectoryStatus, + KeySource, + CreatedByType, ServiceLevel, QosType, EndpointType, @@ -129,6 +135,7 @@ ) __all__ = [ + 'AccountEncryption', 'ActiveDirectory', 'AuthorizeRequest', 'Backup', @@ -164,6 +171,7 @@ 'SnapshotPolicyDetails', 'SnapshotPolicyPatch', 'SnapshotPolicyVolumeList', + 'SystemData', 'Vault', 'Volume', 'VolumeBackupProperties', @@ -189,6 +197,8 @@ 'CheckNameResourceTypes', 'CheckQuotaNameResourceTypes', 'ActiveDirectoryStatus', + 'KeySource', + 'CreatedByType', 'ServiceLevel', 'QosType', 'EndpointType', diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_azure_net_app_files_management_client_enums.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_azure_net_app_files_management_client_enums.py index 21ea15f3e155..a7560ff7b2cf 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_azure_net_app_files_management_client_enums.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_azure_net_app_files_management_client_enums.py @@ -43,6 +43,19 @@ class ActiveDirectoryStatus(str, Enum): updating = "Updating" #: Active Directory Updating +class KeySource(str, Enum): + + microsoft_net_app = "Microsoft.NetApp" #: The service manages the keys. + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + class ServiceLevel(str, Enum): standard = "Standard" #: Standard service level diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py index 4aea61212863..4bd83a0533cd 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py @@ -10,6 +10,24 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AccountEncryption(Model): + """Encryption settings. + + :param key_source: Encryption Key Source. Possible values are: + 'Microsoft.NetApp'. Possible values include: 'Microsoft.NetApp' + :type key_source: str or ~azure.mgmt.netapp.models.KeySource + """ + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountEncryption, self).__init__(**kwargs) + self.key_source = kwargs.get('key_source', None) class ActiveDirectory(Model): @@ -40,7 +58,7 @@ class ActiveDirectory(Model): registered as a computer account in the AD and used to mount volumes :type smb_server_name: str :param organizational_unit: The Organizational Unit (OU) within the - Windows Active Directory + Windows Active Directory. Default value: "CN=Computers" . :type organizational_unit: str :param site: The Active Directory site the service will limit Domain Controller discovery to @@ -70,6 +88,9 @@ class ActiveDirectory(Model): given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier :type security_operators: list[str] + :param ldap_over_tls: Specifies whether or not the LDAP traffic needs to + be secured via TLS. + :type ldap_over_tls: bool """ _validation = { @@ -99,6 +120,7 @@ class ActiveDirectory(Model): 'aes_encryption': {'key': 'aesEncryption', 'type': 'bool'}, 'ldap_signing': {'key': 'ldapSigning', 'type': 'bool'}, 'security_operators': {'key': 'securityOperators', 'type': '[str]'}, + 'ldap_over_tls': {'key': 'ldapOverTLS', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -111,7 +133,7 @@ def __init__(self, **kwargs): self.status = None self.status_details = None self.smb_server_name = kwargs.get('smb_server_name', None) - self.organizational_unit = kwargs.get('organizational_unit', None) + self.organizational_unit = kwargs.get('organizational_unit', "CN=Computers") self.site = kwargs.get('site', None) self.backup_operators = kwargs.get('backup_operators', None) self.kdc_ip = kwargs.get('kdc_ip', None) @@ -120,6 +142,7 @@ def __init__(self, **kwargs): self.aes_encryption = kwargs.get('aes_encryption', None) self.ldap_signing = kwargs.get('ldap_signing', None) self.security_operators = kwargs.get('security_operators', None) + self.ldap_over_tls = kwargs.get('ldap_over_tls', None) class AuthorizeRequest(Model): @@ -166,6 +189,8 @@ class Backup(Model): :type label: str :ivar backup_type: Type of backup adhoc or scheduled :vartype backup_type: str + :ivar failure_reason: Failure reason + :vartype failure_reason: str """ _validation = { @@ -178,6 +203,7 @@ class Backup(Model): 'provisioning_state': {'readonly': True}, 'size': {'readonly': True}, 'backup_type': {'readonly': True}, + 'failure_reason': {'readonly': True}, } _attribute_map = { @@ -191,6 +217,7 @@ class Backup(Model): 'size': {'key': 'properties.size', 'type': 'long'}, 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, + 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, } def __init__(self, **kwargs): @@ -205,6 +232,7 @@ def __init__(self, **kwargs): self.size = None self.label = kwargs.get('label', None) self.backup_type = None + self.failure_reason = None class BackupPatch(Model): @@ -227,6 +255,8 @@ class BackupPatch(Model): :type label: str :ivar backup_type: Type of backup adhoc or scheduled :vartype backup_type: str + :ivar failure_reason: Failure reason + :vartype failure_reason: str """ _validation = { @@ -235,6 +265,7 @@ class BackupPatch(Model): 'provisioning_state': {'readonly': True}, 'size': {'readonly': True}, 'backup_type': {'readonly': True}, + 'failure_reason': {'readonly': True}, } _attribute_map = { @@ -245,6 +276,7 @@ class BackupPatch(Model): 'size': {'key': 'properties.size', 'type': 'long'}, 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, + 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, } def __init__(self, **kwargs): @@ -256,6 +288,7 @@ def __init__(self, **kwargs): self.size = None self.label = kwargs.get('label', None) self.backup_type = None + self.failure_reason = None class BackupPolicy(Model): @@ -701,12 +734,54 @@ def __init__(self, **kwargs): class CloudError(Model): - """CloudError. + """An error response from the service. + + :param error: Cloud error body. + :type error: ~azure.mgmt.netapp.models.CloudErrorBody """ _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, } + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + class DailySchedule(Model): """Daily Schedule properties. @@ -1075,6 +1150,10 @@ class NetAppAccount(Model): :vartype provisioning_state: str :param active_directories: Active Directories :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] + :param encryption: Encryption settings + :type encryption: ~azure.mgmt.netapp.models.AccountEncryption + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData """ _validation = { @@ -1083,6 +1162,7 @@ class NetAppAccount(Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -1093,6 +1173,8 @@ class NetAppAccount(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, + 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -1104,6 +1186,8 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) self.provisioning_state = None self.active_directories = kwargs.get('active_directories', None) + self.encryption = kwargs.get('encryption', None) + self.system_data = None class NetAppAccountPatch(Model): @@ -1126,6 +1210,8 @@ class NetAppAccountPatch(Model): :vartype provisioning_state: str :param active_directories: Active Directories :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] + :param encryption: Encryption settings + :type encryption: ~azure.mgmt.netapp.models.AccountEncryption """ _validation = { @@ -1143,6 +1229,7 @@ class NetAppAccountPatch(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, + 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, } def __init__(self, **kwargs): @@ -1154,6 +1241,7 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) self.provisioning_state = None self.active_directories = kwargs.get('active_directories', None) + self.encryption = kwargs.get('encryption', None) class Operation(Model): @@ -1694,6 +1782,47 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.netapp.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.netapp.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class Vault(Model): """Vault information. @@ -1758,6 +1887,8 @@ class Volume(Model): :type tags: dict[str, str] :ivar file_system_id: FileSystem ID. Unique FileSystem Identifier. :vartype file_system_id: str + :ivar name1: Resource name + :vartype name1: str :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 @@ -1773,7 +1904,8 @@ class Volume(Model): :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 + :param protocol_types: protocolTypes. Set of protocol types, default + NFSv3, CIFS fro SMB protocol :type protocol_types: list[str] :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -1789,8 +1921,9 @@ class Volume(Model): :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: list[~azure.mgmt.netapp.models.MountTargetProperties] + :ivar mount_targets: mountTargets. List of mount targets + :vartype mount_targets: + list[~azure.mgmt.netapp.models.MountTargetProperties] :param volume_type: What type of volume is this :type volume_type: str :param data_protection: DataProtection. DataProtection type volumes @@ -1800,14 +1933,15 @@ class Volume(Model): :param is_restoring: Restoring :type is_restoring: bool :param snapshot_directory_visible: If enabled (true) the volume will - contain a read-only .snapshot directory which provides access to each of - the volume's snapshots (default to true). + contain a read-only snapshot directory which provides access to each of + the volume's snapshots (default to true). Default value: True . :type snapshot_directory_visible: bool :param kerberos_enabled: Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. Default value: False . :type kerberos_enabled: bool - :param security_style: The security style of volume. Possible values - include: 'ntfs', 'unix' + :param security_style: The security style of volume, default unix, + defaults to ntfs for dual protocol or CIFS protocol. Possible values + include: 'ntfs', 'unix'. Default value: "unix" . :type security_style: str or ~azure.mgmt.netapp.models.SecurityStyle :param smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version @@ -1818,8 +1952,11 @@ class Volume(Model): False . :type smb_continuously_available: bool :param throughput_mibps: Maximum throughput in Mibps that can be achieved - by this volume. + by this volume. Default value: 0 . :type throughput_mibps: float + :param encryption_key_source: Encryption Key Source. Possible values are: + 'Microsoft.NetApp' + :type encryption_key_source: str """ _validation = { @@ -1828,6 +1965,7 @@ class Volume(Model): 'name': {'readonly': True}, '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}$'}, + 'name1': {'readonly': True}, 'creation_token': {'required': True, 'max_length': 80, 'min_length': 1, 'pattern': r'^[a-zA-Z][a-zA-Z0-9\-]{0,79}$'}, 'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, @@ -1835,7 +1973,8 @@ class Volume(Model): 'backup_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}, 'subnet_id': {'required': True}, - 'throughput_mibps': {'maximum': 4500, 'minimum': 1, 'multiple': 0.001}, + 'mount_targets': {'readonly': True}, + 'throughput_mibps': {'maximum': 4500, 'minimum': 0, 'multiple': 0.001}, } _attribute_map = { @@ -1845,6 +1984,7 @@ class Volume(Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, @@ -1865,6 +2005,7 @@ class Volume(Model): 'smb_encryption': {'key': 'properties.smbEncryption', 'type': 'bool'}, 'smb_continuously_available': {'key': 'properties.smbContinuouslyAvailable', 'type': 'bool'}, 'throughput_mibps': {'key': 'properties.throughputMibps', 'type': 'float'}, + 'encryption_key_source': {'key': 'properties.encryptionKeySource', 'type': 'str'}, } def __init__(self, **kwargs): @@ -1875,6 +2016,7 @@ def __init__(self, **kwargs): self.type = None self.tags = kwargs.get('tags', None) self.file_system_id = None + self.name1 = None self.creation_token = kwargs.get('creation_token', None) self.service_level = kwargs.get('service_level', "Premium") self.usage_threshold = kwargs.get('usage_threshold', 107374182400) @@ -1885,16 +2027,17 @@ def __init__(self, **kwargs): self.backup_id = kwargs.get('backup_id', None) self.baremetal_tenant_id = None self.subnet_id = kwargs.get('subnet_id', None) - self.mount_targets = kwargs.get('mount_targets', None) + self.mount_targets = None self.volume_type = kwargs.get('volume_type', None) self.data_protection = kwargs.get('data_protection', None) self.is_restoring = kwargs.get('is_restoring', None) - self.snapshot_directory_visible = kwargs.get('snapshot_directory_visible', None) + self.snapshot_directory_visible = kwargs.get('snapshot_directory_visible', True) self.kerberos_enabled = kwargs.get('kerberos_enabled', False) - self.security_style = kwargs.get('security_style', None) + self.security_style = kwargs.get('security_style', "unix") self.smb_encryption = kwargs.get('smb_encryption', False) self.smb_continuously_available = kwargs.get('smb_continuously_available', False) - self.throughput_mibps = kwargs.get('throughput_mibps', None) + self.throughput_mibps = kwargs.get('throughput_mibps', 0) + self.encryption_key_source = kwargs.get('encryption_key_source', None) class VolumeBackupProperties(Model): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py index bddb9f4175b5..b6f7857a83f3 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py @@ -10,6 +10,24 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AccountEncryption(Model): + """Encryption settings. + + :param key_source: Encryption Key Source. Possible values are: + 'Microsoft.NetApp'. Possible values include: 'Microsoft.NetApp' + :type key_source: str or ~azure.mgmt.netapp.models.KeySource + """ + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + def __init__(self, *, key_source=None, **kwargs) -> None: + super(AccountEncryption, self).__init__(**kwargs) + self.key_source = key_source class ActiveDirectory(Model): @@ -40,7 +58,7 @@ class ActiveDirectory(Model): registered as a computer account in the AD and used to mount volumes :type smb_server_name: str :param organizational_unit: The Organizational Unit (OU) within the - Windows Active Directory + Windows Active Directory. Default value: "CN=Computers" . :type organizational_unit: str :param site: The Active Directory site the service will limit Domain Controller discovery to @@ -70,6 +88,9 @@ class ActiveDirectory(Model): given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier :type security_operators: list[str] + :param ldap_over_tls: Specifies whether or not the LDAP traffic needs to + be secured via TLS. + :type ldap_over_tls: bool """ _validation = { @@ -99,9 +120,10 @@ class ActiveDirectory(Model): 'aes_encryption': {'key': 'aesEncryption', 'type': 'bool'}, 'ldap_signing': {'key': 'ldapSigning', 'type': 'bool'}, 'security_operators': {'key': 'securityOperators', 'type': '[str]'}, + 'ldap_over_tls': {'key': 'ldapOverTLS', 'type': 'bool'}, } - def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, dns: str=None, smb_server_name: str=None, organizational_unit: str=None, site: str=None, backup_operators=None, kdc_ip: str=None, ad_name: str=None, server_root_ca_certificate: str=None, aes_encryption: bool=None, ldap_signing: bool=None, security_operators=None, **kwargs) -> None: + def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, dns: str=None, smb_server_name: str=None, organizational_unit: str="CN=Computers", site: str=None, backup_operators=None, kdc_ip: str=None, ad_name: str=None, server_root_ca_certificate: str=None, aes_encryption: bool=None, ldap_signing: bool=None, security_operators=None, ldap_over_tls: bool=None, **kwargs) -> None: super(ActiveDirectory, self).__init__(**kwargs) self.active_directory_id = active_directory_id self.username = username @@ -120,6 +142,7 @@ def __init__(self, *, active_directory_id: str=None, username: str=None, passwor self.aes_encryption = aes_encryption self.ldap_signing = ldap_signing self.security_operators = security_operators + self.ldap_over_tls = ldap_over_tls class AuthorizeRequest(Model): @@ -166,6 +189,8 @@ class Backup(Model): :type label: str :ivar backup_type: Type of backup adhoc or scheduled :vartype backup_type: str + :ivar failure_reason: Failure reason + :vartype failure_reason: str """ _validation = { @@ -178,6 +203,7 @@ class Backup(Model): 'provisioning_state': {'readonly': True}, 'size': {'readonly': True}, 'backup_type': {'readonly': True}, + 'failure_reason': {'readonly': True}, } _attribute_map = { @@ -191,6 +217,7 @@ class Backup(Model): 'size': {'key': 'properties.size', 'type': 'long'}, 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, + 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, } def __init__(self, *, location: str, label: str=None, **kwargs) -> None: @@ -205,6 +232,7 @@ def __init__(self, *, location: str, label: str=None, **kwargs) -> None: self.size = None self.label = label self.backup_type = None + self.failure_reason = None class BackupPatch(Model): @@ -227,6 +255,8 @@ class BackupPatch(Model): :type label: str :ivar backup_type: Type of backup adhoc or scheduled :vartype backup_type: str + :ivar failure_reason: Failure reason + :vartype failure_reason: str """ _validation = { @@ -235,6 +265,7 @@ class BackupPatch(Model): 'provisioning_state': {'readonly': True}, 'size': {'readonly': True}, 'backup_type': {'readonly': True}, + 'failure_reason': {'readonly': True}, } _attribute_map = { @@ -245,6 +276,7 @@ class BackupPatch(Model): 'size': {'key': 'properties.size', 'type': 'long'}, 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, + 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, } def __init__(self, *, tags=None, label: str=None, **kwargs) -> None: @@ -256,6 +288,7 @@ def __init__(self, *, tags=None, label: str=None, **kwargs) -> None: self.size = None self.label = label self.backup_type = None + self.failure_reason = None class BackupPolicy(Model): @@ -701,12 +734,54 @@ def __init__(self, *, is_available: bool=None, reason=None, message: str=None, * class CloudError(Model): - """CloudError. + """An error response from the service. + + :param error: Cloud error body. + :type error: ~azure.mgmt.netapp.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str """ _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + class DailySchedule(Model): """Daily Schedule properties. @@ -1075,6 +1150,10 @@ class NetAppAccount(Model): :vartype provisioning_state: str :param active_directories: Active Directories :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] + :param encryption: Encryption settings + :type encryption: ~azure.mgmt.netapp.models.AccountEncryption + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData """ _validation = { @@ -1083,6 +1162,7 @@ class NetAppAccount(Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -1093,9 +1173,11 @@ class NetAppAccount(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, + 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, location: str, tags=None, active_directories=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, active_directories=None, encryption=None, **kwargs) -> None: super(NetAppAccount, self).__init__(**kwargs) self.location = location self.id = None @@ -1104,6 +1186,8 @@ def __init__(self, *, location: str, tags=None, active_directories=None, **kwarg self.tags = tags self.provisioning_state = None self.active_directories = active_directories + self.encryption = encryption + self.system_data = None class NetAppAccountPatch(Model): @@ -1126,6 +1210,8 @@ class NetAppAccountPatch(Model): :vartype provisioning_state: str :param active_directories: Active Directories :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] + :param encryption: Encryption settings + :type encryption: ~azure.mgmt.netapp.models.AccountEncryption """ _validation = { @@ -1143,9 +1229,10 @@ class NetAppAccountPatch(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, + 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, } - def __init__(self, *, location: str=None, tags=None, active_directories=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, active_directories=None, encryption=None, **kwargs) -> None: super(NetAppAccountPatch, self).__init__(**kwargs) self.location = location self.id = None @@ -1154,6 +1241,7 @@ def __init__(self, *, location: str=None, tags=None, active_directories=None, ** self.tags = tags self.provisioning_state = None self.active_directories = active_directories + self.encryption = encryption class Operation(Model): @@ -1694,6 +1782,47 @@ def __init__(self, *, value=None, **kwargs) -> None: self.value = value +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.netapp.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.netapp.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class Vault(Model): """Vault information. @@ -1758,6 +1887,8 @@ class Volume(Model): :type tags: dict[str, str] :ivar file_system_id: FileSystem ID. Unique FileSystem Identifier. :vartype file_system_id: str + :ivar name1: Resource name + :vartype name1: str :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 @@ -1773,7 +1904,8 @@ class Volume(Model): :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 + :param protocol_types: protocolTypes. Set of protocol types, default + NFSv3, CIFS fro SMB protocol :type protocol_types: list[str] :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -1789,8 +1921,9 @@ class Volume(Model): :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: list[~azure.mgmt.netapp.models.MountTargetProperties] + :ivar mount_targets: mountTargets. List of mount targets + :vartype mount_targets: + list[~azure.mgmt.netapp.models.MountTargetProperties] :param volume_type: What type of volume is this :type volume_type: str :param data_protection: DataProtection. DataProtection type volumes @@ -1800,14 +1933,15 @@ class Volume(Model): :param is_restoring: Restoring :type is_restoring: bool :param snapshot_directory_visible: If enabled (true) the volume will - contain a read-only .snapshot directory which provides access to each of - the volume's snapshots (default to true). + contain a read-only snapshot directory which provides access to each of + the volume's snapshots (default to true). Default value: True . :type snapshot_directory_visible: bool :param kerberos_enabled: Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. Default value: False . :type kerberos_enabled: bool - :param security_style: The security style of volume. Possible values - include: 'ntfs', 'unix' + :param security_style: The security style of volume, default unix, + defaults to ntfs for dual protocol or CIFS protocol. Possible values + include: 'ntfs', 'unix'. Default value: "unix" . :type security_style: str or ~azure.mgmt.netapp.models.SecurityStyle :param smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version @@ -1818,8 +1952,11 @@ class Volume(Model): False . :type smb_continuously_available: bool :param throughput_mibps: Maximum throughput in Mibps that can be achieved - by this volume. + by this volume. Default value: 0 . :type throughput_mibps: float + :param encryption_key_source: Encryption Key Source. Possible values are: + 'Microsoft.NetApp' + :type encryption_key_source: str """ _validation = { @@ -1828,6 +1965,7 @@ class Volume(Model): 'name': {'readonly': True}, '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}$'}, + 'name1': {'readonly': True}, 'creation_token': {'required': True, 'max_length': 80, 'min_length': 1, 'pattern': r'^[a-zA-Z][a-zA-Z0-9\-]{0,79}$'}, 'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, @@ -1835,7 +1973,8 @@ class Volume(Model): 'backup_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}, 'subnet_id': {'required': True}, - 'throughput_mibps': {'maximum': 4500, 'minimum': 1, 'multiple': 0.001}, + 'mount_targets': {'readonly': True}, + 'throughput_mibps': {'maximum': 4500, 'minimum': 0, 'multiple': 0.001}, } _attribute_map = { @@ -1845,6 +1984,7 @@ class Volume(Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, @@ -1865,9 +2005,10 @@ class Volume(Model): 'smb_encryption': {'key': 'properties.smbEncryption', 'type': 'bool'}, 'smb_continuously_available': {'key': 'properties.smbContinuouslyAvailable', 'type': 'bool'}, 'throughput_mibps': {'key': 'properties.throughputMibps', 'type': 'float'}, + 'encryption_key_source': {'key': 'properties.encryptionKeySource', 'type': 'str'}, } - 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, backup_id: str=None, mount_targets=None, volume_type: str=None, data_protection=None, is_restoring: bool=None, snapshot_directory_visible: bool=None, kerberos_enabled: bool=False, security_style=None, smb_encryption: bool=False, smb_continuously_available: bool=False, throughput_mibps: float=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, backup_id: str=None, volume_type: str=None, data_protection=None, is_restoring: bool=None, snapshot_directory_visible: bool=True, kerberos_enabled: bool=False, security_style="unix", smb_encryption: bool=False, smb_continuously_available: bool=False, throughput_mibps: float=0, encryption_key_source: str=None, **kwargs) -> None: super(Volume, self).__init__(**kwargs) self.location = location self.id = None @@ -1875,6 +2016,7 @@ def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=N self.type = None self.tags = tags self.file_system_id = None + self.name1 = None self.creation_token = creation_token self.service_level = service_level self.usage_threshold = usage_threshold @@ -1885,7 +2027,7 @@ def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=N self.backup_id = backup_id self.baremetal_tenant_id = None self.subnet_id = subnet_id - self.mount_targets = mount_targets + self.mount_targets = None self.volume_type = volume_type self.data_protection = data_protection self.is_restoring = is_restoring @@ -1895,6 +2037,7 @@ def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=N self.smb_encryption = smb_encryption self.smb_continuously_available = smb_continuously_available self.throughput_mibps = throughput_mibps + self.encryption_key_source = encryption_key_source class VolumeBackupProperties(Model): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py index ce6cbc5ea3aa..b714a6bc8d94 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py @@ -27,7 +27,7 @@ class AccountBackupsOperations(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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py index ecd7ed31fd51..9c4b7e3c424f 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py @@ -27,7 +27,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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config @@ -209,7 +209,7 @@ 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 [200, 201, 202]: + if response.status_code not in [200, 201]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -396,7 +396,7 @@ def _update_initial( 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, 201, 202]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -405,7 +405,7 @@ def _update_initial( if response.status_code == 200: deserialized = self._deserialize('NetAppAccount', response) - if response.status_code == 201: + if response.status_code == 202: deserialized = self._deserialize('NetAppAccount', response) if raw: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py index c396811d4214..ea98049b5471 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py @@ -27,7 +27,7 @@ class BackupPoliciesOperations(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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config @@ -350,7 +350,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 @@ -358,6 +358,8 @@ def update( deserialized = None if response.status_code == 200: deserialized = self._deserialize('BackupPolicy', response) + if response.status_code == 202: + deserialized = self._deserialize('BackupPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py index 1977efda55e2..62504447cc48 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py @@ -27,7 +27,7 @@ class BackupsOperations(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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py index a5a240433815..c098ac603f34 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py @@ -25,7 +25,7 @@ class NetAppResourceOperations(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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py index 3bdf42cbe5d2..5f5ec96c46ad 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py @@ -25,7 +25,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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py index 8dfeeabafca4..c8ff286c0dde 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py @@ -27,7 +27,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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config @@ -216,7 +216,7 @@ 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 [200, 201, 202]: + if response.status_code not in [200, 201]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py index ef82b240dcff..15b9d4612015 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py @@ -27,7 +27,7 @@ class SnapshotPoliciesOperations(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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config @@ -284,29 +284,9 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}'} - def update( - self, body, resource_group_name, account_name, snapshot_policy_name, custom_headers=None, raw=False, **operation_config): - """Patch a snapshot policy. - :param body: Snapshot policy object supplied in the body of the - operation. - :type body: ~azure.mgmt.netapp.models.SnapshotPolicyPatch - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param account_name: The name of the NetApp account - :type account_name: str - :param snapshot_policy_name: The name of the snapshot policy target - :type snapshot_policy_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`. - :return: SnapshotPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _update_initial( + self, body, resource_group_name, account_name, snapshot_policy_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -339,20 +319,76 @@ 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 deserialized = None + if response.status_code == 200: deserialized = self._deserialize('SnapshotPolicy', response) + if response.status_code == 202: + deserialized = self._deserialize('SnapshotPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + + def update( + self, body, resource_group_name, account_name, snapshot_policy_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch a snapshot policy. + + :param body: Snapshot policy object supplied in the body of the + operation. + :type body: ~azure.mgmt.netapp.models.SnapshotPolicyPatch + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account + :type account_name: str + :param snapshot_policy_name: The name of the snapshot policy target + :type snapshot_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SnapshotPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.SnapshotPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.SnapshotPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + body=body, + resource_group_name=resource_group_name, + account_name=account_name, + snapshot_policy_name=snapshot_policy_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SnapshotPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}'} @@ -502,4 +538,4 @@ def list_volumes( return client_raw_response return deserialized - list_volumes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/listVolumes'} + list_volumes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes'} diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py index f4a3e63ee817..169d247540c0 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py @@ -27,7 +27,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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py index 873b0c4d3743..8a87b9ee533e 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py @@ -25,7 +25,7 @@ class VaultsOperations(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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py index 895bab120496..50cc6baa0ca5 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py @@ -27,7 +27,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: "2020-09-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-09-01" + self.api_version = "2020-11-01" self.config = config