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..052bbf8d5160 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -0,0 +1,80 @@ +# 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 .operation_list_result_py3 import OperationListResult + from .net_app_account_py3 import NetAppAccount + from .net_app_account_list_py3 import NetAppAccountList + from .net_app_account_patch_py3 import NetAppAccountPatch + from .capacity_pool_py3 import CapacityPool + from .capacity_pool_list_py3 import CapacityPoolList + from .capacity_pool_patch_py3 import CapacityPoolPatch + from .volume_py3 import Volume + from .volume_list_py3 import VolumeList + from .volume_patch_py3 import VolumePatch + from .mount_target_py3 import MountTarget + from .mount_target_list_py3 import MountTargetList + from .snapshot_py3 import Snapshot + from .snapshots_list_py3 import SnapshotsList + 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 .operation_list_result import OperationListResult + from .net_app_account import NetAppAccount + from .net_app_account_list import NetAppAccountList + from .net_app_account_patch import NetAppAccountPatch + from .capacity_pool import CapacityPool + from .capacity_pool_list import CapacityPoolList + from .capacity_pool_patch import CapacityPoolPatch + from .volume import Volume + from .volume_list import VolumeList + from .volume_patch import VolumePatch + from .mount_target import MountTarget + from .mount_target_list import MountTargetList + from .snapshot import Snapshot + from .snapshots_list import SnapshotsList + from .error import Error, ErrorException +from .azure_net_app_files_management_client_enums import ( + ServiceLevel, +) + +__all__ = [ + 'OperationDisplay', + 'Dimension', + 'MetricSpecification', + 'ServiceSpecification', + 'Operation', + 'OperationListResult', + 'NetAppAccount', + 'NetAppAccountList', + 'NetAppAccountPatch', + 'CapacityPool', + 'CapacityPoolList', + 'CapacityPoolPatch', + 'Volume', + 'VolumeList', + 'VolumePatch', + 'MountTarget', + 'MountTargetList', + 'Snapshot', + 'SnapshotsList', + 'Error', 'ErrorException', + '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..7caf3b703991 --- /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): + + basic = "Basic" #: Basic service level + standard = "Standard" #: Standard service level + premium = "Premium" #: Premium 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..5e5b0d69f334 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py @@ -0,0 +1,84 @@ +# 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 + :param account_id: Required. accountId. UUID v4 used to identify the + Account + :type account_id: str + :ivar pool_id: poolId. UUID v4 used to identify the Pool + :vartype pool_id: str + :param size: size. Provisioned size of the pool (in GB). Default value: + 4096 . + :type size: int + :param service_level: serviceLevel. The service level of the file system. + Possible values include: 'Basic', 'Standard', 'Premium'. Default value: + "Standard" . + :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}, + 'account_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'pool_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'size': {'minimum': 4096}, + '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'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'pool_id': {'key': 'properties.poolId', 'type': 'str'}, + 'size': {'key': 'properties.size', 'type': 'int'}, + '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.account_id = kwargs.get('account_id', None) + self.pool_id = None + self.size = kwargs.get('size', 4096) + self.service_level = kwargs.get('service_level', "Standard") + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.py new file mode 100644 index 000000000000..14286d1639dd --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.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 CapacityPoolList(Model): + """List of capacity pool resources. + + :param value: List of Capacity pools + :type value: list[~azure.mgmt.netapp.models.CapacityPool] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CapacityPool]'}, + } + + def __init__(self, **kwargs): + super(CapacityPoolList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list_py3.py new file mode 100644 index 000000000000..ea1580e14806 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list_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 CapacityPoolList(Model): + """List of capacity pool resources. + + :param value: List of Capacity pools + :type value: list[~azure.mgmt.netapp.models.CapacityPool] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CapacityPool]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(CapacityPoolList, self).__init__(**kwargs) + self.value = value 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..f40cb61a08d0 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py @@ -0,0 +1,84 @@ +# 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 + :param account_id: Required. accountId. UUID v4 used to identify the + Account + :type account_id: str + :ivar pool_id: poolId. UUID v4 used to identify the Pool + :vartype pool_id: str + :param size: size. Provisioned size of the pool (in GB). Default value: + 4096 . + :type size: int + :param service_level: serviceLevel. The service level of the file system. + Possible values include: 'Basic', 'Standard', 'Premium'. Default value: + "Standard" . + :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}, + 'account_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'pool_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'size': {'minimum': 4096}, + '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'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'pool_id': {'key': 'properties.poolId', 'type': 'str'}, + 'size': {'key': 'properties.size', 'type': 'int'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, account_id: str, tags=None, size: int=4096, service_level="Standard", **kwargs) -> None: + super(CapacityPool, self).__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.type = None + self.tags = tags + self.account_id = account_id + 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..0a0cdaf75da7 --- /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, possiblly 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..6845aa528b4b --- /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, possiblly 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..0265a9071c7d --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py @@ -0,0 +1,102 @@ +# 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 targets's IPv4 address + :vartype ip_address: str + :ivar name1: name. The name of the mount target + :vartype name1: 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}, + 'name1': {'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'}, + 'name1': {'key': 'properties.name', '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.name1 = 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_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list.py new file mode 100644 index 000000000000..7eb46f9d5c8c --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list.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 MountTargetList(Model): + """List of Mount Targets. + + :param value: A list of Mount targets + :type value: list[~azure.mgmt.netapp.models.MountTarget] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MountTarget]'}, + } + + def __init__(self, **kwargs): + super(MountTargetList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list_py3.py new file mode 100644 index 000000000000..a2cb29128968 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list_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 MountTargetList(Model): + """List of Mount Targets. + + :param value: A list of Mount targets + :type value: list[~azure.mgmt.netapp.models.MountTarget] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MountTarget]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(MountTargetList, self).__init__(**kwargs) + self.value = value 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..e4b9674bb12c --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py @@ -0,0 +1,102 @@ +# 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 targets's IPv4 address + :vartype ip_address: str + :ivar name1: name. The name of the mount target + :vartype name1: 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}, + 'name1': {'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'}, + 'name1': {'key': 'properties.name', '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.name1 = 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..00502b42fd93 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py @@ -0,0 +1,66 @@ +# 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 account_id: accountId. UUID v4 used to identify the Account + :vartype account_id: str + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'account_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}$'}, + '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'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + '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.account_id = None + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list.py new file mode 100644 index 000000000000..1583fcfc9333 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list.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 NetAppAccountList(Model): + """List of NetApp account resources. + + :param value: Multiple NetApp accounts + :type value: list[~azure.mgmt.netapp.models.NetAppAccount] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetAppAccount]'}, + } + + def __init__(self, **kwargs): + super(NetAppAccountList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list_py3.py new file mode 100644 index 000000000000..db06d6cf4d8e --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list_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 NetAppAccountList(Model): + """List of NetApp account resources. + + :param value: Multiple NetApp accounts + :type value: list[~azure.mgmt.netapp.models.NetAppAccount] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetAppAccount]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(NetAppAccountList, self).__init__(**kwargs) + self.value = value 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..94a66341a19f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py @@ -0,0 +1,66 @@ +# 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 account_id: accountId. UUID v4 used to identify the Account + :vartype account_id: str + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'account_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}$'}, + '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'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + '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.account_id = None + 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_list_result.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result.py new file mode 100644 index 000000000000..3d3863e7cf70 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result.py @@ -0,0 +1,30 @@ +# 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 OperationListResult(Model): + """Result of the request to list Cloud Volume operations. It contains a list + of operations and a URL link to get the next set of results. + + :param value: List of Storage operations supported by the Storage resource + provider. + :type value: list[~azure.mgmt.netapp.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, **kwargs): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result_py3.py new file mode 100644 index 000000000000..0a21dd4cf082 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result_py3.py @@ -0,0 +1,30 @@ +# 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 OperationListResult(Model): + """Result of the request to list Cloud Volume operations. It contains a list + of operations and a URL link to get the next set of results. + + :param value: List of Storage operations supported by the Storage resource + provider. + :type value: list[~azure.mgmt.netapp.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(OperationListResult, self).__init__(**kwargs) + self.value = value 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..13f58b4786a6 --- /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 + :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 name1: name. The name of the snapshot + :vartype name1: 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}, + 'snapshot_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'file_system_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'name1': {'readonly': True}, + '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'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, + 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'name1': {'key': 'properties.name', '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.tags = kwargs.get('tags', None) + self.snapshot_id = None + self.file_system_id = kwargs.get('file_system_id', None) + self.name1 = None + self.creation_date = None + self.provisioning_state = None 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..0e173d72628f --- /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 + :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 name1: name. The name of the snapshot + :vartype name1: 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}, + 'snapshot_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'file_system_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'name1': {'readonly': True}, + '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'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, + 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, + 'name1': {'key': 'properties.name', '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.tags = tags + self.snapshot_id = None + self.file_system_id = file_system_id + self.name1 = None + self.creation_date = None + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.py new file mode 100644 index 000000000000..9ec53fa2a6ea --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.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 SnapshotsList(Model): + """List of Snapshots. + + :param value: A list of Snapshots + :type value: list[~azure.mgmt.netapp.models.Snapshot] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + } + + def __init__(self, **kwargs): + super(SnapshotsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list_py3.py new file mode 100644 index 000000000000..7c9e2a4e4917 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list_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 SnapshotsList(Model): + """List of Snapshots. + + :param value: A list of Snapshots + :type value: list[~azure.mgmt.netapp.models.Snapshot] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(SnapshotsList, self).__init__(**kwargs) + self.value = value 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..0c2a513961de --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -0,0 +1,90 @@ +# 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 name1: FileSystem name. FileSystem name + :type name1: str + :param creation_token: Required. Creation Token or File Path. A unique + file path for the volume. Used when creating mount targets + :type creation_token: str + :param service_level: Required. serviceLevel. The service level of the + file system. Possible values include: 'Basic', 'Standard', 'Premium'. + Default value: "Standard" . + :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel + :param usage_threshold: usageThreshold. Maximum storage quota allowed for + a file system in bytes. This is a soft quota used for alerting only. Upper + limit is 100TB. Default value: 0 . + :type usage_threshold: long + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: 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': 0}, + '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'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, + 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + 'provisioning_state': {'key': 'properties.provisioningState', '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.name1 = kwargs.get('name1', None) + self.creation_token = kwargs.get('creation_token', None) + self.service_level = kwargs.get('service_level', "Standard") + self.usage_threshold = kwargs.get('usage_threshold', 0) + self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py new file mode 100644 index 000000000000..c2c603cb9045 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.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 VolumeList(Model): + """List of volume resources. + + :param value: List of volumes + :type value: list[~azure.mgmt.netapp.models.Volume] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Volume]'}, + } + + def __init__(self, **kwargs): + super(VolumeList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list_py3.py new file mode 100644 index 000000000000..17cac5dfdde1 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list_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 VolumeList(Model): + """List of volume resources. + + :param value: List of volumes + :type value: list[~azure.mgmt.netapp.models.Volume] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Volume]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(VolumeList, self).__init__(**kwargs) + self.value = value 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..4b1f753cf88f --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py @@ -0,0 +1,70 @@ +# 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 name1: FileSystem name. FileSystem name + :type name1: str + :param service_level: serviceLevel. The service level of the file system. + Possible values include: 'Basic', 'Standard', 'Premium'. Default value: + "Standard" . + :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel + :param usage_threshold: usageThreshold. Maximum storage quota allowed for + a file system in bytes. This is a soft quota used for alerting only. Upper + limit is 100TB. Default value: 0 . + :type usage_threshold: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + } + + _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'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, + '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.name1 = kwargs.get('name1', None) + self.service_level = kwargs.get('service_level', "Standard") + self.usage_threshold = kwargs.get('usage_threshold', 0) 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..b23fc94ecf43 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py @@ -0,0 +1,70 @@ +# 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 name1: FileSystem name. FileSystem name + :type name1: str + :param service_level: serviceLevel. The service level of the file system. + Possible values include: 'Basic', 'Standard', 'Premium'. Default value: + "Standard" . + :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel + :param usage_threshold: usageThreshold. Maximum storage quota allowed for + a file system in bytes. This is a soft quota used for alerting only. Upper + limit is 100TB. Default value: 0 . + :type usage_threshold: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + } + + _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'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + } + + def __init__(self, *, location: str=None, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, **kwargs) -> None: + super(VolumePatch, self).__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.type = None + self.tags = tags + self.name1 = name1 + 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..6fe5d78caa18 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -0,0 +1,90 @@ +# 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 name1: FileSystem name. FileSystem name + :type name1: str + :param creation_token: Required. Creation Token or File Path. A unique + file path for the volume. Used when creating mount targets + :type creation_token: str + :param service_level: Required. serviceLevel. The service level of the + file system. Possible values include: 'Basic', 'Standard', 'Premium'. + Default value: "Standard" . + :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel + :param usage_threshold: usageThreshold. Maximum storage quota allowed for + a file system in bytes. This is a soft quota used for alerting only. Upper + limit is 100TB. Default value: 0 . + :type usage_threshold: long + :ivar provisioning_state: Azure lifecycle management + :vartype provisioning_state: 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': 0}, + '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'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, + 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, + 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, + 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_token: str, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, **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.name1 = name1 + self.creation_token = creation_token + self.service_level = service_level + self.usage_threshold = usage_threshold + self.provisioning_state = None 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..4ac6ded547d0 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py @@ -0,0 +1,409 @@ +# 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: NetAppAccountList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.NetAppAccountList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + + # 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('NetAppAccountList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{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}/resourceGroup/{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 [200, 202]: + 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 + + 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}/resourceGroup/{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}/resourceGroup/{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}/resourceGroup/{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..7634d45e4de1 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py @@ -0,0 +1,266 @@ +# 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 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: MountTargetList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.MountTargetList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + + # 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('MountTargetList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/mountTargets'} + + def get( + self, resource_group, account_name, pool_name, volume_name, mount_target_name, custom_headers=None, raw=False, **operation_config): + """Get a mount target. + + :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 mount_target_name: The name of the mount target + :type mount_target_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: MountTarget or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.MountTarget 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'), + 'mountTargetName': self._serialize.url("mount_target_name", mount_target_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('MountTarget', 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}/pools/{poolName}/volumes/{volumeName}/mountTargets/{mountTargetName}'} + + + def _delete_initial( + self, resource_group, account_name, pool_name, volume_name, mount_target_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'), + 'mountTargetName': self._serialize.url("mount_target_name", mount_target_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, mount_target_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete mount target. + + :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 mount_target_name: The name of the mount target + :type mount_target_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, + mount_target_name=mount_target_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}/pools/{poolName}/volumes/{volumeName}/mountTargets/{mountTargetName}'} 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..033a61b89a6b --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py @@ -0,0 +1,88 @@ +# 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: OperationListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.OperationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + + # 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('OperationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + 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..2222fc93a6ca --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py @@ -0,0 +1,422 @@ +# 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: CapacityPoolList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.CapacityPoolList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + + # 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('CapacityPoolList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools'} + + 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}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{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, 202]: + 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 + + 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}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{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}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{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}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{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..76f13af587d9 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py @@ -0,0 +1,266 @@ +# 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: SnapshotsList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.SnapshotsList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + + # 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('SnapshotsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{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}/pools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + + + def _delete_initial( + self, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + 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}/pools/{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..235021e71108 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py @@ -0,0 +1,436 @@ +# 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: VolumeList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.VolumeList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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') + + # 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('VolumeList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{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}/pools/{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, 202]: + 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 + + 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}/pools/{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}/pools/{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}/pools/{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..a39916c162ce --- /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 = "1.0.0" +