diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index b584ed1dbfaf..68d7454c57bc 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -15,13 +15,15 @@ from .metric_specification_py3 import MetricSpecification from .service_specification_py3 import ServiceSpecification from .operation_py3 import Operation - from .active_directories_py3 import ActiveDirectories + from .active_directory_py3 import ActiveDirectory from .net_app_account_py3 import NetAppAccount from .net_app_account_patch_py3 import NetAppAccountPatch from .capacity_pool_py3 import CapacityPool from .capacity_pool_patch_py3 import CapacityPoolPatch from .export_policy_rule_py3 import ExportPolicyRule + from .volume_properties_export_policy_py3 import VolumePropertiesExportPolicy from .volume_py3 import Volume + from .volume_patch_properties_export_policy_py3 import VolumePatchPropertiesExportPolicy from .volume_patch_py3 import VolumePatch from .mount_target_py3 import MountTarget from .snapshot_py3 import Snapshot @@ -33,13 +35,15 @@ from .metric_specification import MetricSpecification from .service_specification import ServiceSpecification from .operation import Operation - from .active_directories import ActiveDirectories + from .active_directory import ActiveDirectory from .net_app_account import NetAppAccount from .net_app_account_patch import NetAppAccountPatch from .capacity_pool import CapacityPool from .capacity_pool_patch import CapacityPoolPatch from .export_policy_rule import ExportPolicyRule + from .volume_properties_export_policy import VolumePropertiesExportPolicy from .volume import Volume + from .volume_patch_properties_export_policy import VolumePatchPropertiesExportPolicy from .volume_patch import VolumePatch from .mount_target import MountTarget from .snapshot import Snapshot @@ -61,13 +65,15 @@ 'MetricSpecification', 'ServiceSpecification', 'Operation', - 'ActiveDirectories', + 'ActiveDirectory', 'NetAppAccount', 'NetAppAccountPatch', 'CapacityPool', 'CapacityPoolPatch', 'ExportPolicyRule', + 'VolumePropertiesExportPolicy', 'Volume', + 'VolumePatchPropertiesExportPolicy', 'VolumePatch', 'MountTarget', 'Snapshot', diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directories.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py similarity index 95% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/active_directories.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py index e5c45d425629..42659ca6f112 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directories.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ActiveDirectories(Model): - """Active Directories. +class ActiveDirectory(Model): + """Active Directory. :param active_directory_id: Id of the Active Directory :type active_directory_id: str @@ -49,7 +49,7 @@ class ActiveDirectories(Model): } def __init__(self, **kwargs): - super(ActiveDirectories, self).__init__(**kwargs) + super(ActiveDirectory, self).__init__(**kwargs) self.active_directory_id = kwargs.get('active_directory_id', None) self.username = kwargs.get('username', None) self.password = kwargs.get('password', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directories_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py similarity index 95% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/active_directories_py3.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py index b128e58daca0..7eec5dc63985 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directories_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ActiveDirectories(Model): - """Active Directories. +class ActiveDirectory(Model): + """Active Directory. :param active_directory_id: Id of the Active Directory :type active_directory_id: str @@ -49,7 +49,7 @@ class ActiveDirectories(Model): } 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: - super(ActiveDirectories, self).__init__(**kwargs) + super(ActiveDirectory, self).__init__(**kwargs) self.active_directory_id = active_directory_id self.username = username self.password = password diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py index 1235eae41c38..3f15012da98e 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py @@ -33,7 +33,7 @@ class NetAppAccount(Model): :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str :param active_directories: Active Directories - :type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories + :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] """ _validation = { @@ -51,7 +51,7 @@ class NetAppAccount(Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'}, + 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch.py index 769bbd473987..1e8f35b91a4c 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch.py @@ -31,7 +31,7 @@ class NetAppAccountPatch(Model): :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str :param active_directories: Active Directories - :type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories + :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] """ _validation = { @@ -48,7 +48,7 @@ class NetAppAccountPatch(Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'}, + 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch_py3.py index 0519b8afd318..982ff8975584 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch_py3.py @@ -31,7 +31,7 @@ class NetAppAccountPatch(Model): :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str :param active_directories: Active Directories - :type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories + :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] """ _validation = { @@ -48,7 +48,7 @@ class NetAppAccountPatch(Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'}, + 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, } def __init__(self, *, location: str=None, tags=None, active_directories=None, **kwargs) -> None: diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py index 1b1a8ba1055e..72e53303d3fa 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py @@ -33,7 +33,7 @@ class NetAppAccount(Model): :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str :param active_directories: Active Directories - :type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories + :type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] """ _validation = { @@ -51,7 +51,7 @@ class NetAppAccount(Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'}, + 'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'}, } def __init__(self, *, location: str, tags=None, active_directories=None, **kwargs) -> None: diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py index 0f285eb5c27a..5279982691c2 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -45,7 +45,8 @@ class Volume(Model): 107374182400 . :type usage_threshold: long :param export_policy: Export policy rule - :type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule + :type export_policy: + ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str :param subnet_id: The Azure Resource URI for a delegated subnet. Must have @@ -75,7 +76,7 @@ class Volume(Model): 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, - 'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'}, + 'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py index 982b8ac80857..0e9123a7ff17 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py @@ -38,7 +38,8 @@ class VolumePatch(Model): 107374182400 . :type usage_threshold: long :param export_policy: Export policy rule - :type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule + :type export_policy: + ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy """ _validation = { @@ -56,7 +57,7 @@ class VolumePatch(Model): 'tags': {'key': 'tags', 'type': 'object'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, - 'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'}, + 'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePatchPropertiesExportPolicy'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py new file mode 100644 index 000000000000..f516e7bcb974 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VolumePatchPropertiesExportPolicy(Model): + """Export policy rule. + + :param rules: + :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(VolumePatchPropertiesExportPolicy, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py new file mode 100644 index 000000000000..86dfd5a9d289 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VolumePatchPropertiesExportPolicy(Model): + """Export policy rule. + + :param rules: + :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'}, + } + + def __init__(self, *, rules=None, **kwargs) -> None: + super(VolumePatchPropertiesExportPolicy, self).__init__(**kwargs) + self.rules = rules diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py index 132cfe5e5f7c..8cfb155329aa 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py @@ -38,7 +38,8 @@ class VolumePatch(Model): 107374182400 . :type usage_threshold: long :param export_policy: Export policy rule - :type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule + :type export_policy: + ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy """ _validation = { @@ -56,7 +57,7 @@ class VolumePatch(Model): 'tags': {'key': 'tags', 'type': 'object'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, - 'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'}, + 'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePatchPropertiesExportPolicy'}, } def __init__(self, *, location: str=None, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, **kwargs) -> None: diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py new file mode 100644 index 000000000000..836f7dd0fd6b --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VolumePropertiesExportPolicy(Model): + """Export policy rule. + + :param rules: + :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(VolumePropertiesExportPolicy, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py new file mode 100644 index 000000000000..ae2dfcd88d26 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VolumePropertiesExportPolicy(Model): + """Export policy rule. + + :param rules: + :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'}, + } + + def __init__(self, *, rules=None, **kwargs) -> None: + super(VolumePropertiesExportPolicy, self).__init__(**kwargs) + self.rules = rules diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py index 2813d8bc0738..2691ac8b6e01 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -45,7 +45,8 @@ class Volume(Model): 107374182400 . :type usage_threshold: long :param export_policy: Export policy rule - :type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule + :type export_policy: + ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str :param subnet_id: The Azure Resource URI for a delegated subnet. Must have @@ -75,7 +76,7 @@ class Volume(Model): 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, - 'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'}, + 'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py index 434999dd747c..29e4bc756c29 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py @@ -199,11 +199,13 @@ 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 [201, 202]: + if response.status_code not in [200, 201, 202]: raise models.ErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetAppAccount', response) if response.status_code == 201: deserialized = self._deserialize('NetAppAccount', response)