diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/__init__.py new file mode 100644 index 000000000000..99d07c7fab95 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/__init__.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 ._configuration import StoragePoolManagementConfiguration +from ._storage_pool_management import StoragePoolManagement +__all__ = ['StoragePoolManagement', 'StoragePoolManagementConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/_configuration.py new file mode 100644 index 000000000000..a04247d13f16 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StoragePoolManagementConfiguration(AzureConfiguration): + """Configuration for StoragePoolManagement + 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: The ID of the target subscription. + :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(StoragePoolManagementConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('storagepool/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/_storage_pool_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/_storage_pool_management.py new file mode 100644 index 000000000000..69d883c93882 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/_storage_pool_management.py @@ -0,0 +1,59 @@ +# 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 ._configuration import StoragePoolManagementConfiguration +from .operations import Operations +from .operations import DiskPoolsOperations +from .operations import IscsiTargetsOperations +from . import models + + +class StoragePoolManagement(SDKClient): + """StoragePoolManagement + + :ivar config: Configuration for client. + :vartype config: StoragePoolManagementConfiguration + + :ivar operations: Operations operations + :vartype operations: microsoft.storagepool.operations.Operations + :ivar disk_pools: DiskPools operations + :vartype disk_pools: microsoft.storagepool.operations.DiskPoolsOperations + :ivar iscsi_targets: IscsiTargets operations + :vartype iscsi_targets: microsoft.storagepool.operations.IscsiTargetsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StoragePoolManagementConfiguration(credentials, subscription_id, base_url) + super(StoragePoolManagement, 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 = '2020-03-15-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.disk_pools = DiskPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.iscsi_targets = IscsiTargetsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/__init__.py new file mode 100644 index 000000000000..250cd826e46a --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/__init__.py @@ -0,0 +1,81 @@ +# 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 ._models_py3 import Acl + from ._models_py3 import Attributes + from ._models_py3 import Disk + from ._models_py3 import DiskPool + from ._models_py3 import Error, ErrorException + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import IscsiLun + from ._models_py3 import IscsiTarget + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import StoragePoolOperationDisplay + from ._models_py3 import StoragePoolRPOperation + from ._models_py3 import SystemMetadata + from ._models_py3 import TargetPortalGroup + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import Acl + from ._models import Attributes + from ._models import Disk + from ._models import DiskPool + from ._models import Error, ErrorException + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import IscsiLun + from ._models import IscsiTarget + from ._models import ProxyResource + from ._models import Resource + from ._models import Sku + from ._models import StoragePoolOperationDisplay + from ._models import StoragePoolRPOperation + from ._models import SystemMetadata + from ._models import TargetPortalGroup + from ._models import TrackedResource +from ._paged_models import DiskPoolPaged +from ._paged_models import IscsiTargetPaged +from ._paged_models import StoragePoolRPOperationPaged +from ._storage_pool_management_enums import ( + ProvisioningStates, + OperationalStatus, + SkuTier, +) + +__all__ = [ + 'Acl', + 'Attributes', + 'Disk', + 'DiskPool', + 'Error', 'ErrorException', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'IscsiLun', + 'IscsiTarget', + 'ProxyResource', + 'Resource', + 'Sku', + 'StoragePoolOperationDisplay', + 'StoragePoolRPOperation', + 'SystemMetadata', + 'TargetPortalGroup', + 'TrackedResource', + 'StoragePoolRPOperationPaged', + 'DiskPoolPaged', + 'IscsiTargetPaged', + 'ProvisioningStates', + 'OperationalStatus', + 'SkuTier', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_models.py new file mode 100644 index 000000000000..a65900f1623d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_models.py @@ -0,0 +1,711 @@ +# 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 Acl(Model): + """Access Control List (ACL) for an iSCSI target lun. + + All required parameters must be populated in order to send to Azure. + + :param initiator_iqn: Required. iSCSI initiator iqn (iSCSI Qualified + Name); example: iqn.2005-03.org.iscsi:client + :type initiator_iqn: str + :param mapped_luns: Required. Array of lun names mapped to the ACL + :type mapped_luns: list[str] + :param username: Required. Username for Challenge Handshake Authentication + Protocol (CHAP) authentication + :type username: str + :param password: Required. Password for Challenge Handshake Authentication + Protocol (CHAP) authentication + :type password: str + """ + + _validation = { + 'initiator_iqn': {'required': True}, + 'mapped_luns': {'required': True}, + 'username': {'required': True, 'max_length': 128, 'min_length': 7}, + 'password': {'required': True, 'max_length': 512, 'min_length': 12}, + } + + _attribute_map = { + 'initiator_iqn': {'key': 'initiatorIqn', 'type': 'str'}, + 'mapped_luns': {'key': 'mappedLuns', 'type': '[str]'}, + 'username': {'key': 'credentials.username', 'type': 'str'}, + 'password': {'key': 'credentials.password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Acl, self).__init__(**kwargs) + self.initiator_iqn = kwargs.get('initiator_iqn', None) + self.mapped_luns = kwargs.get('mapped_luns', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class Attributes(Model): + """Attributes of an iSCSI target. + + All required parameters must be populated in order to send to Azure. + + :param authentication: Required. Indicates whether or not authentication + is enabled on the ACL. + :type authentication: bool + :param prod_mode_write_protect: Required. Indicates whether or not write + protect is enabled on the luns. + :type prod_mode_write_protect: bool + """ + + _validation = { + 'authentication': {'required': True}, + 'prod_mode_write_protect': {'required': True}, + } + + _attribute_map = { + 'authentication': {'key': 'authentication', 'type': 'bool'}, + 'prod_mode_write_protect': {'key': 'prodModeWriteProtect', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Attributes, self).__init__(**kwargs) + self.authentication = kwargs.get('authentication', None) + self.prod_mode_write_protect = kwargs.get('prod_mode_write_protect', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Disk(Model): + """Managed disk to attach to the DiskPool. Required. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique Azure resource id of the managed disk. + Required. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Disk, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class Resource(Model): + """ARM resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class DiskPool(TrackedResource): + """Request payload for Create or Update Disk Pool requests. + + 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. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar provisioning_state: State of the operation on the resource. Possible + values include: 'Invalid', 'Succeeded', 'Failed', 'Canceled', 'Pending', + 'Creating', 'Updating', 'Deleting' + :vartype provisioning_state: str or + ~microsoft.storagepool.models.ProvisioningStates + :param availability_zones: Required. Logical zone for DiskPool resource. + :type availability_zones: list[str] + :ivar status: Operational status of the Disk pool. Possible values + include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy' + :vartype status: str or ~microsoft.storagepool.models.OperationalStatus + :param disks: List of Azure managed disks to attach to a DiskPool + :type disks: list[~microsoft.storagepool.models.Disk] + :param subnet_id: Required. Azure resource id of the subnet for the + DiskPool + :type subnet_id: str + :param sku: Sku description. + :type sku: ~microsoft.storagepool.models.Sku + :ivar system_data: Resource metadata required by ARM RPC + :vartype system_data: ~microsoft.storagepool.models.SystemMetadata + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'availability_zones': {'required': True}, + 'status': {'readonly': True}, + 'subnet_id': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'disks': {'key': 'properties.disks', 'type': '[Disk]'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemMetadata'}, + } + + def __init__(self, **kwargs): + super(DiskPool, self).__init__(**kwargs) + self.provisioning_state = None + self.availability_zones = kwargs.get('availability_zones', None) + self.status = None + self.disks = kwargs.get('disks', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.sku = kwargs.get('sku', None) + self.system_data = None + + +class Error(Model): + """The resource management error response. + + :param error: RP error response + :type error: ~microsoft.storagepool.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', 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) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~microsoft.storagepool.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~microsoft.storagepool.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class IscsiLun(Model): + """Lun to expose the ManagedDisk. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Lun name. + :type name: str + :param managed_disk_azure_resource_id: Required. Unique Azure resource id + of the managed disk. Required. + :type managed_disk_azure_resource_id: str + """ + + _validation = { + 'name': {'required': True}, + 'managed_disk_azure_resource_id': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'managed_disk_azure_resource_id': {'key': 'managedDiskAzureResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IscsiLun, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.managed_disk_azure_resource_id = kwargs.get('managed_disk_azure_resource_id', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class IscsiTarget(ProxyResource): + """Payload for iSCSI Target Create or Update requests. + + 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. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar provisioning_state: State of the operation on the resource. Possible + values include: 'Invalid', 'Succeeded', 'Failed', 'Canceled', 'Pending', + 'Creating', 'Updating', 'Deleting' + :vartype provisioning_state: str or + ~microsoft.storagepool.models.ProvisioningStates + :ivar status: Operational status of the Disk pool. Possible values + include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy' + :vartype status: str or ~microsoft.storagepool.models.OperationalStatus + :param tpgs: Required. list of iSCSI target portal groups + :type tpgs: list[~microsoft.storagepool.models.TargetPortalGroup] + :param target_iqn: Required. iSCSI target iqn (iSCSI Qualified Name); + example: iqn.2005-03.org.iscsi:server + :type target_iqn: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'tpgs': {'required': True}, + 'target_iqn': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'tpgs': {'key': 'properties.tpgs', 'type': '[TargetPortalGroup]'}, + 'target_iqn': {'key': 'properties.targetIqn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IscsiTarget, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + self.tpgs = kwargs.get('tpgs', None) + self.target_iqn = kwargs.get('target_iqn', None) + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code + :type name: str + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + :type tier: str or ~microsoft.storagepool.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class StoragePoolOperationDisplay(Model): + """Metadata about an operation. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. Localized friendly form of the resource + provider name. + :type provider: str + :param resource: Required. Localized friendly form of the resource type + related to this action/operation. + :type resource: str + :param operation: Required. Localized friendly name for the operation, as + it should be shown to the user. + :type operation: str + :param description: Required. Localized friendly description for the + operation, as it should be shown to the user. + :type description: str + """ + + _validation = { + 'provider': {'required': True}, + 'resource': {'required': True}, + 'operation': {'required': True}, + 'description': {'required': True}, + } + + _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(StoragePoolOperationDisplay, 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) + + +class StoragePoolRPOperation(Model): + """Description of a StoragePool RP Operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the operation being performed on this + particular object + :type name: str + :param is_data_action: Required. Indicates whether the operation applies + to data-plane. + :type is_data_action: bool + :param action_type: Indicates the action type. + :type action_type: str + :param display: Required. Additional metadata about RP operation. + :type display: ~microsoft.storagepool.models.StoragePoolOperationDisplay + :param origin: The intended executor of the operation; governs the display + of the operation in the RBAC UX and the audit logs UX. + :type origin: str + """ + + _validation = { + 'name': {'required': True}, + 'is_data_action': {'required': True}, + 'display': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'StoragePoolOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StoragePoolRPOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.action_type = kwargs.get('action_type', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + + +class SystemMetadata(Model): + """Resource metadata required by ARM RPC. + + :param created_by: A string identifier for the identity that created the + resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource: + user, application, managedIdentity + :type created_by_type: str + :param created_at: The timestamp of resource creation (UTC) + :type created_at: str + :param last_modified_by: A string identifier for the identity that last + modified the resource + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource: user, application, managedIdentity + :type last_modified_by_type: str + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: str + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SystemMetadata, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TargetPortalGroup(Model): + """iSCSI target portal group. + + 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 luns: Required. Lun list to be exposed through the iSCSI target. + Required + :type luns: list[~microsoft.storagepool.models.IscsiLun] + :param acls: Required. Access Control List (ACL) for an iSCSI target lun + :type acls: list[~microsoft.storagepool.models.Acl] + :param attributes: Required. Attributes of an iSCSI target + :type attributes: ~microsoft.storagepool.models.Attributes + :ivar endpoints: list of public ip addresses to connect to the iSCSI + target + :vartype endpoints: list[str] + :ivar tag: The tag associated with the iSCSI target portal group + :vartype tag: int + :ivar port: The port at which the iSCSI target is available + :vartype port: int + """ + + _validation = { + 'luns': {'required': True}, + 'acls': {'required': True}, + 'attributes': {'required': True}, + 'endpoints': {'readonly': True}, + 'tag': {'readonly': True}, + 'port': {'readonly': True}, + } + + _attribute_map = { + 'luns': {'key': 'luns', 'type': '[IscsiLun]'}, + 'acls': {'key': 'acls', 'type': '[Acl]'}, + 'attributes': {'key': 'attributes', 'type': 'Attributes'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'tag': {'key': 'tag', 'type': 'int'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(TargetPortalGroup, self).__init__(**kwargs) + self.luns = kwargs.get('luns', None) + self.acls = kwargs.get('acls', None) + self.attributes = kwargs.get('attributes', None) + self.endpoints = None + self.tag = None + self.port = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_models_py3.py new file mode 100644 index 000000000000..fc9729658da5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_models_py3.py @@ -0,0 +1,711 @@ +# 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 Acl(Model): + """Access Control List (ACL) for an iSCSI target lun. + + All required parameters must be populated in order to send to Azure. + + :param initiator_iqn: Required. iSCSI initiator iqn (iSCSI Qualified + Name); example: iqn.2005-03.org.iscsi:client + :type initiator_iqn: str + :param mapped_luns: Required. Array of lun names mapped to the ACL + :type mapped_luns: list[str] + :param username: Required. Username for Challenge Handshake Authentication + Protocol (CHAP) authentication + :type username: str + :param password: Required. Password for Challenge Handshake Authentication + Protocol (CHAP) authentication + :type password: str + """ + + _validation = { + 'initiator_iqn': {'required': True}, + 'mapped_luns': {'required': True}, + 'username': {'required': True, 'max_length': 128, 'min_length': 7}, + 'password': {'required': True, 'max_length': 512, 'min_length': 12}, + } + + _attribute_map = { + 'initiator_iqn': {'key': 'initiatorIqn', 'type': 'str'}, + 'mapped_luns': {'key': 'mappedLuns', 'type': '[str]'}, + 'username': {'key': 'credentials.username', 'type': 'str'}, + 'password': {'key': 'credentials.password', 'type': 'str'}, + } + + def __init__(self, *, initiator_iqn: str, mapped_luns, username: str, password: str, **kwargs) -> None: + super(Acl, self).__init__(**kwargs) + self.initiator_iqn = initiator_iqn + self.mapped_luns = mapped_luns + self.username = username + self.password = password + + +class Attributes(Model): + """Attributes of an iSCSI target. + + All required parameters must be populated in order to send to Azure. + + :param authentication: Required. Indicates whether or not authentication + is enabled on the ACL. + :type authentication: bool + :param prod_mode_write_protect: Required. Indicates whether or not write + protect is enabled on the luns. + :type prod_mode_write_protect: bool + """ + + _validation = { + 'authentication': {'required': True}, + 'prod_mode_write_protect': {'required': True}, + } + + _attribute_map = { + 'authentication': {'key': 'authentication', 'type': 'bool'}, + 'prod_mode_write_protect': {'key': 'prodModeWriteProtect', 'type': 'bool'}, + } + + def __init__(self, *, authentication: bool, prod_mode_write_protect: bool, **kwargs) -> None: + super(Attributes, self).__init__(**kwargs) + self.authentication = authentication + self.prod_mode_write_protect = prod_mode_write_protect + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Disk(Model): + """Managed disk to attach to the DiskPool. Required. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique Azure resource id of the managed disk. + Required. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(Disk, self).__init__(**kwargs) + self.id = id + + +class Resource(Model): + """ARM resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class DiskPool(TrackedResource): + """Request payload for Create or Update Disk Pool requests. + + 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. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar provisioning_state: State of the operation on the resource. Possible + values include: 'Invalid', 'Succeeded', 'Failed', 'Canceled', 'Pending', + 'Creating', 'Updating', 'Deleting' + :vartype provisioning_state: str or + ~microsoft.storagepool.models.ProvisioningStates + :param availability_zones: Required. Logical zone for DiskPool resource. + :type availability_zones: list[str] + :ivar status: Operational status of the Disk pool. Possible values + include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy' + :vartype status: str or ~microsoft.storagepool.models.OperationalStatus + :param disks: List of Azure managed disks to attach to a DiskPool + :type disks: list[~microsoft.storagepool.models.Disk] + :param subnet_id: Required. Azure resource id of the subnet for the + DiskPool + :type subnet_id: str + :param sku: Sku description. + :type sku: ~microsoft.storagepool.models.Sku + :ivar system_data: Resource metadata required by ARM RPC + :vartype system_data: ~microsoft.storagepool.models.SystemMetadata + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'availability_zones': {'required': True}, + 'status': {'readonly': True}, + 'subnet_id': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'disks': {'key': 'properties.disks', 'type': '[Disk]'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemMetadata'}, + } + + def __init__(self, *, location: str, availability_zones, subnet_id: str, tags=None, disks=None, sku=None, **kwargs) -> None: + super(DiskPool, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.availability_zones = availability_zones + self.status = None + self.disks = disks + self.subnet_id = subnet_id + self.sku = sku + self.system_data = None + + +class Error(Model): + """The resource management error response. + + :param error: RP error response + :type error: ~microsoft.storagepool.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +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) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~microsoft.storagepool.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~microsoft.storagepool.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class IscsiLun(Model): + """Lun to expose the ManagedDisk. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Lun name. + :type name: str + :param managed_disk_azure_resource_id: Required. Unique Azure resource id + of the managed disk. Required. + :type managed_disk_azure_resource_id: str + """ + + _validation = { + 'name': {'required': True}, + 'managed_disk_azure_resource_id': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'managed_disk_azure_resource_id': {'key': 'managedDiskAzureResourceId', 'type': 'str'}, + } + + def __init__(self, *, name: str, managed_disk_azure_resource_id: str, **kwargs) -> None: + super(IscsiLun, self).__init__(**kwargs) + self.name = name + self.managed_disk_azure_resource_id = managed_disk_azure_resource_id + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class IscsiTarget(ProxyResource): + """Payload for iSCSI Target Create or Update requests. + + 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. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar provisioning_state: State of the operation on the resource. Possible + values include: 'Invalid', 'Succeeded', 'Failed', 'Canceled', 'Pending', + 'Creating', 'Updating', 'Deleting' + :vartype provisioning_state: str or + ~microsoft.storagepool.models.ProvisioningStates + :ivar status: Operational status of the Disk pool. Possible values + include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy' + :vartype status: str or ~microsoft.storagepool.models.OperationalStatus + :param tpgs: Required. list of iSCSI target portal groups + :type tpgs: list[~microsoft.storagepool.models.TargetPortalGroup] + :param target_iqn: Required. iSCSI target iqn (iSCSI Qualified Name); + example: iqn.2005-03.org.iscsi:server + :type target_iqn: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'tpgs': {'required': True}, + 'target_iqn': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'tpgs': {'key': 'properties.tpgs', 'type': '[TargetPortalGroup]'}, + 'target_iqn': {'key': 'properties.targetIqn', 'type': 'str'}, + } + + def __init__(self, *, tpgs, target_iqn: str, **kwargs) -> None: + super(IscsiTarget, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + self.tpgs = tpgs + self.target_iqn = target_iqn + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code + :type name: str + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + :type tier: str or ~microsoft.storagepool.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str, tier=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + + +class StoragePoolOperationDisplay(Model): + """Metadata about an operation. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. Localized friendly form of the resource + provider name. + :type provider: str + :param resource: Required. Localized friendly form of the resource type + related to this action/operation. + :type resource: str + :param operation: Required. Localized friendly name for the operation, as + it should be shown to the user. + :type operation: str + :param description: Required. Localized friendly description for the + operation, as it should be shown to the user. + :type description: str + """ + + _validation = { + 'provider': {'required': True}, + 'resource': {'required': True}, + 'operation': {'required': True}, + 'description': {'required': True}, + } + + _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, resource: str, operation: str, description: str, **kwargs) -> None: + super(StoragePoolOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class StoragePoolRPOperation(Model): + """Description of a StoragePool RP Operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the operation being performed on this + particular object + :type name: str + :param is_data_action: Required. Indicates whether the operation applies + to data-plane. + :type is_data_action: bool + :param action_type: Indicates the action type. + :type action_type: str + :param display: Required. Additional metadata about RP operation. + :type display: ~microsoft.storagepool.models.StoragePoolOperationDisplay + :param origin: The intended executor of the operation; governs the display + of the operation in the RBAC UX and the audit logs UX. + :type origin: str + """ + + _validation = { + 'name': {'required': True}, + 'is_data_action': {'required': True}, + 'display': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'StoragePoolOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str, is_data_action: bool, display, action_type: str=None, origin: str=None, **kwargs) -> None: + super(StoragePoolRPOperation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.action_type = action_type + self.display = display + self.origin = origin + + +class SystemMetadata(Model): + """Resource metadata required by ARM RPC. + + :param created_by: A string identifier for the identity that created the + resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource: + user, application, managedIdentity + :type created_by_type: str + :param created_at: The timestamp of resource creation (UTC) + :type created_at: str + :param last_modified_by: A string identifier for the identity that last + modified the resource + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource: user, application, managedIdentity + :type last_modified_by_type: str + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: str + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'str'}, + } + + def __init__(self, *, created_by: str=None, created_by_type: str=None, created_at: str=None, last_modified_by: str=None, last_modified_by_type: str=None, last_modified_at: str=None, **kwargs) -> None: + super(SystemMetadata, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TargetPortalGroup(Model): + """iSCSI target portal group. + + 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 luns: Required. Lun list to be exposed through the iSCSI target. + Required + :type luns: list[~microsoft.storagepool.models.IscsiLun] + :param acls: Required. Access Control List (ACL) for an iSCSI target lun + :type acls: list[~microsoft.storagepool.models.Acl] + :param attributes: Required. Attributes of an iSCSI target + :type attributes: ~microsoft.storagepool.models.Attributes + :ivar endpoints: list of public ip addresses to connect to the iSCSI + target + :vartype endpoints: list[str] + :ivar tag: The tag associated with the iSCSI target portal group + :vartype tag: int + :ivar port: The port at which the iSCSI target is available + :vartype port: int + """ + + _validation = { + 'luns': {'required': True}, + 'acls': {'required': True}, + 'attributes': {'required': True}, + 'endpoints': {'readonly': True}, + 'tag': {'readonly': True}, + 'port': {'readonly': True}, + } + + _attribute_map = { + 'luns': {'key': 'luns', 'type': '[IscsiLun]'}, + 'acls': {'key': 'acls', 'type': '[Acl]'}, + 'attributes': {'key': 'attributes', 'type': 'Attributes'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'tag': {'key': 'tag', 'type': 'int'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, luns, acls, attributes, **kwargs) -> None: + super(TargetPortalGroup, self).__init__(**kwargs) + self.luns = luns + self.acls = acls + self.attributes = attributes + self.endpoints = None + self.tag = None + self.port = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_paged_models.py new file mode 100644 index 000000000000..e8f306756363 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_paged_models.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class StoragePoolRPOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`StoragePoolRPOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StoragePoolRPOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(StoragePoolRPOperationPaged, self).__init__(*args, **kwargs) +class DiskPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`DiskPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DiskPool]'} + } + + def __init__(self, *args, **kwargs): + + super(DiskPoolPaged, self).__init__(*args, **kwargs) +class IscsiTargetPaged(Paged): + """ + A paging container for iterating over a list of :class:`IscsiTarget ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IscsiTarget]'} + } + + def __init__(self, *args, **kwargs): + + super(IscsiTargetPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_storage_pool_management_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_storage_pool_management_enums.py new file mode 100644 index 000000000000..e5c33852f1df --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/models/_storage_pool_management_enums.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 enum import Enum + + +class ProvisioningStates(str, Enum): + + invalid = "Invalid" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + pending = "Pending" + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + + +class OperationalStatus(str, Enum): + + invalid = "Invalid" + unknown = "Unknown" + healthy = "Healthy" + unhealthy = "Unhealthy" + + +class SkuTier(str, Enum): + + free = "Free" + basic = "Basic" + standard = "Standard" + premium = "Premium" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/__init__.py new file mode 100644 index 000000000000..cf80223d57f6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/__init__.py @@ -0,0 +1,20 @@ +# 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 ._disk_pools_operations import DiskPoolsOperations +from ._iscsi_targets_operations import IscsiTargetsOperations + +__all__ = [ + 'Operations', + 'DiskPoolsOperations', + 'IscsiTargetsOperations', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_disk_pools_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_disk_pools_operations.py new file mode 100644 index 000000000000..bdd5fe6019b2 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_disk_pools_operations.py @@ -0,0 +1,517 @@ +# 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 DiskPoolsOperations(object): + """DiskPoolsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: The API version to use for this operation. Constant value: "2020-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-15-preview" + + self.config = config + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of Disk Pools in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DiskPool + :rtype: + ~microsoft.storagepool.models.DiskPoolPaged[~microsoft.storagepool.models.DiskPool] + :raises: + :class:`ErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.DiskPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/diskPools'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of DiskPools. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DiskPool + :rtype: + ~microsoft.storagepool.models.DiskPoolPaged[~microsoft.storagepool.models.DiskPool] + :raises: + :class:`ErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$') + } + 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', min_length=1) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.DiskPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools'} + + + def _create_or_update_initial( + self, resource_group_name, disk_pool_name, disk_pool_payload, 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$') + } + 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', min_length=1) + + # 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(disk_pool_payload, 'DiskPool') + + # 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('DiskPool', response) + if response.status_code == 202: + deserialized = self._deserialize('DiskPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, disk_pool_name, disk_pool_payload, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Disk Pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_pool_name: str + :param disk_pool_payload: Request payload for Disk Pool operations. + :type disk_pool_payload: ~microsoft.storagepool.models.DiskPool + :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 DiskPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~microsoft.storagepool.models.DiskPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~microsoft.storagepool.models.DiskPool]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_pool_name=disk_pool_name, + disk_pool_payload=disk_pool_payload, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DiskPool', 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/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'} + + + def _update_initial( + self, resource_group_name, disk_pool_name, disk_pool_payload, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$') + } + 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', min_length=1) + + # 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(disk_pool_payload, 'DiskPool') + + # 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('DiskPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, disk_pool_name, disk_pool_payload, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a Storage Pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_pool_name: str + :param disk_pool_payload: Request payload for Disk Pool operations. + :type disk_pool_payload: ~microsoft.storagepool.models.DiskPool + :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 DiskPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~microsoft.storagepool.models.DiskPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~microsoft.storagepool.models.DiskPool]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + disk_pool_name=disk_pool_name, + disk_pool_payload=disk_pool_payload, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DiskPool', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'} + + + def _delete_initial( + self, resource_group_name, disk_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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$') + } + 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', min_length=1) + + # 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 [200, 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_name, disk_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a Disk Pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_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_name=resource_group_name, + disk_pool_name=disk_pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'} + + def get( + self, resource_group_name, disk_pool_name, custom_headers=None, raw=False, **operation_config): + """Get a Disk Pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_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: DiskPool or ClientRawResponse if raw=true + :rtype: ~microsoft.storagepool.models.DiskPool 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$') + } + 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', min_length=1) + + # 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('DiskPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_iscsi_targets_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_iscsi_targets_operations.py new file mode 100644 index 000000000000..66e90506825b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_iscsi_targets_operations.py @@ -0,0 +1,372 @@ +# 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 IscsiTargetsOperations(object): + """IscsiTargetsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: The API version to use for this operation. Constant value: "2020-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-15-preview" + + self.config = config + + def list_by_disk_pool( + self, resource_group_name, disk_pool_name, custom_headers=None, raw=False, **operation_config): + """Get iSCSI Targets within a Disk Pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IscsiTarget + :rtype: + ~microsoft.storagepool.models.IscsiTargetPaged[~microsoft.storagepool.models.IscsiTarget] + :raises: + :class:`ErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_disk_pool.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$') + } + 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', min_length=1) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.IscsiTargetPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_disk_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets'} + + + def _create_or_update_initial( + self, resource_group_name, disk_pool_name, iscsi_target_name, tpgs, target_iqn, custom_headers=None, raw=False, **operation_config): + iscsi_target_payload = models.IscsiTarget(tpgs=tpgs, target_iqn=target_iqn) + + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'iscsiTargetName': self._serialize.url("iscsi_target_name", iscsi_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', min_length=1) + + # 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(iscsi_target_payload, 'IscsiTarget') + + # 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('IscsiTarget', response) + if response.status_code == 202: + deserialized = self._deserialize('IscsiTarget', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, disk_pool_name, iscsi_target_name, tpgs, target_iqn, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or Update an iSCSI target. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_pool_name: str + :param iscsi_target_name: The name of the iSCSI target. + :type iscsi_target_name: str + :param tpgs: list of iSCSI target portal groups + :type tpgs: list[~microsoft.storagepool.models.TargetPortalGroup] + :param target_iqn: iSCSI target iqn (iSCSI Qualified Name); example: + iqn.2005-03.org.iscsi:server + :type target_iqn: 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 IscsiTarget or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~microsoft.storagepool.models.IscsiTarget] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~microsoft.storagepool.models.IscsiTarget]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_pool_name=disk_pool_name, + iscsi_target_name=iscsi_target_name, + tpgs=tpgs, + target_iqn=target_iqn, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('IscsiTarget', 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/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}'} + + + def _delete_initial( + self, resource_group_name, disk_pool_name, iscsi_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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'iscsiTargetName': self._serialize.url("iscsi_target_name", iscsi_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', min_length=1) + + # 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 [200, 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_name, disk_pool_name, iscsi_target_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an iSCSI Target. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_pool_name: str + :param iscsi_target_name: The name of the iSCSI target. + :type iscsi_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_name=resource_group_name, + disk_pool_name=disk_pool_name, + iscsi_target_name=iscsi_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/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}'} + + def get( + self, resource_group_name, disk_pool_name, iscsi_target_name, custom_headers=None, raw=False, **operation_config): + """Gets an iSCSI Target. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param disk_pool_name: The name of the Disk Pool. + :type disk_pool_name: str + :param iscsi_target_name: The name of the iSCSI target. + :type iscsi_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: IscsiTarget or ClientRawResponse if raw=true + :rtype: ~microsoft.storagepool.models.IscsiTarget 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]*[0-9A-Za-z]$'), + 'diskPoolName': self._serialize.url("disk_pool_name", disk_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'iscsiTargetName': self._serialize.url("iscsi_target_name", iscsi_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', min_length=1) + + # 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('IscsiTarget', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_operations.py new file mode 100644 index 000000000000..3da57ee20b08 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/operations/_operations.py @@ -0,0 +1,100 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: The API version to use for this operation. Constant value: "2020-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of StoragePool operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StoragePoolRPOperation + :rtype: + ~microsoft.storagepool.models.StoragePoolRPOperationPaged[~microsoft.storagepool.models.StoragePoolRPOperation] + :raises: + :class:`ErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StoragePoolRPOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.StoragePool/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/version.py new file mode 100644 index 000000000000..531295b17784 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_03_15_preview/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 = "2020-03-15-preview" +