From 3d03319aeb4ad558cd37ac0a8adad5bb0699869f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 26 Nov 2018 12:37:11 +0000 Subject: [PATCH] Generated from d6ce7d9460911bf6784529720bc138891f2d6c90 Merge pull request #2 from leonardbf/netapp-api-update-public NFSAAS-1505 bring in line with RP --- .../azure/mgmt/netapp/models/__init__.py | 3 + ...e_net_app_files_management_client_enums.py | 2 +- .../azure/mgmt/netapp/models/capacity_pool.py | 15 +- .../mgmt/netapp/models/capacity_pool_py3.py | 13 +- .../azure/mgmt/netapp/models/snapshot.py | 5 + .../mgmt/netapp/models/snapshot_patch.py | 28 +++ .../mgmt/netapp/models/snapshot_patch_py3.py | 28 +++ .../azure/mgmt/netapp/models/snapshot_py3.py | 5 + .../azure/mgmt/netapp/models/volume.py | 15 +- .../azure/mgmt/netapp/models/volume_patch.py | 15 +- .../mgmt/netapp/models/volume_patch_py3.py | 13 +- .../azure/mgmt/netapp/models/volume_py3.py | 13 +- .../netapp/operations/snapshots_operations.py | 189 ++++++++++++++++++ 13 files changed, 304 insertions(+), 40 deletions(-) create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index be2af98b41a5..169f7b0f0f3f 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -23,6 +23,7 @@ from .volume_patch_py3 import VolumePatch from .mount_target_py3 import MountTarget from .snapshot_py3 import Snapshot + from .snapshot_patch_py3 import SnapshotPatch from .error_py3 import Error, ErrorException except (SyntaxError, ImportError): from .operation_display import OperationDisplay @@ -38,6 +39,7 @@ from .volume_patch import VolumePatch from .mount_target import MountTarget from .snapshot import Snapshot + from .snapshot_patch import SnapshotPatch from .error import Error, ErrorException from .operation_paged import OperationPaged from .net_app_account_paged import NetAppAccountPaged @@ -63,6 +65,7 @@ 'VolumePatch', 'MountTarget', 'Snapshot', + 'SnapshotPatch', 'Error', 'ErrorException', 'OperationPaged', 'NetAppAccountPaged', diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py index 7caf3b703991..70fe875ab01e 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py @@ -14,6 +14,6 @@ class ServiceLevel(str, Enum): - basic = "Basic" #: Basic service level standard = "Standard" #: Standard service level premium = "Premium" #: Premium service level + extreme = "Extreme" #: Extreme service level diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py index 5e5b0d69f334..d3a564cca54b 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py @@ -35,12 +35,13 @@ class CapacityPool(Model): :type account_id: str :ivar pool_id: poolId. UUID v4 used to identify the Pool :vartype pool_id: str - :param size: size. Provisioned size of the pool (in GB). Default value: - 4096 . + :param size: size. Provisioned size of the pool (in bytes). Allowed values + are in 4TiB chunks (value must be multiply of 4398046511104). Default + value: 4398046511104 . :type size: int :param service_level: serviceLevel. The service level of the file system. - Possible values include: 'Basic', 'Standard', 'Premium'. Default value: - "Standard" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -53,7 +54,7 @@ class CapacityPool(Model): 'type': {'readonly': True}, 'account_id': {'required': 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}$'}, 'pool_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, - 'size': {'minimum': 4096}, + 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, 'provisioning_state': {'readonly': True}, } @@ -79,6 +80,6 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) self.account_id = kwargs.get('account_id', None) self.pool_id = None - self.size = kwargs.get('size', 4096) - self.service_level = kwargs.get('service_level', "Standard") + self.size = kwargs.get('size', 4398046511104) + self.service_level = kwargs.get('service_level', "Premium") self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py index f40cb61a08d0..092473995fe8 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py @@ -35,12 +35,13 @@ class CapacityPool(Model): :type account_id: str :ivar pool_id: poolId. UUID v4 used to identify the Pool :vartype pool_id: str - :param size: size. Provisioned size of the pool (in GB). Default value: - 4096 . + :param size: size. Provisioned size of the pool (in bytes). Allowed values + are in 4TiB chunks (value must be multiply of 4398046511104). Default + value: 4398046511104 . :type size: int :param service_level: serviceLevel. The service level of the file system. - Possible values include: 'Basic', 'Standard', 'Premium'. Default value: - "Standard" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -53,7 +54,7 @@ class CapacityPool(Model): 'type': {'readonly': True}, 'account_id': {'required': 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}$'}, 'pool_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, - 'size': {'minimum': 4096}, + 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, 'provisioning_state': {'readonly': True}, } @@ -70,7 +71,7 @@ class CapacityPool(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, location: str, account_id: str, tags=None, size: int=4096, service_level="Standard", **kwargs) -> None: + def __init__(self, *, location: str, account_id: str, tags=None, size: int=4398046511104, service_level="Premium", **kwargs) -> None: super(CapacityPool, self).__init__(**kwargs) self.location = location self.id = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py index 13f58b4786a6..3983c5ab10e6 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py @@ -26,6 +26,8 @@ class Snapshot(Model): :vartype id: str :ivar name: Resource name :vartype name: str + :ivar type: Resource type + :vartype type: str :param tags: Resource tags :type tags: object :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot @@ -45,6 +47,7 @@ class Snapshot(Model): 'location': {'required': True}, 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, 'snapshot_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}$'}, 'file_system_id': {'required': 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}, @@ -56,6 +59,7 @@ class Snapshot(Model): 'location': {'key': 'location', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, @@ -69,6 +73,7 @@ def __init__(self, **kwargs): self.location = kwargs.get('location', None) self.id = None self.name = None + self.type = None self.tags = kwargs.get('tags', None) self.snapshot_id = None self.file_system_id = kwargs.get('file_system_id', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py new file mode 100644 index 000000000000..9ccd3602fab8 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.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 SnapshotPatch(Model): + """Snapshot patch. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(SnapshotPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py new file mode 100644 index 000000000000..61ba55fecf81 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_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 SnapshotPatch(Model): + """Snapshot patch. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(SnapshotPatch, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py index 0e173d72628f..d0509b919d94 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py @@ -26,6 +26,8 @@ class Snapshot(Model): :vartype id: str :ivar name: Resource name :vartype name: str + :ivar type: Resource type + :vartype type: str :param tags: Resource tags :type tags: object :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot @@ -45,6 +47,7 @@ class Snapshot(Model): 'location': {'required': True}, 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, 'snapshot_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}$'}, 'file_system_id': {'required': 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}, @@ -56,6 +59,7 @@ class Snapshot(Model): 'location': {'key': 'location', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, @@ -69,6 +73,7 @@ def __init__(self, *, location: str, file_system_id: str, tags=None, **kwargs) - self.location = location self.id = None self.name = None + self.type = None self.tags = tags self.snapshot_id = None self.file_system_id = file_system_id diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py index 0326cf38a2f2..1c60a1bd4449 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -38,12 +38,13 @@ class Volume(Model): file path for the volume. Used when creating mount targets :type creation_token: str :param service_level: Required. serviceLevel. The service level of the - file system. Possible values include: 'Basic', 'Standard', 'Premium'. - Default value: "Standard" . + file system. Possible values include: 'Standard', 'Premium', 'Extreme'. + Default value: "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -60,7 +61,7 @@ class Volume(Model): 'file_system_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'creation_token': {'required': True}, 'service_level': {'required': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, } @@ -89,7 +90,7 @@ def __init__(self, **kwargs): self.file_system_id = None self.name1 = kwargs.get('name1', None) self.creation_token = kwargs.get('creation_token', None) - self.service_level = kwargs.get('service_level', "Standard") - self.usage_threshold = kwargs.get('usage_threshold', 0) + self.service_level = kwargs.get('service_level', "Premium") + self.usage_threshold = kwargs.get('usage_threshold', 107374182400) self.provisioning_state = None self.subnet_id = kwargs.get('subnet_id', None) 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 4b1f753cf88f..558fecabe5c6 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py @@ -31,12 +31,13 @@ class VolumePatch(Model): :param name1: FileSystem name. FileSystem name :type name1: str :param service_level: serviceLevel. The service level of the file system. - Possible values include: 'Basic', 'Standard', 'Premium'. Default value: - "Standard" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long """ @@ -44,7 +45,7 @@ class VolumePatch(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, } _attribute_map = { @@ -66,5 +67,5 @@ def __init__(self, **kwargs): self.type = None self.tags = kwargs.get('tags', None) self.name1 = kwargs.get('name1', None) - self.service_level = kwargs.get('service_level', "Standard") - self.usage_threshold = kwargs.get('usage_threshold', 0) + self.service_level = kwargs.get('service_level', "Premium") + self.usage_threshold = kwargs.get('usage_threshold', 107374182400) 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 b23fc94ecf43..f98695421f99 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 @@ -31,12 +31,13 @@ class VolumePatch(Model): :param name1: FileSystem name. FileSystem name :type name1: str :param service_level: serviceLevel. The service level of the file system. - Possible values include: 'Basic', 'Standard', 'Premium'. Default value: - "Standard" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long """ @@ -44,7 +45,7 @@ class VolumePatch(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, } _attribute_map = { @@ -58,7 +59,7 @@ class VolumePatch(Model): 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, } - def __init__(self, *, location: str=None, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, name1: str=None, service_level="Premium", usage_threshold: int=107374182400, **kwargs) -> None: super(VolumePatch, self).__init__(**kwargs) self.location = location self.id = None 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 6e629373d946..7a542ac20d1f 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -38,12 +38,13 @@ class Volume(Model): file path for the volume. Used when creating mount targets :type creation_token: str :param service_level: Required. serviceLevel. The service level of the - file system. Possible values include: 'Basic', 'Standard', 'Premium'. - Default value: "Standard" . + file system. Possible values include: 'Standard', 'Premium', 'Extreme'. + Default value: "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -60,7 +61,7 @@ class Volume(Model): 'file_system_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'creation_token': {'required': True}, 'service_level': {'required': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, } @@ -79,7 +80,7 @@ class Volume(Model): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } - def __init__(self, *, location: str, creation_token: str, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, subnet_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, creation_token: str, tags=None, name1: str=None, service_level="Premium", usage_threshold: int=107374182400, subnet_id: str=None, **kwargs) -> None: super(Volume, self).__init__(**kwargs) self.location = location self.id = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py index 41b6dfea9e52..1f4e499cd444 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py @@ -184,6 +184,195 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + def _create_initial( + self, body, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str'), + 'volumeName': self._serialize.url("volume_name", volume_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'Snapshot') + + # Construct and send request + 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, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, body, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a snapshot. + + :param body: Snapshot object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.Snapshot + :param resource_group: The name of the resource group. + :type resource_group: str + :param account_name: The name of the NetApp account + :type account_name: str + :param pool_name: The name of the capacity pool + :type pool_name: str + :param volume_name: The name of the volume + :type volume_name: str + :param snapshot_name: The name of the mount target + :type snapshot_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 Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Snapshot]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + body=body, + resource_group=resource_group, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + + def update( + self, resource_group, account_name, pool_name, volume_name, snapshot_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Patch a snapshot. + + :param resource_group: The name of the resource group. + :type resource_group: str + :param account_name: The name of the NetApp account + :type account_name: str + :param pool_name: The name of the capacity pool + :type pool_name: str + :param volume_name: The name of the volume + :type volume_name: str + :param snapshot_name: The name of the mount target + :type snapshot_name: str + :param tags: Resource tags + :type tags: object + :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: Snapshot or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.Snapshot or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + body = models.SnapshotPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str'), + 'volumeName': self._serialize.url("volume_name", volume_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'SnapshotPatch') + + # Construct and send request + 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]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + + def _delete_initial( self, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): # Construct URL