From a7d44709843fbdc02fadad377b0136a315642df8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 27 Aug 2018 16:21:52 -0700 Subject: [PATCH 01/10] [AutoPR netapp/resource-manager] Microsoft.NetApp first version (#3144) * Generated from c82f7e0779efda2a9a97a99664679711ce8d7e73 Microsoft.NetApp first version * Generated from 51268a3aa9892dabce143e347f225bf74be4cc49 Addressing pullrequest comments --- .../azure/mgmt/netapp/__init__.py | 18 + .../azure_net_app_files_management_client.py | 110 +++++ .../azure/mgmt/netapp/models/__init__.py | 80 ++++ ...e_net_app_files_management_client_enums.py | 19 + .../azure/mgmt/netapp/models/capacity_pool.py | 84 ++++ .../mgmt/netapp/models/capacity_pool_list.py | 28 ++ .../netapp/models/capacity_pool_list_py3.py | 28 ++ .../mgmt/netapp/models/capacity_pool_patch.py | 28 ++ .../netapp/models/capacity_pool_patch_py3.py | 28 ++ .../mgmt/netapp/models/capacity_pool_py3.py | 84 ++++ .../azure/mgmt/netapp/models/dimension.py | 32 ++ .../azure/mgmt/netapp/models/dimension_py3.py | 32 ++ .../azure/mgmt/netapp/models/error.py | 52 +++ .../azure/mgmt/netapp/models/error_py3.py | 52 +++ .../netapp/models/metric_specification.py | 63 +++ .../netapp/models/metric_specification_py3.py | 63 +++ .../azure/mgmt/netapp/models/mount_target.py | 102 ++++ .../mgmt/netapp/models/mount_target_list.py | 28 ++ .../netapp/models/mount_target_list_py3.py | 28 ++ .../mgmt/netapp/models/mount_target_py3.py | 102 ++++ .../mgmt/netapp/models/net_app_account.py | 66 +++ .../netapp/models/net_app_account_list.py | 28 ++ .../netapp/models/net_app_account_list_py3.py | 28 ++ .../netapp/models/net_app_account_patch.py | 28 ++ .../models/net_app_account_patch_py3.py | 28 ++ .../mgmt/netapp/models/net_app_account_py3.py | 66 +++ .../azure/mgmt/netapp/models/operation.py | 42 ++ .../mgmt/netapp/models/operation_display.py | 40 ++ .../netapp/models/operation_display_py3.py | 40 ++ .../netapp/models/operation_list_result.py | 30 ++ .../models/operation_list_result_py3.py | 30 ++ .../azure/mgmt/netapp/models/operation_py3.py | 42 ++ .../netapp/models/service_specification.py | 29 ++ .../models/service_specification_py3.py | 29 ++ .../azure/mgmt/netapp/models/snapshot.py | 77 ++++ .../azure/mgmt/netapp/models/snapshot_py3.py | 77 ++++ .../mgmt/netapp/models/snapshots_list.py | 28 ++ .../mgmt/netapp/models/snapshots_list_py3.py | 28 ++ .../azure/mgmt/netapp/models/volume.py | 90 ++++ .../azure/mgmt/netapp/models/volume_list.py | 28 ++ .../mgmt/netapp/models/volume_list_py3.py | 28 ++ .../azure/mgmt/netapp/models/volume_patch.py | 70 +++ .../mgmt/netapp/models/volume_patch_py3.py | 70 +++ .../azure/mgmt/netapp/models/volume_py3.py | 90 ++++ .../azure/mgmt/netapp/operations/__init__.py | 26 ++ .../netapp/operations/accounts_operations.py | 409 ++++++++++++++++ .../operations/mount_targets_operations.py | 266 +++++++++++ .../mgmt/netapp/operations/operations.py | 88 ++++ .../netapp/operations/pools_operations.py | 422 +++++++++++++++++ .../netapp/operations/snapshots_operations.py | 266 +++++++++++ .../netapp/operations/volumes_operations.py | 436 ++++++++++++++++++ .../azure/mgmt/netapp/version.py | 13 + 52 files changed, 4099 insertions(+) create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/__init__.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_patch.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_patch_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/error.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/metric_specification_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_patch_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_display_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/service_specification_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/version.py 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" + From 52a69dddd600917fe8a96852bf4781a9b4e376e9 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 12 Sep 2018 09:10:06 -0700 Subject: [PATCH 02/10] [AutoPR netapp/resource-manager] NetApp adding subnetId to volume properties (#3321) * Generated from 37a648d4d8bbc6b77cc7cbc25b55f95f0b65b9fa NetApp adding subnetId to volume properties * Packaging update of azure-mgmt-netapp --- azure-mgmt-netapp/HISTORY.rst | 9 ++ azure-mgmt-netapp/MANIFEST.in | 2 + azure-mgmt-netapp/README.rst | 49 +++++++++++ azure-mgmt-netapp/azure/__init__.py | 1 + azure-mgmt-netapp/azure/mgmt/__init__.py | 1 + .../azure/mgmt/netapp/models/volume.py | 5 ++ .../azure/mgmt/netapp/models/volume_py3.py | 7 +- azure-mgmt-netapp/azure_bdist_wheel.py | 54 ++++++++++++ azure-mgmt-netapp/sdk_packaging.toml | 6 ++ azure-mgmt-netapp/setup.cfg | 3 + azure-mgmt-netapp/setup.py | 86 +++++++++++++++++++ 11 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 azure-mgmt-netapp/HISTORY.rst create mode 100644 azure-mgmt-netapp/MANIFEST.in create mode 100644 azure-mgmt-netapp/README.rst create mode 100644 azure-mgmt-netapp/azure/__init__.py create mode 100644 azure-mgmt-netapp/azure/mgmt/__init__.py create mode 100644 azure-mgmt-netapp/azure_bdist_wheel.py create mode 100644 azure-mgmt-netapp/sdk_packaging.toml create mode 100644 azure-mgmt-netapp/setup.cfg create mode 100644 azure-mgmt-netapp/setup.py diff --git a/azure-mgmt-netapp/HISTORY.rst b/azure-mgmt-netapp/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-netapp/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-netapp/MANIFEST.in b/azure-mgmt-netapp/MANIFEST.in new file mode 100644 index 000000000000..9ecaeb15de50 --- /dev/null +++ b/azure-mgmt-netapp/MANIFEST.in @@ -0,0 +1,2 @@ +include *.rst +include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-netapp/README.rst b/azure-mgmt-netapp/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-netapp/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-netapp/azure/__init__.py b/azure-mgmt-netapp/azure/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/azure-mgmt-netapp/azure/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/azure-mgmt-netapp/azure/mgmt/__init__.py b/azure-mgmt-netapp/azure/mgmt/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py index 0c2a513961de..0326cf38a2f2 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -47,6 +47,9 @@ class Volume(Model): :type usage_threshold: long :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have + the delegation Microsoft.NetApp/volumes + :type subnet_id: str """ _validation = { @@ -73,6 +76,7 @@ class Volume(Model): 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -88,3 +92,4 @@ def __init__(self, **kwargs): self.service_level = kwargs.get('service_level', "Standard") self.usage_threshold = kwargs.get('usage_threshold', 0) self.provisioning_state = None + self.subnet_id = kwargs.get('subnet_id', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py index 6fe5d78caa18..6e629373d946 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -47,6 +47,9 @@ class Volume(Model): :type usage_threshold: long :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have + the delegation Microsoft.NetApp/volumes + :type subnet_id: str """ _validation = { @@ -73,9 +76,10 @@ class Volume(Model): 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } - def __init__(self, *, location: str, creation_token: str, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, **kwargs) -> None: + def __init__(self, *, location: str, creation_token: str, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, subnet_id: str=None, **kwargs) -> None: super(Volume, self).__init__(**kwargs) self.location = location self.id = None @@ -88,3 +92,4 @@ def __init__(self, *, location: str, creation_token: str, tags=None, name1: str= self.service_level = service_level self.usage_threshold = usage_threshold self.provisioning_state = None + self.subnet_id = subnet_id diff --git a/azure-mgmt-netapp/azure_bdist_wheel.py b/azure-mgmt-netapp/azure_bdist_wheel.py new file mode 100644 index 000000000000..8a81d1b61775 --- /dev/null +++ b/azure-mgmt-netapp/azure_bdist_wheel.py @@ -0,0 +1,54 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +from distutils import log as logger +import os.path + +from wheel.bdist_wheel import bdist_wheel +class azure_bdist_wheel(bdist_wheel): + """The purpose of this class is to build wheel a little differently than the sdist, + without requiring to build the wheel from the sdist (i.e. you can build the wheel + directly from source). + """ + + description = "Create an Azure wheel distribution" + + user_options = bdist_wheel.user_options + \ + [('azure-namespace-package=', None, + "Name of the deepest nspkg used")] + + def initialize_options(self): + bdist_wheel.initialize_options(self) + self.azure_namespace_package = None + + def finalize_options(self): + bdist_wheel.finalize_options(self) + if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): + raise ValueError("azure_namespace_package must finish by -nspkg") + + def run(self): + if not self.distribution.install_requires: + self.distribution.install_requires = [] + self.distribution.install_requires.append( + "{}>=2.0.0".format(self.azure_namespace_package)) + bdist_wheel.run(self) + + def write_record(self, bdist_dir, distinfo_dir): + if self.azure_namespace_package: + # Split and remove last part, assuming it's "nspkg" + subparts = self.azure_namespace_package.split('-')[0:-1] + folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] + for azure_sub_package in folder_with_init: + init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') + if os.path.isfile(init_file): + logger.info("manually remove {} while building the wheel".format(init_file)) + os.remove(init_file) + else: + raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) + bdist_wheel.write_record(self, bdist_dir, distinfo_dir) +cmdclass = { + 'bdist_wheel': azure_bdist_wheel, +} diff --git a/azure-mgmt-netapp/sdk_packaging.toml b/azure-mgmt-netapp/sdk_packaging.toml new file mode 100644 index 000000000000..9c3b943d9ab4 --- /dev/null +++ b/azure-mgmt-netapp/sdk_packaging.toml @@ -0,0 +1,6 @@ +[packaging] +package_name = "azure-mgmt-netapp" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-netapp/setup.cfg b/azure-mgmt-netapp/setup.cfg new file mode 100644 index 000000000000..856f4164982c --- /dev/null +++ b/azure-mgmt-netapp/setup.cfg @@ -0,0 +1,3 @@ +[bdist_wheel] +universal=1 +azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-netapp/setup.py b/azure-mgmt-netapp/setup.py new file mode 100644 index 000000000000..2571650684fd --- /dev/null +++ b/azure-mgmt-netapp/setup.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + cmdclass = {} + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-netapp" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=["tests"]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + cmdclass=cmdclass +) From 53cf80c943e07cfbc318e05e25ed729e3656f425 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 21 Nov 2018 13:22:44 -0800 Subject: [PATCH 03/10] [AutoPR netapp/resource-manager] NetApp RP minor update and validation fixes (#3839) * Generated from 4535ffbe9b0b3be960171b9c8efcdb042f34ce64 Merge pull request #1 from leonardbf/netapp-api-update-public NFSAAS-1505 minor update and validation fixes * Packaging update of azure-mgmt-netapp --- azure-mgmt-netapp/MANIFEST.in | 4 +- azure-mgmt-netapp/azure/__init__.py | 2 +- azure-mgmt-netapp/azure/mgmt/__init__.py | 2 +- .../azure/mgmt/netapp/models/__init__.py | 30 ++- ...ool_list_py3.py => capacity_pool_paged.py} | 19 +- ...ity_pool_list.py => mount_target_paged.py} | 19 +- .../netapp/models/net_app_account_list.py | 28 --- .../netapp/models/net_app_account_list_py3.py | 28 --- ...t_list_py3.py => net_app_account_paged.py} | 19 +- .../netapp/models/operation_list_result.py | 30 --- .../models/operation_list_result_py3.py | 30 --- ...ount_target_list.py => operation_paged.py} | 19 +- .../{snapshots_list.py => snapshot_paged.py} | 19 +- .../azure/mgmt/netapp/models/volume_list.py | 28 --- .../mgmt/netapp/models/volume_list_py3.py | 28 --- ...{snapshots_list_py3.py => volume_paged.py} | 19 +- .../netapp/operations/accounts_operations.py | 82 ++++---- .../operations/mount_targets_operations.py | 180 +++++------------- .../mgmt/netapp/operations/operations.py | 60 +++--- .../netapp/operations/pools_operations.py | 84 ++++---- .../netapp/operations/snapshots_operations.py | 88 +++++---- .../netapp/operations/volumes_operations.py | 86 +++++---- azure-mgmt-netapp/azure_bdist_wheel.py | 54 ------ azure-mgmt-netapp/setup.cfg | 1 - azure-mgmt-netapp/setup.py | 17 +- 25 files changed, 348 insertions(+), 628 deletions(-) rename azure-mgmt-netapp/azure/mgmt/netapp/models/{capacity_pool_list_py3.py => capacity_pool_paged.py} (54%) rename azure-mgmt-netapp/azure/mgmt/netapp/models/{capacity_pool_list.py => mount_target_paged.py} (55%) delete mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list.py delete mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list_py3.py rename azure-mgmt-netapp/azure/mgmt/netapp/models/{mount_target_list_py3.py => net_app_account_paged.py} (54%) delete mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result.py delete mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result_py3.py rename azure-mgmt-netapp/azure/mgmt/netapp/models/{mount_target_list.py => operation_paged.py} (55%) rename azure-mgmt-netapp/azure/mgmt/netapp/models/{snapshots_list.py => snapshot_paged.py} (56%) delete mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py delete mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list_py3.py rename azure-mgmt-netapp/azure/mgmt/netapp/models/{snapshots_list_py3.py => volume_paged.py} (56%) delete mode 100644 azure-mgmt-netapp/azure_bdist_wheel.py diff --git a/azure-mgmt-netapp/MANIFEST.in b/azure-mgmt-netapp/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-netapp/MANIFEST.in +++ b/azure-mgmt-netapp/MANIFEST.in @@ -1,2 +1,4 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-netapp/azure/__init__.py b/azure-mgmt-netapp/azure/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-netapp/azure/__init__.py +++ b/azure-mgmt-netapp/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-netapp/azure/mgmt/__init__.py b/azure-mgmt-netapp/azure/mgmt/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-netapp/azure/mgmt/__init__.py +++ b/azure-mgmt-netapp/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index 052bbf8d5160..be2af98b41a5 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -15,20 +15,14 @@ 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 @@ -36,21 +30,21 @@ 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 .operation_paged import OperationPaged +from .net_app_account_paged import NetAppAccountPaged +from .capacity_pool_paged import CapacityPoolPaged +from .volume_paged import VolumePaged +from .mount_target_paged import MountTargetPaged +from .snapshot_paged import SnapshotPaged from .azure_net_app_files_management_client_enums import ( ServiceLevel, ) @@ -61,20 +55,20 @@ 'MetricSpecification', 'ServiceSpecification', 'Operation', - 'OperationListResult', 'NetAppAccount', - 'NetAppAccountList', 'NetAppAccountPatch', 'CapacityPool', - 'CapacityPoolList', 'CapacityPoolPatch', 'Volume', - 'VolumeList', 'VolumePatch', 'MountTarget', - 'MountTargetList', 'Snapshot', - 'SnapshotsList', 'Error', 'ErrorException', + 'OperationPaged', + 'NetAppAccountPaged', + 'CapacityPoolPaged', + 'VolumePaged', + 'MountTargetPaged', + 'SnapshotPaged', 'ServiceLevel', ] 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_paged.py similarity index 54% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list_py3.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_paged.py index ea1580e14806..fa7c435c870d 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_paged.py @@ -9,20 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -class CapacityPoolList(Model): - """List of capacity pool resources. - - :param value: List of Capacity pools - :type value: list[~azure.mgmt.netapp.models.CapacityPool] +class CapacityPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`CapacityPool ` object """ _attribute_map = { - 'value': {'key': 'value', 'type': '[CapacityPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CapacityPool]'} } - def __init__(self, *, value=None, **kwargs) -> None: - super(CapacityPoolList, self).__init__(**kwargs) - self.value = value + def __init__(self, *args, **kwargs): + + super(CapacityPoolPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_paged.py similarity index 55% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_paged.py index 14286d1639dd..8d9983678f24 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_list.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_paged.py @@ -9,20 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -class CapacityPoolList(Model): - """List of capacity pool resources. - - :param value: List of Capacity pools - :type value: list[~azure.mgmt.netapp.models.CapacityPool] +class MountTargetPaged(Paged): + """ + A paging container for iterating over a list of :class:`MountTarget ` object """ _attribute_map = { - 'value': {'key': 'value', 'type': '[CapacityPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MountTarget]'} } - def __init__(self, **kwargs): - super(CapacityPoolList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + def __init__(self, *args, **kwargs): + + super(MountTargetPaged, self).__init__(*args, **kwargs) 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 deleted file mode 100644 index 1583fcfc9333..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 deleted file mode 100644 index db06d6cf4d8e..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_list_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/mount_target_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_paged.py similarity index 54% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list_py3.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_paged.py index a2cb29128968..fd4a719a0737 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_paged.py @@ -9,20 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -class MountTargetList(Model): - """List of Mount Targets. - - :param value: A list of Mount targets - :type value: list[~azure.mgmt.netapp.models.MountTarget] +class NetAppAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`NetAppAccount ` object """ _attribute_map = { - 'value': {'key': 'value', 'type': '[MountTarget]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetAppAccount]'} } - def __init__(self, *, value=None, **kwargs) -> None: - super(MountTargetList, self).__init__(**kwargs) - self.value = value + def __init__(self, *args, **kwargs): + + super(NetAppAccountPaged, self).__init__(*args, **kwargs) 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 deleted file mode 100644 index 3d3863e7cf70..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 deleted file mode 100644 index 0a21dd4cf082..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_list_result_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/mount_target_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_paged.py similarity index 55% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/operation_paged.py index 7eb46f9d5c8c..75776552e32c 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_list.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/operation_paged.py @@ -9,20 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -class MountTargetList(Model): - """List of Mount Targets. - - :param value: A list of Mount targets - :type value: list[~azure.mgmt.netapp.models.MountTarget] +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { - 'value': {'key': 'value', 'type': '[MountTarget]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} } - def __init__(self, **kwargs): - super(MountTargetList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_paged.py similarity index 56% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_paged.py index 9ec53fa2a6ea..95ab3fde9644 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_paged.py @@ -9,20 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -class SnapshotsList(Model): - """List of Snapshots. - - :param value: A list of Snapshots - :type value: list[~azure.mgmt.netapp.models.Snapshot] +class SnapshotPaged(Paged): + """ + A paging container for iterating over a list of :class:`Snapshot ` object """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Snapshot]'} } - def __init__(self, **kwargs): - super(SnapshotsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + def __init__(self, *args, **kwargs): + + super(SnapshotPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py deleted file mode 100644 index c2c603cb9045..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 deleted file mode 100644 index 17cac5dfdde1..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_list_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/snapshots_list_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_paged.py similarity index 56% rename from azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list_py3.py rename to azure-mgmt-netapp/azure/mgmt/netapp/models/volume_paged.py index 7c9e2a4e4917..17d9bd4c9d35 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshots_list_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_paged.py @@ -9,20 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -class SnapshotsList(Model): - """List of Snapshots. - - :param value: A list of Snapshots - :type value: list[~azure.mgmt.netapp.models.Snapshot] +class VolumePaged(Paged): + """ + A paging container for iterating over a list of :class:`Volume ` object """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Volume]'} } - def __init__(self, *, value=None, **kwargs) -> None: - super(SnapshotsList, self).__init__(**kwargs) - self.value = value + def __init__(self, *args, **kwargs): + + super(VolumePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py index 4ac6ded547d0..0e1dfd2f3376 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py @@ -49,48 +49,56 @@ def list( 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 + :return: An iterator like instance of NetAppAccount + :rtype: + ~azure.mgmt.netapp.models.NetAppAccountPaged[~azure.mgmt.netapp.models.NetAppAccount] :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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.NetAppAccountPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.NetAppAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized 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 index 7634d45e4de1..fb1950a35bc2 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py @@ -11,8 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -55,51 +53,59 @@ def list( 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 + :return: An iterator like instance of MountTarget + :rtype: + ~azure.mgmt.netapp.models.MountTargetPaged[~azure.mgmt.netapp.models.MountTarget] :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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str'), + 'volumeName': self._serialize.url("volume_name", volume_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MountTargetPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.MountTargetPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -174,93 +180,3 @@ def get( 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 index 033a61b89a6b..45d58bfbb766 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py @@ -45,43 +45,51 @@ def list( 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 + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.netapp.models.OperationPaged[~azure.mgmt.netapp.models.Operation] :raises: :class:`ErrorException` """ - # Construct URL - url = self.list.metadata['url'] + def internal_paging(next_link=None, raw=False): - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] - # 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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + else: + url = next_link + query_parameters = {} - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + # 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') - deserialized = None + # 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 == 200: - deserialized = self._deserialize('OperationListResult', response) + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py index 2222fc93a6ca..431be201a4be 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py @@ -51,49 +51,57 @@ def list( 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 + :return: An iterator like instance of CapacityPool + :rtype: + ~azure.mgmt.netapp.models.CapacityPoolPaged[~azure.mgmt.netapp.models.CapacityPool] :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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CapacityPoolPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.CapacityPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py index 76f13af587d9..41b6dfea9e52 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py @@ -55,51 +55,59 @@ def list( 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 + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.netapp.models.SnapshotPaged[~azure.mgmt.netapp.models.Snapshot] :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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str'), + 'volumeName': self._serialize.url("volume_name", volume_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py index 235021e71108..38db59f3cd2b 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py @@ -53,50 +53,58 @@ def list( 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 + :return: An iterator like instance of Volume + :rtype: + ~azure.mgmt.netapp.models.VolumePaged[~azure.mgmt.netapp.models.Volume] :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) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VolumePaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.VolumePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized diff --git a/azure-mgmt-netapp/azure_bdist_wheel.py b/azure-mgmt-netapp/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-netapp/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-netapp/setup.cfg b/azure-mgmt-netapp/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-netapp/setup.cfg +++ b/azure-mgmt-netapp/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-netapp/setup.py b/azure-mgmt-netapp/setup.py index 2571650684fd..0bf6776550bd 100644 --- a/azure-mgmt-netapp/setup.py +++ b/azure-mgmt-netapp/setup.py @@ -10,12 +10,6 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-netapp" @@ -76,11 +70,18 @@ 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } ) From e96e982fde48fad98bb3c49b56847cde63c5547e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 3 Dec 2018 14:28:07 -0800 Subject: [PATCH 04/10] Generated from 964e181cc1542e5bec928cbb27ef3d144f24b71e (#3956) typo: netapp/resource-manager/Microsoft.NetApp - possiblly -> possibly - targets's -> target's --- azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py | 2 +- azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py | 2 +- azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py | 2 +- azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py index 0a0cdaf75da7..2398aa46e8f6 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension.py @@ -13,7 +13,7 @@ class Dimension(Model): - """Dimension of blobs, possiblly be blob type or access tier. + """Dimension of blobs, possibly be blob type or access tier. :param name: Display name of dimension. :type name: str diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py index 6845aa528b4b..af5b0aac3d23 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/dimension_py3.py @@ -13,7 +13,7 @@ class Dimension(Model): - """Dimension of blobs, possiblly be blob type or access tier. + """Dimension of blobs, possibly be blob type or access tier. :param name: Display name of dimension. :type name: str diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py index 0265a9071c7d..0434cf874c83 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py @@ -34,7 +34,7 @@ class MountTarget(Model): :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 + :ivar ip_address: ipAddress. The mount target's IPv4 address :vartype ip_address: str :ivar name1: name. The name of the mount target :vartype name1: str 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 index e4b9674bb12c..cb17cb63d9c6 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py @@ -34,7 +34,7 @@ class MountTarget(Model): :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 + :ivar ip_address: ipAddress. The mount target's IPv4 address :vartype ip_address: str :ivar name1: name. The name of the mount target :vartype name1: str From e1ca0d21582f50f63c8b8c31e28c31f9fab2c868 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 5 Dec 2018 03:44:06 -0800 Subject: [PATCH 05/10] [AutoPR netapp/resource-manager] Resource and property changes (#3992) * Generated from 164da1fe5b4cdf8db0afd9f55a08ab523e1c3f0e Merge pull request #4 from leonardbf/netapp-api-update-public NFSAAS-1505 resource and property changes * Generated from 5892e13494715eb9a24653407544e23ddb00efc4 Merge pull request #5 from leonardbf/netapp-api-update-public NFSAAS-1505 status codes --- .../azure/mgmt/netapp/models/__init__.py | 3 + ...e_net_app_files_management_client_enums.py | 2 +- .../azure/mgmt/netapp/models/capacity_pool.py | 25 +-- .../mgmt/netapp/models/capacity_pool_py3.py | 23 +-- .../azure/mgmt/netapp/models/mount_target.py | 5 - .../mgmt/netapp/models/mount_target_py3.py | 5 - .../mgmt/netapp/models/net_app_account.py | 5 - .../mgmt/netapp/models/net_app_account_py3.py | 5 - .../azure/mgmt/netapp/models/snapshot.py | 10 +- .../mgmt/netapp/models/snapshot_patch.py | 28 +++ .../mgmt/netapp/models/snapshot_patch_py3.py | 28 +++ .../azure/mgmt/netapp/models/snapshot_py3.py | 10 +- .../azure/mgmt/netapp/models/volume.py | 19 +- .../azure/mgmt/netapp/models/volume_patch.py | 19 +- .../mgmt/netapp/models/volume_patch_py3.py | 17 +- .../azure/mgmt/netapp/models/volume_py3.py | 17 +- .../netapp/operations/accounts_operations.py | 14 +- .../operations/mount_targets_operations.py | 4 +- .../netapp/operations/pools_operations.py | 14 +- .../netapp/operations/snapshots_operations.py | 195 +++++++++++++++++- .../netapp/operations/volumes_operations.py | 14 +- 21 files changed, 334 insertions(+), 128 deletions(-) create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py create mode 100644 azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index be2af98b41a5..169f7b0f0f3f 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -23,6 +23,7 @@ from .volume_patch_py3 import VolumePatch from .mount_target_py3 import MountTarget from .snapshot_py3 import Snapshot + from .snapshot_patch_py3 import SnapshotPatch from .error_py3 import Error, ErrorException except (SyntaxError, ImportError): from .operation_display import OperationDisplay @@ -38,6 +39,7 @@ from .volume_patch import VolumePatch from .mount_target import MountTarget from .snapshot import Snapshot + from .snapshot_patch import SnapshotPatch from .error import Error, ErrorException from .operation_paged import OperationPaged from .net_app_account_paged import NetAppAccountPaged @@ -63,6 +65,7 @@ 'VolumePatch', 'MountTarget', 'Snapshot', + 'SnapshotPatch', 'Error', 'ErrorException', 'OperationPaged', 'NetAppAccountPaged', diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py index 7caf3b703991..70fe875ab01e 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py @@ -14,6 +14,6 @@ class ServiceLevel(str, Enum): - basic = "Basic" #: Basic service level standard = "Standard" #: Standard service level premium = "Premium" #: Premium service level + extreme = "Extreme" #: Extreme service level diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py index 5e5b0d69f334..3dced303adca 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool.py @@ -30,17 +30,15 @@ class CapacityPool(Model): :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 size: size. Provisioned size of the pool (in bytes). Allowed values + are in 4TiB chunks (value must be multiply of 4398046511104). Default + value: 4398046511104 . + :type size: long :param service_level: serviceLevel. The service level of the file system. - Possible values include: 'Basic', 'Standard', 'Premium'. Default value: - "Standard" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -51,9 +49,8 @@ class CapacityPool(Model): '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}, + 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, 'provisioning_state': {'readonly': True}, } @@ -63,9 +60,8 @@ class CapacityPool(Model): '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'}, + 'size': {'key': 'properties.size', 'type': 'long'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -77,8 +73,7 @@ def __init__(self, **kwargs): 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.size = kwargs.get('size', 4398046511104) + self.service_level = kwargs.get('service_level', "Premium") self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py index f40cb61a08d0..c2ad853f9f16 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/capacity_pool_py3.py @@ -30,17 +30,15 @@ class CapacityPool(Model): :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 size: size. Provisioned size of the pool (in bytes). Allowed values + are in 4TiB chunks (value must be multiply of 4398046511104). Default + value: 4398046511104 . + :type size: long :param service_level: serviceLevel. The service level of the file system. - Possible values include: 'Basic', 'Standard', 'Premium'. Default value: - "Standard" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -51,9 +49,8 @@ class CapacityPool(Model): '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}, + 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, 'provisioning_state': {'readonly': True}, } @@ -63,21 +60,19 @@ class CapacityPool(Model): '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'}, + 'size': {'key': 'properties.size', 'type': 'long'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, location: str, account_id: str, tags=None, size: int=4096, service_level="Standard", **kwargs) -> None: + def __init__(self, *, location: str, tags=None, size: int=4398046511104, service_level="Premium", **kwargs) -> None: super(CapacityPool, self).__init__(**kwargs) self.location = location self.id = None self.name = None self.type = None self.tags = tags - self.account_id = account_id self.pool_id = None self.size = size self.service_level = service_level diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py index 0434cf874c83..e118f00da392 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target.py @@ -36,8 +36,6 @@ class MountTarget(Model): :type file_system_id: str :ivar ip_address: ipAddress. The mount target'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 @@ -63,7 +61,6 @@ class MountTarget(Model): '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}, } @@ -75,7 +72,6 @@ class MountTarget(Model): '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'}, @@ -93,7 +89,6 @@ def __init__(self, **kwargs): 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) 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 index cb17cb63d9c6..b4191609e626 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/mount_target_py3.py @@ -36,8 +36,6 @@ class MountTarget(Model): :type file_system_id: str :ivar ip_address: ipAddress. The mount target'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 @@ -63,7 +61,6 @@ class MountTarget(Model): '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}, } @@ -75,7 +72,6 @@ class MountTarget(Model): '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'}, @@ -93,7 +89,6 @@ def __init__(self, *, location: str, file_system_id: str, tags=None, vlan_id: in 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 diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py index 00502b42fd93..3ec70dc97f92 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py @@ -30,8 +30,6 @@ class NetAppAccount(Model): :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 """ @@ -41,7 +39,6 @@ class NetAppAccount(Model): '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}, } @@ -51,7 +48,6 @@ class NetAppAccount(Model): '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'}, } @@ -62,5 +58,4 @@ def __init__(self, **kwargs): 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_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py index 94a66341a19f..a2d9c5c845a0 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account_py3.py @@ -30,8 +30,6 @@ class NetAppAccount(Model): :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 """ @@ -41,7 +39,6 @@ class NetAppAccount(Model): '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}, } @@ -51,7 +48,6 @@ class NetAppAccount(Model): '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'}, } @@ -62,5 +58,4 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> 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/snapshot.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py index 13f58b4786a6..cb9b70ef4d1a 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py @@ -26,6 +26,8 @@ class Snapshot(Model): :vartype id: str :ivar name: Resource name :vartype name: str + :ivar type: Resource type + :vartype type: str :param tags: Resource tags :type tags: object :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot @@ -33,8 +35,6 @@ class Snapshot(Model): :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 @@ -45,9 +45,9 @@ class Snapshot(Model): 'location': {'required': True}, 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, 'snapshot_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'file_system_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, - 'name1': {'readonly': True}, 'creation_date': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -56,10 +56,10 @@ class Snapshot(Model): 'location': {'key': 'location', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, - 'name1': {'key': 'properties.name', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -69,9 +69,9 @@ def __init__(self, **kwargs): self.location = kwargs.get('location', None) self.id = None self.name = None + self.type = None self.tags = kwargs.get('tags', None) self.snapshot_id = None self.file_system_id = kwargs.get('file_system_id', None) - self.name1 = None self.creation_date = None self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py new file mode 100644 index 000000000000..9ccd3602fab8 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SnapshotPatch(Model): + """Snapshot patch. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(SnapshotPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py new file mode 100644 index 000000000000..61ba55fecf81 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_patch_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SnapshotPatch(Model): + """Snapshot patch. + + :param tags: Resource tags + :type tags: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(SnapshotPatch, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py index 0e173d72628f..ac94c966980f 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py @@ -26,6 +26,8 @@ class Snapshot(Model): :vartype id: str :ivar name: Resource name :vartype name: str + :ivar type: Resource type + :vartype type: str :param tags: Resource tags :type tags: object :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot @@ -33,8 +35,6 @@ class Snapshot(Model): :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 @@ -45,9 +45,9 @@ class Snapshot(Model): 'location': {'required': True}, 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, 'snapshot_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'file_system_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, - 'name1': {'readonly': True}, 'creation_date': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -56,10 +56,10 @@ class Snapshot(Model): 'location': {'key': 'location', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': 'object'}, 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, - 'name1': {'key': 'properties.name', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -69,9 +69,9 @@ def __init__(self, *, location: str, file_system_id: str, tags=None, **kwargs) - self.location = location self.id = None self.name = None + self.type = None self.tags = tags self.snapshot_id = None self.file_system_id = file_system_id - self.name1 = None self.creation_date = None self.provisioning_state = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py index 0326cf38a2f2..2daa2c273f06 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -32,18 +32,17 @@ class Volume(Model): :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" . + file system. Possible values include: 'Standard', 'Premium', 'Extreme'. + Default value: "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -60,7 +59,7 @@ class Volume(Model): 'file_system_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'creation_token': {'required': True}, 'service_level': {'required': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, } @@ -71,7 +70,6 @@ class Volume(Model): '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'}, @@ -87,9 +85,8 @@ def __init__(self, **kwargs): 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.service_level = kwargs.get('service_level', "Premium") + self.usage_threshold = kwargs.get('usage_threshold', 107374182400) self.provisioning_state = None self.subnet_id = kwargs.get('subnet_id', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py index 4b1f753cf88f..a3b5a30bc492 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py @@ -28,15 +28,14 @@ class VolumePatch(Model): :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" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long """ @@ -44,7 +43,7 @@ class VolumePatch(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, } _attribute_map = { @@ -53,7 +52,6 @@ class VolumePatch(Model): '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'}, } @@ -65,6 +63,5 @@ def __init__(self, **kwargs): 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) + self.service_level = kwargs.get('service_level', "Premium") + self.usage_threshold = kwargs.get('usage_threshold', 107374182400) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py index b23fc94ecf43..7d1490e1ef01 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py @@ -28,15 +28,14 @@ class VolumePatch(Model): :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" . + Possible values include: 'Standard', 'Premium', 'Extreme'. Default value: + "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long """ @@ -44,7 +43,7 @@ class VolumePatch(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, } _attribute_map = { @@ -53,18 +52,16 @@ class VolumePatch(Model): '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: + def __init__(self, *, location: str=None, tags=None, service_level="Premium", usage_threshold: int=107374182400, **kwargs) -> None: super(VolumePatch, self).__init__(**kwargs) self.location = location self.id = None self.name = None self.type = None self.tags = tags - self.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 index 6e629373d946..4a282416271f 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -32,18 +32,17 @@ class Volume(Model): :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" . + file system. Possible values include: 'Standard', 'Premium', 'Extreme'. + Default value: "Premium" . :type service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :param usage_threshold: usageThreshold. Maximum storage quota allowed for - a file system in bytes. This is a soft quota used for alerting only. Upper - limit is 100TB. Default value: 0 . + a file system in bytes. This is a soft quota used for alerting only. + Minimum size is 100 GiB. Upper limit is 100TiB. Default value: + 107374182400 . :type usage_threshold: long :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str @@ -60,7 +59,7 @@ class Volume(Model): 'file_system_id': {'readonly': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'creation_token': {'required': True}, 'service_level': {'required': True}, - 'usage_threshold': {'maximum': 109951162777600, 'minimum': 0}, + 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, } @@ -71,7 +70,6 @@ class Volume(Model): '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'}, @@ -79,7 +77,7 @@ class Volume(Model): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } - def __init__(self, *, location: str, creation_token: str, tags=None, name1: str=None, service_level="Standard", usage_threshold: int=0, subnet_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, creation_token: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, subnet_id: str=None, **kwargs) -> None: super(Volume, self).__init__(**kwargs) self.location = location self.id = None @@ -87,7 +85,6 @@ def __init__(self, *, location: str, creation_token: str, tags=None, name1: str= 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 diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py index 0e1dfd2f3376..19addfef5dfe 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py @@ -102,7 +102,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts'} def get( self, resource_group, account_name, custom_headers=None, raw=False, **operation_config): @@ -163,7 +163,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} def _create_or_update_initial( @@ -201,12 +201,12 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [201, 202]: raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: + if response.status_code == 201: deserialized = self._deserialize('NetAppAccount', response) if raw: @@ -267,7 +267,7 @@ def get_long_running_output(response): 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}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} def _delete_initial( @@ -345,7 +345,7 @@ def get_long_running_output(response): 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} def update( self, resource_group, account_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -414,4 +414,4 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py index fb1950a35bc2..dd751b4718b7 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py @@ -109,7 +109,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/mountTargets'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{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): @@ -179,4 +179,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/mountTargets/{mountTargetName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets/{mountTargetName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py index 431be201a4be..a3d8b3f8556f 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py @@ -105,7 +105,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools'} def get( self, resource_group, account_name, pool_name, custom_headers=None, raw=False, **operation_config): @@ -169,7 +169,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} def _create_or_update_initial( @@ -206,12 +206,12 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [201, 202]: raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: + if response.status_code == 201: deserialized = self._deserialize('CapacityPool', response) if raw: @@ -273,7 +273,7 @@ def get_long_running_output(response): 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}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} def update( self, resource_group, account_name, pool_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -345,7 +345,7 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} def _delete_initial( @@ -427,4 +427,4 @@ def get_long_running_output(response): 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py index 41b6dfea9e52..9216a465f1b4 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py @@ -111,7 +111,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/snapshots'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots'} def get( self, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): @@ -181,7 +181,196 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + + + def _create_initial( + self, body, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str'), + 'volumeName': self._serialize.url("volume_name", volume_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'Snapshot') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, body, resource_group, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a snapshot. + + :param body: Snapshot object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.Snapshot + :param resource_group: The name of the resource group. + :type resource_group: str + :param account_name: The name of the NetApp account + :type account_name: str + :param pool_name: The name of the capacity pool + :type pool_name: str + :param volume_name: The name of the volume + :type volume_name: str + :param snapshot_name: The name of the mount target + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Snapshot]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + body=body, + resource_group=resource_group, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} + + def update( + self, resource_group, account_name, pool_name, volume_name, snapshot_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Patch a snapshot. + + :param resource_group: The name of the resource group. + :type resource_group: str + :param account_name: The name of the NetApp account + :type account_name: str + :param pool_name: The name of the capacity pool + :type pool_name: str + :param volume_name: The name of the volume + :type volume_name: str + :param snapshot_name: The name of the mount target + :type snapshot_name: str + :param tags: Resource tags + :type tags: object + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Snapshot or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.Snapshot or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + body = models.SnapshotPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'poolName': self._serialize.url("pool_name", pool_name, 'str'), + 'volumeName': self._serialize.url("volume_name", volume_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'SnapshotPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} def _delete_initial( @@ -271,4 +460,4 @@ def get_long_running_output(response): 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py index 38db59f3cd2b..ef9fffd38c81 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py @@ -108,7 +108,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes'} def get( self, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): @@ -175,7 +175,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} def _create_or_update_initial( @@ -213,12 +213,12 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [201, 202]: raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: + if response.status_code == 201: deserialized = self._deserialize('Volume', response) if raw: @@ -282,7 +282,7 @@ def get_long_running_output(response): 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}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} def update( self, body, resource_group, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +355,7 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/pools/{poolName}/volumes/{volumeName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} def _delete_initial( @@ -441,4 +441,4 @@ def get_long_running_output(response): 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} From 826218c90df16567d2f49dae2857a0faadc5da0e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 13 Dec 2018 16:25:01 -0800 Subject: [PATCH 06/10] Generated from 4f47c60ec82a1eefc22a7524b7dff99624499d67 (#4046) Merge pull request #9 from leonardbf/mt-sc-update NFSAAS-1644 remove mt get add status for put --- .../operations/mount_targets_operations.py | 70 ------------------- .../netapp/operations/pools_operations.py | 4 +- .../netapp/operations/volumes_operations.py | 4 +- 3 files changed, 6 insertions(+), 72 deletions(-) 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 index dd751b4718b7..a900436b7de9 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py @@ -110,73 +110,3 @@ def internal_paging(next_link=None, raw=False): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{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}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets/{mountTargetName}'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py index a3d8b3f8556f..5bf900e3c398 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py @@ -206,11 +206,13 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201, 202]: + if response.status_code not in [200, 201, 202]: raise models.ErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CapacityPool', response) if response.status_code == 201: deserialized = self._deserialize('CapacityPool', response) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py index ef9fffd38c81..c31c39a6abfb 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py @@ -213,11 +213,13 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201, 202]: + if response.status_code not in [200, 201, 202]: raise models.ErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Volume', response) if response.status_code == 201: deserialized = self._deserialize('Volume', response) From e2d4fa15b1740939b269606a87ddd22ef1cfc399 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 2 Jan 2019 15:36:55 -0800 Subject: [PATCH 07/10] Update sdk_packaging.toml --- azure-mgmt-netapp/sdk_packaging.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-netapp/sdk_packaging.toml b/azure-mgmt-netapp/sdk_packaging.toml index 9c3b943d9ab4..bcdd41eac0e2 100644 --- a/azure-mgmt-netapp/sdk_packaging.toml +++ b/azure-mgmt-netapp/sdk_packaging.toml @@ -1,6 +1,6 @@ [packaging] package_name = "azure-mgmt-netapp" -package_pprint_name = "MyService Management" +package_pprint_name = "NetApp Files Management" package_doc_id = "" is_stable = false is_arm = true From 181dd496608e030e0d70e146cfad3167e0665d2c Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Wed, 2 Jan 2019 23:49:40 +0000 Subject: [PATCH 08/10] Packaging update of azure-mgmt-netapp --- azure-mgmt-netapp/README.rst | 4 ++-- azure-mgmt-netapp/setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-mgmt-netapp/README.rst b/azure-mgmt-netapp/README.rst index 45de4e6b43dd..620bb4e0b12e 100644 --- a/azure-mgmt-netapp/README.rst +++ b/azure-mgmt-netapp/README.rst @@ -1,7 +1,7 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure MyService Management Client Library. +This is the Microsoft Azure NetApp Files Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). @@ -36,7 +36,7 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `MyService Management +For code examples, see `NetApp Files Management `__ on docs.microsoft.com. diff --git a/azure-mgmt-netapp/setup.py b/azure-mgmt-netapp/setup.py index 0bf6776550bd..0f9b8f0b81fe 100644 --- a/azure-mgmt-netapp/setup.py +++ b/azure-mgmt-netapp/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-netapp" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "NetApp Files Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') From 9555fa83c5d7e9120f32996a7759a500037c5b22 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 2 Jan 2019 15:57:42 -0800 Subject: [PATCH 09/10] Update version.py --- azure-mgmt-netapp/azure/mgmt/netapp/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/version.py b/azure-mgmt-netapp/azure/mgmt/netapp/version.py index a39916c162ce..e0ec669828cb 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/version.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "0.1.0" From 20d0108db85c6fd3da0ad132c2a72890d583e606 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 2 Jan 2019 16:06:49 -0800 Subject: [PATCH 10/10] Update HISTORY.rst --- azure-mgmt-netapp/HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-netapp/HISTORY.rst b/azure-mgmt-netapp/HISTORY.rst index 8924d5d6c445..aff487fefb26 100644 --- a/azure-mgmt-netapp/HISTORY.rst +++ b/azure-mgmt-netapp/HISTORY.rst @@ -3,7 +3,7 @@ Release History =============== -0.1.0 (1970-01-01) +0.1.0 (2018-01-02) ++++++++++++++++++ * Initial Release