diff --git a/azure-mgmt-netapp/HISTORY.rst b/azure-mgmt-netapp/HISTORY.rst new file mode 100644 index 000000000000..aff487fefb26 --- /dev/null +++ b/azure-mgmt-netapp/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2018-01-02) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-netapp/MANIFEST.in b/azure-mgmt-netapp/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-netapp/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-netapp/README.rst b/azure-mgmt-netapp/README.rst new file mode 100644 index 000000000000..620bb4e0b12e --- /dev/null +++ b/azure-mgmt-netapp/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure NetApp Files Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `NetApp Files Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-netapp/azure/__init__.py b/azure-mgmt-netapp/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-netapp/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-netapp/azure/mgmt/__init__.py b/azure-mgmt-netapp/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py new file mode 100644 index 000000000000..0f7bd5bf8436 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py @@ -0,0 +1,18 @@ +# 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 .azure_net_app_files_management_client import AzureNetAppFilesManagementClient +from .version import VERSION + +__all__ = ['AzureNetAppFilesManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py b/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py new file mode 100644 index 000000000000..f455ceed3ee2 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py @@ -0,0 +1,110 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.accounts_operations import AccountsOperations +from .operations.pools_operations import PoolsOperations +from .operations.volumes_operations import VolumesOperations +from .operations.mount_targets_operations import MountTargetsOperations +from .operations.snapshots_operations import SnapshotsOperations +from . import models + + +class AzureNetAppFilesManagementClientConfiguration(AzureConfiguration): + """Configuration for AzureNetAppFilesManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AzureNetAppFilesManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-netapp/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class AzureNetAppFilesManagementClient(SDKClient): + """Microsoft NetApp Azure Resource Provider specification + + :ivar config: Configuration for client. + :vartype config: AzureNetAppFilesManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.netapp.operations.Operations + :ivar accounts: Accounts operations + :vartype accounts: azure.mgmt.netapp.operations.AccountsOperations + :ivar pools: Pools operations + :vartype pools: azure.mgmt.netapp.operations.PoolsOperations + :ivar volumes: Volumes operations + :vartype volumes: azure.mgmt.netapp.operations.VolumesOperations + :ivar mount_targets: MountTargets operations + :vartype mount_targets: azure.mgmt.netapp.operations.MountTargetsOperations + :ivar snapshots: Snapshots operations + :vartype snapshots: azure.mgmt.netapp.operations.SnapshotsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AzureNetAppFilesManagementClientConfiguration(credentials, subscription_id, base_url) + 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 = '2017-08-15' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.accounts = AccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.pools = PoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.volumes = VolumesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.mount_targets = MountTargetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py new file mode 100644 index 000000000000..169f7b0f0f3f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -0,0 +1,77 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + 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 .volume_py3 import Volume + 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 + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + 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 .volume import Volume + 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 +from .capacity_pool_paged import CapacityPoolPaged +from .volume_paged import VolumePaged +from .mount_target_paged import MountTargetPaged +from .snapshot_paged import SnapshotPaged +from .azure_net_app_files_management_client_enums import ( + ServiceLevel, +) + +__all__ = [ + 'OperationDisplay', + 'Dimension', + 'MetricSpecification', + 'ServiceSpecification', + 'Operation', + 'NetAppAccount', + 'NetAppAccountPatch', + 'CapacityPool', + 'CapacityPoolPatch', + 'Volume', + 'VolumePatch', + 'MountTarget', + 'Snapshot', + 'SnapshotPatch', + 'Error', 'ErrorException', + 'OperationPaged', + 'NetAppAccountPaged', + 'CapacityPoolPaged', + 'VolumePaged', + 'MountTargetPaged', + 'SnapshotPaged', + 'ServiceLevel', +] 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 new file mode 100644 index 000000000000..70fe875ab01e --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py @@ -0,0 +1,19 @@ +# 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 enum import Enum + + +class ServiceLevel(str, Enum): + + 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 new file mode 100644 index 000000000000..3dced303adca --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py @@ -0,0 +1,79 @@ +# 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 CapacityPool(Model): + """Capacity pool resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 pool_id: poolId. UUID v4 used to identify the Pool + :vartype pool_id: str + :param size: size. Provisioned size of the pool (in bytes). Allowed values + are in 4TiB chunks (value must be multiply of 4398046511104). Default + value: 4398046511104 . + :type size: long + :param service_level: serviceLevel. The service level of the file system. + 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 + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'pool_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'pool_id': {'key': 'properties.poolId', 'type': 'str'}, + 'size': {'key': 'properties.size', 'type': 'long'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CapacityPool, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + self.pool_id = None + 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_paged.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_paged.py new file mode 100644 index 000000000000..fa7c435c870d --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class CapacityPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`CapacityPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CapacityPool]'} + } + + def __init__(self, *args, **kwargs): + + super(CapacityPoolPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_patch.py new file mode 100644 index 000000000000..8a9840b47f70 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_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 CapacityPoolPatch(Model): + """Capacity pool patch resource. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(CapacityPoolPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_patch_py3.py new file mode 100644 index 000000000000..92c38df46b26 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_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 CapacityPoolPatch(Model): + """Capacity pool patch resource. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(CapacityPoolPatch, self).__init__(**kwargs) + self.tags = tags 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 new file mode 100644 index 000000000000..c2ad853f9f16 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py @@ -0,0 +1,79 @@ +# 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 CapacityPool(Model): + """Capacity pool resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 pool_id: poolId. UUID v4 used to identify the Pool + :vartype pool_id: str + :param size: size. Provisioned size of the pool (in bytes). Allowed values + are in 4TiB chunks (value must be multiply of 4398046511104). Default + value: 4398046511104 . + :type size: long + :param service_level: serviceLevel. The service level of the file system. + 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 + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'pool_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'pool_id': {'key': 'properties.poolId', 'type': 'str'}, + 'size': {'key': 'properties.size', 'type': 'long'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, size: int=4398046511104, service_level="Premium", **kwargs) -> None: + super(CapacityPool, self).__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.type = None + self.tags = tags + self.pool_id = None + self.size = size + self.service_level = service_level + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py new file mode 100644 index 000000000000..2398aa46e8f6 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py @@ -0,0 +1,32 @@ +# 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 Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py new file mode 100644 index 000000000000..af5b0aac3d23 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py @@ -0,0 +1,32 @@ +# 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 Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/error.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/error.py new file mode 100644 index 000000000000..941e7ebc820f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/error.py @@ -0,0 +1,52 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Error response describing why the operation failed. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code + :type code: str + :param message: Required. Detailed error message + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py new file mode 100644 index 000000000000..1c5b66b42758 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py @@ -0,0 +1,52 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Error response describing why the operation failed. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code + :type code: str + :param message: Required. Detailed error message + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification.py new file mode 100644 index 000000000000..340a905ef641 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification.py @@ -0,0 +1,63 @@ +# 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 MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.netapp.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification_py3.py new file mode 100644 index 000000000000..603882841982 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# 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 MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.netapp.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py new file mode 100644 index 000000000000..e118f00da392 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py @@ -0,0 +1,97 @@ +# 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 MountTarget(Model): + """Mount Target. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :param tags: Resource tags + :type tags: object + :ivar mount_target_id: mountTargetId. UUID v4 used to identify the + MountTarget + :vartype mount_target_id: str + :param file_system_id: Required. fileSystemId. UUID v4 used to identify + the MountTarget + :type file_system_id: str + :ivar ip_address: ipAddress. The mount target's IPv4 address + :vartype ip_address: str + :param vlan_id: vlanid. Vlan Id + :type vlan_id: int + :param start_ip: startIp. The start of IPv4 address range to use when + creating a new mount target + :type start_ip: str + :param end_ip: startIp. The end of IPv4 address range to use when creating + a new mount target + :type end_ip: str + :param gateway: gateway. The gateway of the IPv4 address range to use when + creating a new mount target + :type gateway: str + :param netmask: netmask. The netmask of the IPv4 address range to use when + creating a new mount target + :type netmask: str + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'mount_target_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}$'}, + 'ip_address': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'mount_target_id': {'key': 'properties.mountTargetId', 'type': 'str'}, + 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'start_ip': {'key': 'properties.startIp', 'type': 'str'}, + 'end_ip': {'key': 'properties.endIp', 'type': 'str'}, + 'gateway': {'key': 'properties.gateway', 'type': 'str'}, + 'netmask': {'key': 'properties.netmask', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MountTarget, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = None + self.name = None + self.tags = kwargs.get('tags', None) + self.mount_target_id = None + self.file_system_id = kwargs.get('file_system_id', None) + self.ip_address = None + self.vlan_id = kwargs.get('vlan_id', None) + self.start_ip = kwargs.get('start_ip', None) + self.end_ip = kwargs.get('end_ip', None) + self.gateway = kwargs.get('gateway', None) + self.netmask = kwargs.get('netmask', None) + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_paged.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_paged.py new file mode 100644 index 000000000000..8d9983678f24 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class MountTargetPaged(Paged): + """ + A paging container for iterating over a list of :class:`MountTarget ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MountTarget]'} + } + + def __init__(self, *args, **kwargs): + + super(MountTargetPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py new file mode 100644 index 000000000000..b4191609e626 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py @@ -0,0 +1,97 @@ +# 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 MountTarget(Model): + """Mount Target. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :param tags: Resource tags + :type tags: object + :ivar mount_target_id: mountTargetId. UUID v4 used to identify the + MountTarget + :vartype mount_target_id: str + :param file_system_id: Required. fileSystemId. UUID v4 used to identify + the MountTarget + :type file_system_id: str + :ivar ip_address: ipAddress. The mount target's IPv4 address + :vartype ip_address: str + :param vlan_id: vlanid. Vlan Id + :type vlan_id: int + :param start_ip: startIp. The start of IPv4 address range to use when + creating a new mount target + :type start_ip: str + :param end_ip: startIp. The end of IPv4 address range to use when creating + a new mount target + :type end_ip: str + :param gateway: gateway. The gateway of the IPv4 address range to use when + creating a new mount target + :type gateway: str + :param netmask: netmask. The netmask of the IPv4 address range to use when + creating a new mount target + :type netmask: str + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'mount_target_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}$'}, + 'ip_address': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'mount_target_id': {'key': 'properties.mountTargetId', 'type': 'str'}, + 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'start_ip': {'key': 'properties.startIp', 'type': 'str'}, + 'end_ip': {'key': 'properties.endIp', 'type': 'str'}, + 'gateway': {'key': 'properties.gateway', 'type': 'str'}, + 'netmask': {'key': 'properties.netmask', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, file_system_id: str, tags=None, vlan_id: int=None, start_ip: str=None, end_ip: str=None, gateway: str=None, netmask: str=None, **kwargs) -> None: + super(MountTarget, self).__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.tags = tags + self.mount_target_id = None + self.file_system_id = file_system_id + self.ip_address = None + self.vlan_id = vlan_id + self.start_ip = start_ip + self.end_ip = end_ip + self.gateway = gateway + self.netmask = netmask + self.provisioning_state = None 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 new file mode 100644 index 000000000000..3ec70dc97f92 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py @@ -0,0 +1,61 @@ +# 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 NetAppAccount(Model): + """NetApp account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetAppAccount, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_paged.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_paged.py new file mode 100644 index 000000000000..fd4a719a0737 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class NetAppAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`NetAppAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetAppAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(NetAppAccountPaged, self).__init__(*args, **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 new file mode 100644 index 000000000000..33d4ec3da53c --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_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 NetAppAccountPatch(Model): + """NetApp account patch resource. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(NetAppAccountPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) 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 new file mode 100644 index 000000000000..d42966ff4105 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_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 NetAppAccountPatch(Model): + """NetApp account patch resource. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(NetAppAccountPatch, self).__init__(**kwargs) + self.tags = tags 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 new file mode 100644 index 000000000000..a2d9c5c845a0 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py @@ -0,0 +1,61 @@ +# 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 NetAppAccount(Model): + """NetApp account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(NetAppAccount, self).__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.type = None + self.tags = tags + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation.py new file mode 100644 index 000000000000..928aa9c0a0b6 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation.py @@ -0,0 +1,42 @@ +# 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 Operation(Model): + """Microsoft.NetApp REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.netapp.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.netapp.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display.py new file mode 100644 index 000000000000..e9de65b8880f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft NetApp. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display_py3.py new file mode 100644 index 000000000000..a066121cec71 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft NetApp. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_paged.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_paged.py new file mode 100644 index 000000000000..75776552e32c --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_py3.py new file mode 100644 index 000000000000..a4de32fddd08 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 Operation(Model): + """Microsoft.NetApp REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.netapp.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.netapp.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification.py new file mode 100644 index 000000000000..ad10cc9a95f0 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification.py @@ -0,0 +1,29 @@ +# 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 ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.netapp.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification_py3.py new file mode 100644 index 000000000000..e6ab3038fbee --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# 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 ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.netapp.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py new file mode 100644 index 000000000000..cb9b70ef4d1a --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py @@ -0,0 +1,77 @@ +# 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 Snapshot(Model): + """Snapshot of a Volume. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 + :vartype snapshot_id: str + :param file_system_id: Required. fileSystemId. UUID v4 used to identify + the FileSystem + :type file_system_id: str + :ivar creation_date: name. The creation date of the snapshot + :vartype creation_date: datetime + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + '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}$'}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Snapshot, self).__init__(**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) + self.creation_date = None + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_paged.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_paged.py new file mode 100644 index 000000000000..95ab3fde9644 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class SnapshotPaged(Paged): + """ + A paging container for iterating over a list of :class:`Snapshot ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Snapshot]'} + } + + def __init__(self, *args, **kwargs): + + super(SnapshotPaged, self).__init__(*args, **kwargs) 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 new file mode 100644 index 000000000000..ac94c966980f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py @@ -0,0 +1,77 @@ +# 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 Snapshot(Model): + """Snapshot of a Volume. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 + :vartype snapshot_id: str + :param file_system_id: Required. fileSystemId. UUID v4 used to identify + the FileSystem + :type file_system_id: str + :ivar creation_date: name. The creation date of the snapshot + :vartype creation_date: datetime + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + '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}$'}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, file_system_id: str, tags=None, **kwargs) -> None: + super(Snapshot, self).__init__(**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 + self.creation_date = None + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py new file mode 100644 index 000000000000..2daa2c273f06 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -0,0 +1,92 @@ +# 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 Volume(Model): + """Volume resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 file_system_id: FileSystem ID. Unique FileSystem Identifier. + :vartype file_system_id: 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 + :param service_level: Required. serviceLevel. The service level of the + 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. + 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 + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have + the delegation Microsoft.NetApp/volumes + :type subnet_id: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + '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}$'}, + 'creation_token': {'required': True}, + 'service_level': {'required': True}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Volume, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + self.file_system_id = 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) + self.provisioning_state = None + self.subnet_id = kwargs.get('subnet_id', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_paged.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_paged.py new file mode 100644 index 000000000000..17d9bd4c9d35 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class VolumePaged(Paged): + """ + A paging container for iterating over a list of :class:`Volume ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Volume]'} + } + + def __init__(self, *args, **kwargs): + + super(VolumePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py new file mode 100644 index 000000000000..a3b5a30bc492 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py @@ -0,0 +1,67 @@ +# 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 VolumePatch(Model): + """Volume patch resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location: Resource location + :type location: str + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param tags: Resource tags + :type tags: object + :param service_level: serviceLevel. The service level of the 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. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . + :type usage_threshold: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, + } + + _attribute_map = { + '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'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(VolumePatch, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + 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 new file mode 100644 index 000000000000..7d1490e1ef01 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py @@ -0,0 +1,67 @@ +# 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 VolumePatch(Model): + """Volume patch resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location: Resource location + :type location: str + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param tags: Resource tags + :type tags: object + :param service_level: serviceLevel. The service level of the 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. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . + :type usage_threshold: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, + } + + _attribute_map = { + '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'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + } + + def __init__(self, *, location: str=None, tags=None, service_level="Premium", usage_threshold: int=107374182400, **kwargs) -> None: + super(VolumePatch, self).__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.type = None + self.tags = tags + self.service_level = service_level + self.usage_threshold = usage_threshold diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py new file mode 100644 index 000000000000..4a282416271f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -0,0 +1,92 @@ +# 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 Volume(Model): + """Volume resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Resource location + :type location: str + :ivar id: Resource Id + :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 file_system_id: FileSystem ID. Unique FileSystem Identifier. + :vartype file_system_id: 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 + :param service_level: Required. serviceLevel. The service level of the + 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. + 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 + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have + the delegation Microsoft.NetApp/volumes + :type subnet_id: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + '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}$'}, + 'creation_token': {'required': True}, + 'service_level': {'required': True}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + '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'}, + 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_token: str, tags=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 + self.name = None + self.type = None + self.tags = tags + self.file_system_id = None + self.creation_token = creation_token + self.service_level = service_level + self.usage_threshold = usage_threshold + self.provisioning_state = None + self.subnet_id = subnet_id diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py new file mode 100644 index 000000000000..99c673b8e4d8 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 .operations import Operations +from .accounts_operations import AccountsOperations +from .pools_operations import PoolsOperations +from .volumes_operations import VolumesOperations +from .mount_targets_operations import MountTargetsOperations +from .snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'AccountsOperations', + 'PoolsOperations', + 'VolumesOperations', + 'MountTargetsOperations', + 'SnapshotsOperations', +] diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py new file mode 100644 index 000000000000..19addfef5dfe --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py @@ -0,0 +1,417 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AccountsOperations(object): + """AccountsOperations operations. + + :param client: Client for service requests. + :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: "2017-08-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-15" + + self.config = config + + def list( + self, resource_group, custom_headers=None, raw=False, **operation_config): + """Lists all NetApp accounts in the resource group. + + :param resource_group: The name of the resource group. + :type resource_group: 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: An iterator like instance of NetAppAccount + :rtype: + ~azure.mgmt.netapp.models.NetAppAccountPaged[~azure.mgmt.netapp.models.NetAppAccount] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.NetAppAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetAppAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts'} + + def get( + self, resource_group, account_name, custom_headers=None, raw=False, **operation_config): + """Get the NetApp account. + + :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 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: NetAppAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.NetAppAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.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') + } + 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' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + 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('NetAppAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} + + + def _create_or_update_initial( + self, resource_group, account_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + body = models.NetAppAccount(location=location, tags=tags) + + # Construct URL + url = self.create_or_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') + } + 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, 'NetAppAccount') + + # 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 [201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('NetAppAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group, account_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a NetApp account. + + :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 location: Resource location + :type location: str + :param tags: Resource tags + :type tags: object + :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 NetAppAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.NetAppAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.NetAppAccount]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group=resource_group, + account_name=account_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NetAppAccount', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} + + + def _delete_initial( + self, resource_group, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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') + } + 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 = {} + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a NetApp account. + + :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 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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + resource_group=resource_group, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} + + def update( + self, resource_group, account_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Patch a NetApp account. + + :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 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: NetAppAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.NetAppAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + body = models.NetAppAccountPatch(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') + } + 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, 'NetAppAccountPatch') + + # 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('NetAppAccount', 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}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py new file mode 100644 index 000000000000..a900436b7de9 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py @@ -0,0 +1,112 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MountTargetsOperations(object): + """MountTargetsOperations operations. + + :param client: Client for service requests. + :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: "2017-08-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-15" + + self.config = config + + def list( + self, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + """List mount targets. + + :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 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: An iterator like instance of MountTarget + :rtype: + ~azure.mgmt.netapp.models.MountTargetPaged[~azure.mgmt.netapp.models.MountTarget] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MountTargetPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MountTargetPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py new file mode 100644 index 000000000000..45d58bfbb766 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py @@ -0,0 +1,96 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :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: "2017-08-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-15" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.NetApp Rest API operations. + + :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: An iterator like instance of Operation + :rtype: + ~azure.mgmt.netapp.models.OperationPaged[~azure.mgmt.netapp.models.Operation] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.NetApp/operations'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py new file mode 100644 index 000000000000..5bf900e3c398 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py @@ -0,0 +1,432 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PoolsOperations(object): + """PoolsOperations operations. + + :param client: Client for service requests. + :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: "2017-08-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-15" + + self.config = config + + def list( + self, resource_group, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all capacity pools in the NetApp Account. + + :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 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: An iterator like instance of CapacityPool + :rtype: + ~azure.mgmt.netapp.models.CapacityPoolPaged[~azure.mgmt.netapp.models.CapacityPool] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CapacityPoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CapacityPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools'} + + def get( + self, resource_group, account_name, pool_name, custom_headers=None, raw=False, **operation_config): + """Get a capacity pool. + + :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 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: CapacityPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.CapacityPool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.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') + } + 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' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + 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('CapacityPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} + + + def _create_or_update_initial( + self, body, resource_group, account_name, pool_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_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') + } + 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, 'CapacityPool') + + # 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, 201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CapacityPool', response) + if response.status_code == 201: + deserialized = self._deserialize('CapacityPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, body, resource_group, account_name, pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or Update a capacity pool. + + :param body: Capacity pool object supplied in the body of the + operation. + :type body: ~azure.mgmt.netapp.models.CapacityPool + :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 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 CapacityPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.CapacityPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.CapacityPool]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_or_update_initial( + body=body, + resource_group=resource_group, + account_name=account_name, + pool_name=pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CapacityPool', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} + + def update( + self, resource_group, account_name, pool_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Patch a capacity pool. + + :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 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: CapacityPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.CapacityPool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + body = models.CapacityPoolPatch(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') + } + 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, 'CapacityPoolPatch') + + # 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('CapacityPool', 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}/capacityPools/{poolName}'} + + + def _delete_initial( + self, resource_group, account_name, pool_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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') + } + 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 = {} + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group, account_name, pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a capacity pool. + + :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 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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + resource_group=resource_group, + account_name=account_name, + pool_name=pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py new file mode 100644 index 000000000000..9216a465f1b4 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py @@ -0,0 +1,463 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SnapshotsOperations(object): + """SnapshotsOperations operations. + + :param client: Client for service requests. + :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: "2017-08-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-15" + + self.config = config + + def list( + self, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + """List snapshots. + + :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 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: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.netapp.models.SnapshotPaged[~azure.mgmt.netapp.models.Snapshot] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots'} + + def get( + self, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + """Get 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 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` + """ + # Construct URL + url = self.get.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' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + 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 + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{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 [201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + 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}/capacityPools/{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}/capacityPools/{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 + url = self.delete.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 = {} + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete 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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + 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): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py new file mode 100644 index 000000000000..c31c39a6abfb --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py @@ -0,0 +1,446 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VolumesOperations(object): + """VolumesOperations operations. + + :param client: Client for service requests. + :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: "2017-08-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-15" + + self.config = config + + def list( + self, resource_group, account_name, pool_name, custom_headers=None, raw=False, **operation_config): + """List volumes. + + :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 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: An iterator like instance of Volume + :rtype: + ~azure.mgmt.netapp.models.VolumePaged[~azure.mgmt.netapp.models.Volume] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VolumePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VolumePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes'} + + def get( + self, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + """Get a volume. + + :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 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: Volume or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.Volume or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.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') + } + 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' + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + 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('Volume', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} + + + def _create_or_update_initial( + self, body, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_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') + } + 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, 'Volume') + + # 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, 201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Volume', response) + if response.status_code == 201: + deserialized = self._deserialize('Volume', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, body, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a volume. + + :param body: Volume object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.Volume + :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 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 Volume or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Volume] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Volume]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_or_update_initial( + body=body, + resource_group=resource_group, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Volume', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} + + def update( + self, body, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + """Patch a volume. + + :param body: Volume object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.VolumePatch + :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 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: Volume or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.Volume or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + } + 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, 'VolumePatch') + + # 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('Volume', 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}/capacityPools/{poolName}/volumes/{volumeName}'} + + + def _delete_initial( + self, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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') + } + 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 = {} + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a volume. + + :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 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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + resource_group=resource_group, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/version.py b/azure-mgmt-netapp/azure/mgmt/netapp/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-netapp/sdk_packaging.toml b/azure-mgmt-netapp/sdk_packaging.toml new file mode 100644 index 000000000000..bcdd41eac0e2 --- /dev/null +++ b/azure-mgmt-netapp/sdk_packaging.toml @@ -0,0 +1,6 @@ +[packaging] +package_name = "azure-mgmt-netapp" +package_pprint_name = "NetApp Files Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-netapp/setup.cfg b/azure-mgmt-netapp/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-netapp/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-netapp/setup.py b/azure-mgmt-netapp/setup.py new file mode 100644 index 000000000000..0f9b8f0b81fe --- /dev/null +++ b/azure-mgmt-netapp/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-netapp" +PACKAGE_PPRINT_NAME = "NetApp Files Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)