diff --git a/sdk/storagepool/azure-mgmt-storagepool/_meta.json b/sdk/storagepool/azure-mgmt-storagepool/_meta.json index 95d75c369385..e274704c6ec2 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/_meta.json +++ b/sdk/storagepool/azure-mgmt-storagepool/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.0", - "@autorest/modelerfour@4.19.1" + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" ], - "commit": "61b4ce18d89d493e94d15bb101786a6e8a675ac8", + "commit": "2b451435758d4c1b45e014b15c756c2b75132875", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/storagepool/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2", + "autorest_command": "autorest specification/storagepool/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/storagepool/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_configuration.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_configuration.py index d59d40ee6f16..0ca8280f0a66 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_configuration.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-04-01-preview" + self.api_version = "2021-08-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-storagepool/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_metadata.json b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_metadata.json index 122ae08cb64c..e12ccb66c844 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_metadata.json +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-04-01-preview", - "total_api_version_list": ["2021-04-01-preview"], + "chosen_version": "2021-08-01", + "total_api_version_list": ["2021-08-01"], "client": { "name": "StoragePoolManagement", "filename": "_storage_pool_management", @@ -101,6 +101,7 @@ "operations": "Operations", "disk_pools": "DiskPoolsOperations", "disk_pool_zones": "DiskPoolZonesOperations", + "resource_skus": "ResourceSkusOperations", "iscsi_targets": "IscsiTargetsOperations" } } \ No newline at end of file diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_storage_pool_management.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_storage_pool_management.py index 8247b570df21..d81971650f6b 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_storage_pool_management.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/_storage_pool_management.py @@ -22,6 +22,7 @@ from .operations import Operations from .operations import DiskPoolsOperations from .operations import DiskPoolZonesOperations +from .operations import ResourceSkusOperations from .operations import IscsiTargetsOperations from . import models @@ -35,6 +36,8 @@ class StoragePoolManagement(object): :vartype disk_pools: storage_pool_management.operations.DiskPoolsOperations :ivar disk_pool_zones: DiskPoolZonesOperations operations :vartype disk_pool_zones: storage_pool_management.operations.DiskPoolZonesOperations + :ivar resource_skus: ResourceSkusOperations operations + :vartype resource_skus: storage_pool_management.operations.ResourceSkusOperations :ivar iscsi_targets: IscsiTargetsOperations operations :vartype iscsi_targets: storage_pool_management.operations.IscsiTargetsOperations :param credential: Credential needed for the client to connect to Azure. @@ -69,6 +72,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.disk_pool_zones = DiskPoolZonesOperations( self._client, self._config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations( + self._client, self._config, self._serialize, self._deserialize) self.iscsi_targets = IscsiTargetsOperations( self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_configuration.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_configuration.py index 9df6047d7d8a..dfefbba0bbc4 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_configuration.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-04-01-preview" + self.api_version = "2021-08-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-storagepool/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_storage_pool_management.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_storage_pool_management.py index cabe44f08198..275dcf620703 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_storage_pool_management.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/_storage_pool_management.py @@ -20,6 +20,7 @@ from .operations import Operations from .operations import DiskPoolsOperations from .operations import DiskPoolZonesOperations +from .operations import ResourceSkusOperations from .operations import IscsiTargetsOperations from .. import models @@ -33,6 +34,8 @@ class StoragePoolManagement(object): :vartype disk_pools: storage_pool_management.aio.operations.DiskPoolsOperations :ivar disk_pool_zones: DiskPoolZonesOperations operations :vartype disk_pool_zones: storage_pool_management.aio.operations.DiskPoolZonesOperations + :ivar resource_skus: ResourceSkusOperations operations + :vartype resource_skus: storage_pool_management.aio.operations.ResourceSkusOperations :ivar iscsi_targets: IscsiTargetsOperations operations :vartype iscsi_targets: storage_pool_management.aio.operations.IscsiTargetsOperations :param credential: Credential needed for the client to connect to Azure. @@ -66,6 +69,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.disk_pool_zones = DiskPoolZonesOperations( self._client, self._config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations( + self._client, self._config, self._serialize, self._deserialize) self.iscsi_targets = IscsiTargetsOperations( self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/__init__.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/__init__.py index 1620075f15e8..5f769185377c 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/__init__.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/__init__.py @@ -9,11 +9,13 @@ from ._operations import Operations from ._disk_pools_operations import DiskPoolsOperations from ._disk_pool_zones_operations import DiskPoolZonesOperations +from ._resource_skus_operations import ResourceSkusOperations from ._iscsi_targets_operations import IscsiTargetsOperations __all__ = [ 'Operations', 'DiskPoolsOperations', 'DiskPoolZonesOperations', + 'ResourceSkusOperations', 'IscsiTargetsOperations', ] diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pool_zones_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pool_zones_operations.py index 32b28ec4ba05..5915acaf7e31 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pool_zones_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pool_zones_operations.py @@ -60,7 +60,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pools_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pools_operations.py index d4b782528000..bf3ec22a9fe4 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pools_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_disk_pools_operations.py @@ -59,7 +59,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -193,7 +193,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -246,7 +246,8 @@ async def begin_create_or_update( disk_pool_create_payload: "_models.DiskPoolCreate", **kwargs: Any ) -> AsyncLROPoller["_models.DiskPool"]: - """Create or Update Disk pool. + """Create or Update Disk pool. This create or update operation can take 15 minutes to complete. + This is expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -322,7 +323,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -448,7 +449,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -488,7 +489,8 @@ async def begin_delete( disk_pool_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a Disk pool. + """Delete a Disk pool; attached disks are not affected. This delete operation can take 10 minutes + to complete. This is expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -568,7 +570,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -627,7 +629,7 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -691,7 +693,7 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -731,7 +733,8 @@ async def begin_start( disk_pool_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """The operation to start a Disk Pool. + """The operation to start a Disk Pool. This start operation can take 10 minutes to complete. This + is expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -800,7 +803,7 @@ async def _deallocate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -841,7 +844,8 @@ async def begin_deallocate( **kwargs: Any ) -> AsyncLROPoller[None]: """Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute - resources that this Disk Pool uses. + resources that this Disk Pool uses. This operation can take 10 minutes to complete. This is + expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -898,3 +902,113 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/deallocate'} # type: ignore + + async def _upgrade_initial( + self, + resource_group_name: str, + disk_pool_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._upgrade_initial.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _upgrade_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/upgrade'} # type: ignore + + async def begin_upgrade( + self, + resource_group_name: str, + disk_pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade replaces the underlying virtual machine hosts one at a time. This operation can take + 10-15 minutes to complete. This is expected service behavior. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._upgrade_initial( + resource_group_name=resource_group_name, + disk_pool_name=disk_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/upgrade'} # type: ignore diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_iscsi_targets_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_iscsi_targets_operations.py index 65dfed807e2f..3b6d541bb9dc 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_iscsi_targets_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_iscsi_targets_operations.py @@ -65,7 +65,7 @@ def list_by_disk_pool( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -131,7 +131,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -267,7 +267,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -400,7 +400,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -529,7 +529,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_operations.py index 10c4e5799e7a..f11ffd1a95c9 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_resource_skus_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_resource_skus_operations.py new file mode 100644 index 000000000000..8844b20b9e0f --- /dev/null +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/aio/operations/_resource_skus_operations.py @@ -0,0 +1,113 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceSkusOperations: + """ResourceSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_pool_management.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceSkuListResult"]: + """Lists available StoragePool resources and skus in an Azure location. + + :param location: The location of the resource. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceSkuListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~storage_pool_management.models.ResourceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/locations/{location}/skus'} # type: ignore diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/__init__.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/__init__.py index 1bd7f4b2711b..c85dc990cc73 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/__init__.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/__init__.py @@ -29,6 +29,13 @@ from ._models_py3 import OutboundEnvironmentEndpointList from ._models_py3 import ProxyResource from ._models_py3 import Resource + from ._models_py3 import ResourceSkuCapability + from ._models_py3 import ResourceSkuInfo + from ._models_py3 import ResourceSkuListResult + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuRestrictionInfo + from ._models_py3 import ResourceSkuRestrictions + from ._models_py3 import ResourceSkuZoneDetails from ._models_py3 import Sku from ._models_py3 import StoragePoolOperationDisplay from ._models_py3 import StoragePoolOperationListResult @@ -58,6 +65,13 @@ from ._models import OutboundEnvironmentEndpointList # type: ignore from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore + from ._models import ResourceSkuCapability # type: ignore + from ._models import ResourceSkuInfo # type: ignore + from ._models import ResourceSkuListResult # type: ignore + from ._models import ResourceSkuLocationInfo # type: ignore + from ._models import ResourceSkuRestrictionInfo # type: ignore + from ._models import ResourceSkuRestrictions # type: ignore + from ._models import ResourceSkuZoneDetails # type: ignore from ._models import Sku # type: ignore from ._models import StoragePoolOperationDisplay # type: ignore from ._models import StoragePoolOperationListResult # type: ignore @@ -71,6 +85,8 @@ IscsiTargetAclMode, OperationalStatus, ProvisioningStates, + ResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsType, ) __all__ = [ @@ -96,6 +112,13 @@ 'OutboundEnvironmentEndpointList', 'ProxyResource', 'Resource', + 'ResourceSkuCapability', + 'ResourceSkuInfo', + 'ResourceSkuListResult', + 'ResourceSkuLocationInfo', + 'ResourceSkuRestrictionInfo', + 'ResourceSkuRestrictions', + 'ResourceSkuZoneDetails', 'Sku', 'StoragePoolOperationDisplay', 'StoragePoolOperationListResult', @@ -107,4 +130,6 @@ 'IscsiTargetAclMode', 'OperationalStatus', 'ProvisioningStates', + 'ResourceSkuRestrictionsReasonCode', + 'ResourceSkuRestrictionsType', ] diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models.py index c99710d4e861..9f7ff5672e93 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models.py @@ -167,6 +167,11 @@ class DiskPool(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str + :ivar managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :vartype managed_by: str + :ivar managed_by_extended: List of Azure resource ids that manage this resource. + :vartype managed_by_extended: list[str] :ivar system_data: Resource metadata required by ARM RPC. :vartype system_data: ~storage_pool_management.models.SystemMetadata :ivar provisioning_state: Required. State of the operation on the resource. Possible values @@ -196,6 +201,8 @@ class DiskPool(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'managed_by_extended': {'readonly': True}, 'system_data': {'readonly': True}, 'provisioning_state': {'required': True, 'readonly': True}, 'availability_zones': {'required': True}, @@ -209,6 +216,8 @@ class DiskPool(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'system_data': {'key': 'systemData', 'type': 'SystemMetadata'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, @@ -225,6 +234,8 @@ def __init__( **kwargs ): super(DiskPool, self).__init__(**kwargs) + self.managed_by = None + self.managed_by_extended = None self.system_data = None self.provisioning_state = None self.availability_zones = kwargs['availability_zones'] @@ -257,6 +268,11 @@ class DiskPoolCreate(msrest.serialization.Model): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param availability_zones: Logical zone for Disk Pool resource; example: ["1"]. :type availability_zones: list[str] :param disks: List of Azure Managed Disks to attach to a Disk Pool. @@ -283,6 +299,8 @@ class DiskPoolCreate(msrest.serialization.Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, 'disks': {'key': 'properties.disks', 'type': '[Disk]'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, @@ -300,6 +318,8 @@ def __init__( self.id = None self.name = None self.type = None + self.managed_by = kwargs.get('managed_by', None) + self.managed_by_extended = kwargs.get('managed_by_extended', None) self.availability_zones = kwargs.get('availability_zones', None) self.disks = kwargs.get('disks', None) self.subnet_id = kwargs['subnet_id'] @@ -341,6 +361,11 @@ def __init__( class DiskPoolUpdate(msrest.serialization.Model): """Request payload for Update Disk Pool request. + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param disks: List of Azure Managed Disks to attach to a Disk Pool. @@ -348,6 +373,8 @@ class DiskPoolUpdate(msrest.serialization.Model): """ _attribute_map = { + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'disks': {'key': 'properties.disks', 'type': '[Disk]'}, } @@ -357,21 +384,31 @@ def __init__( **kwargs ): super(DiskPoolUpdate, self).__init__(**kwargs) + self.managed_by = kwargs.get('managed_by', None) + self.managed_by_extended = kwargs.get('managed_by_extended', None) self.tags = kwargs.get('tags', None) self.disks = kwargs.get('disks', None) class DiskPoolZoneInfo(msrest.serialization.Model): - """Disk Pool Sku Details. + """Disk Pool SKU Details. - :param availability_zones: Logical zone for Disk Pool resource; example: ["1"]. - :type availability_zones: list[str] - :param additional_capabilities: List of additional capabilities for Disk Pool. - :type additional_capabilities: list[str] - :param sku: Determines the SKU of VM deployed for Disk Pool. - :type sku: ~storage_pool_management.models.Sku + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar availability_zones: Logical zone for Disk Pool resource; example: ["1"]. + :vartype availability_zones: list[str] + :ivar additional_capabilities: List of additional capabilities for Disk Pool. + :vartype additional_capabilities: list[str] + :ivar sku: Determines the SKU of VM deployed for Disk Pool. + :vartype sku: ~storage_pool_management.models.Sku """ + _validation = { + 'availability_zones': {'readonly': True}, + 'additional_capabilities': {'readonly': True}, + 'sku': {'readonly': True}, + } + _attribute_map = { 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, 'additional_capabilities': {'key': 'additionalCapabilities', 'type': '[str]'}, @@ -383,20 +420,27 @@ def __init__( **kwargs ): super(DiskPoolZoneInfo, self).__init__(**kwargs) - self.availability_zones = kwargs.get('availability_zones', None) - self.additional_capabilities = kwargs.get('additional_capabilities', None) - self.sku = kwargs.get('sku', None) + self.availability_zones = None + self.additional_capabilities = None + self.sku = None class DiskPoolZoneListResult(msrest.serialization.Model): """List Disk Pool skus operation response. - :param value: The list of Disk Pool Skus. - :type value: list[~storage_pool_management.models.DiskPoolZoneInfo] - :param next_link: URI to fetch the next section of the paginated response. - :type next_link: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Disk Pool Skus. + :vartype value: list[~storage_pool_management.models.DiskPoolZoneInfo] + :ivar next_link: URI to fetch the next section of the paginated response. + :vartype next_link: str """ + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + _attribute_map = { 'value': {'key': 'value', 'type': '[DiskPoolZoneInfo]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, @@ -407,8 +451,8 @@ def __init__( **kwargs ): super(DiskPoolZoneListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = None + self.next_link = None class EndpointDependency(msrest.serialization.Model): @@ -649,6 +693,11 @@ class IscsiTarget(ProxyResource): :vartype type: str :ivar system_data: Resource metadata required by ARM RPC. :vartype system_data: ~storage_pool_management.models.SystemMetadata + :ivar managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :vartype managed_by: str + :ivar managed_by_extended: List of Azure resource ids that manage this resource. + :vartype managed_by_extended: list[str] :param acl_mode: Required. Mode for Target connectivity. Possible values include: "Dynamic", "Static". :type acl_mode: str or ~storage_pool_management.models.IscsiTargetAclMode @@ -671,6 +720,8 @@ class IscsiTarget(ProxyResource): :type endpoints: list[str] :param port: The port used by iSCSI Target portal group. :type port: int + :ivar sessions: List of identifiers for active sessions on the iSCSI target. + :vartype sessions: list[str] """ _validation = { @@ -678,10 +729,13 @@ class IscsiTarget(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, + 'managed_by': {'readonly': True}, + 'managed_by_extended': {'readonly': True}, 'acl_mode': {'required': True}, 'target_iqn': {'required': True}, 'provisioning_state': {'required': True, 'readonly': True}, 'status': {'required': True}, + 'sessions': {'readonly': True}, } _attribute_map = { @@ -689,6 +743,8 @@ class IscsiTarget(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemMetadata'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'acl_mode': {'key': 'properties.aclMode', 'type': 'str'}, 'static_acls': {'key': 'properties.staticAcls', 'type': '[Acl]'}, 'luns': {'key': 'properties.luns', 'type': '[IscsiLun]'}, @@ -697,6 +753,7 @@ class IscsiTarget(ProxyResource): 'status': {'key': 'properties.status', 'type': 'str'}, 'endpoints': {'key': 'properties.endpoints', 'type': '[str]'}, 'port': {'key': 'properties.port', 'type': 'int'}, + 'sessions': {'key': 'properties.sessions', 'type': '[str]'}, } def __init__( @@ -705,6 +762,8 @@ def __init__( ): super(IscsiTarget, self).__init__(**kwargs) self.system_data = None + self.managed_by = None + self.managed_by_extended = None self.acl_mode = kwargs['acl_mode'] self.static_acls = kwargs.get('static_acls', None) self.luns = kwargs.get('luns', None) @@ -713,6 +772,7 @@ def __init__( self.status = kwargs['status'] self.endpoints = kwargs.get('endpoints', None) self.port = kwargs.get('port', None) + self.sessions = None class IscsiTargetCreate(ProxyResource): @@ -730,6 +790,11 @@ class IscsiTargetCreate(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param acl_mode: Required. Mode for Target connectivity. Possible values include: "Dynamic", "Static". :type acl_mode: str or ~storage_pool_management.models.IscsiTargetAclMode @@ -753,6 +818,8 @@ class IscsiTargetCreate(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'acl_mode': {'key': 'properties.aclMode', 'type': 'str'}, 'target_iqn': {'key': 'properties.targetIqn', 'type': 'str'}, 'static_acls': {'key': 'properties.staticAcls', 'type': '[Acl]'}, @@ -764,6 +831,8 @@ def __init__( **kwargs ): super(IscsiTargetCreate, self).__init__(**kwargs) + self.managed_by = kwargs.get('managed_by', None) + self.managed_by_extended = kwargs.get('managed_by_extended', None) self.acl_mode = kwargs['acl_mode'] self.target_iqn = kwargs.get('target_iqn', None) self.static_acls = kwargs.get('static_acls', None) @@ -815,6 +884,11 @@ class IscsiTargetUpdate(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param static_acls: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. :type static_acls: list[~storage_pool_management.models.Acl] :param luns: List of LUNs to be exposed through iSCSI Target. @@ -831,6 +905,8 @@ class IscsiTargetUpdate(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'static_acls': {'key': 'properties.staticAcls', 'type': '[Acl]'}, 'luns': {'key': 'properties.luns', 'type': '[IscsiLun]'}, } @@ -840,6 +916,8 @@ def __init__( **kwargs ): super(IscsiTargetUpdate, self).__init__(**kwargs) + self.managed_by = kwargs.get('managed_by', None) + self.managed_by_extended = kwargs.get('managed_by_extended', None) self.static_acls = kwargs.get('static_acls', None) self.luns = kwargs.get('luns', None) @@ -900,6 +978,253 @@ def __init__( self.next_link = None +class ResourceSkuCapability(msrest.serialization.Model): + """Capability a resource SKU has. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Capability name. + :vartype name: str + :ivar value: Capability value. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ResourceSkuInfo(msrest.serialization.Model): + """Resource SKU Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar api_version: StoragePool RP API version. + :vartype api_version: str + :ivar resource_type: StoragePool resource type. + :vartype resource_type: str + :ivar capabilities: List of additional capabilities for StoragePool resource. + :vartype capabilities: list[~storage_pool_management.models.ResourceSkuCapability] + :ivar location_info: Zones and zone capabilities in those locations where the SKU is available. + :vartype location_info: ~storage_pool_management.models.ResourceSkuLocationInfo + :ivar name: Sku name. + :vartype name: str + :ivar tier: Sku tier. + :vartype tier: str + :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :vartype restrictions: list[~storage_pool_management.models.ResourceSkuRestrictions] + """ + + _validation = { + 'api_version': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'location_info': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapability]'}, + 'location_info': {'key': 'locationInfo', 'type': 'ResourceSkuLocationInfo'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuInfo, self).__init__(**kwargs) + self.api_version = None + self.resource_type = None + self.capabilities = None + self.location_info = None + self.name = None + self.tier = None + self.restrictions = None + + +class ResourceSkuListResult(msrest.serialization.Model): + """List Disk Pool skus operation response. + + :param value: The list of StoragePool resource skus. + :type value: list[~storage_pool_management.models.ResourceSkuInfo] + :param next_link: URI to fetch the next section of the paginated response. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceSkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """Zone and capability info for resource sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~storage_pool_management.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuRestrictionInfo(msrest.serialization.Model): + """Describes an available Compute SKU Restriction Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ResourceSkuRestrictions(msrest.serialization.Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. Possible values include: "Location", "Zone". + :vartype type: str or ~storage_pool_management.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + :vartype restriction_info: ~storage_pool_management.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", + "NotAvailableForSubscription". + :vartype reason_code: str or ~storage_pool_management.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~storage_pool_management.models.ResourceSkuCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + class Sku(msrest.serialization.Model): """Sku for ARM resource. diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models_py3.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models_py3.py index 21148d542512..0ae45a11b2ac 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models_py3.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_models_py3.py @@ -180,6 +180,11 @@ class DiskPool(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str + :ivar managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :vartype managed_by: str + :ivar managed_by_extended: List of Azure resource ids that manage this resource. + :vartype managed_by_extended: list[str] :ivar system_data: Resource metadata required by ARM RPC. :vartype system_data: ~storage_pool_management.models.SystemMetadata :ivar provisioning_state: Required. State of the operation on the resource. Possible values @@ -209,6 +214,8 @@ class DiskPool(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'managed_by_extended': {'readonly': True}, 'system_data': {'readonly': True}, 'provisioning_state': {'required': True, 'readonly': True}, 'availability_zones': {'required': True}, @@ -222,6 +229,8 @@ class DiskPool(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'system_data': {'key': 'systemData', 'type': 'SystemMetadata'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, @@ -248,6 +257,8 @@ def __init__( **kwargs ): super(DiskPool, self).__init__(tags=tags, location=location, **kwargs) + self.managed_by = None + self.managed_by_extended = None self.system_data = None self.provisioning_state = None self.availability_zones = availability_zones @@ -280,6 +291,11 @@ class DiskPoolCreate(msrest.serialization.Model): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param availability_zones: Logical zone for Disk Pool resource; example: ["1"]. :type availability_zones: list[str] :param disks: List of Azure Managed Disks to attach to a Disk Pool. @@ -306,6 +322,8 @@ class DiskPoolCreate(msrest.serialization.Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, 'disks': {'key': 'properties.disks', 'type': '[Disk]'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, @@ -319,6 +337,8 @@ def __init__( location: str, subnet_id: str, tags: Optional[Dict[str, str]] = None, + managed_by: Optional[str] = None, + managed_by_extended: Optional[List[str]] = None, availability_zones: Optional[List[str]] = None, disks: Optional[List["Disk"]] = None, additional_capabilities: Optional[List[str]] = None, @@ -331,6 +351,8 @@ def __init__( self.id = None self.name = None self.type = None + self.managed_by = managed_by + self.managed_by_extended = managed_by_extended self.availability_zones = availability_zones self.disks = disks self.subnet_id = subnet_id @@ -374,6 +396,11 @@ def __init__( class DiskPoolUpdate(msrest.serialization.Model): """Request payload for Update Disk Pool request. + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param disks: List of Azure Managed Disks to attach to a Disk Pool. @@ -381,6 +408,8 @@ class DiskPoolUpdate(msrest.serialization.Model): """ _attribute_map = { + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'disks': {'key': 'properties.disks', 'type': '[Disk]'}, } @@ -388,26 +417,38 @@ class DiskPoolUpdate(msrest.serialization.Model): def __init__( self, *, + managed_by: Optional[str] = None, + managed_by_extended: Optional[List[str]] = None, tags: Optional[Dict[str, str]] = None, disks: Optional[List["Disk"]] = None, **kwargs ): super(DiskPoolUpdate, self).__init__(**kwargs) + self.managed_by = managed_by + self.managed_by_extended = managed_by_extended self.tags = tags self.disks = disks class DiskPoolZoneInfo(msrest.serialization.Model): - """Disk Pool Sku Details. + """Disk Pool SKU Details. - :param availability_zones: Logical zone for Disk Pool resource; example: ["1"]. - :type availability_zones: list[str] - :param additional_capabilities: List of additional capabilities for Disk Pool. - :type additional_capabilities: list[str] - :param sku: Determines the SKU of VM deployed for Disk Pool. - :type sku: ~storage_pool_management.models.Sku + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar availability_zones: Logical zone for Disk Pool resource; example: ["1"]. + :vartype availability_zones: list[str] + :ivar additional_capabilities: List of additional capabilities for Disk Pool. + :vartype additional_capabilities: list[str] + :ivar sku: Determines the SKU of VM deployed for Disk Pool. + :vartype sku: ~storage_pool_management.models.Sku """ + _validation = { + 'availability_zones': {'readonly': True}, + 'additional_capabilities': {'readonly': True}, + 'sku': {'readonly': True}, + } + _attribute_map = { 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, 'additional_capabilities': {'key': 'additionalCapabilities', 'type': '[str]'}, @@ -416,27 +457,30 @@ class DiskPoolZoneInfo(msrest.serialization.Model): def __init__( self, - *, - availability_zones: Optional[List[str]] = None, - additional_capabilities: Optional[List[str]] = None, - sku: Optional["Sku"] = None, **kwargs ): super(DiskPoolZoneInfo, self).__init__(**kwargs) - self.availability_zones = availability_zones - self.additional_capabilities = additional_capabilities - self.sku = sku + self.availability_zones = None + self.additional_capabilities = None + self.sku = None class DiskPoolZoneListResult(msrest.serialization.Model): """List Disk Pool skus operation response. - :param value: The list of Disk Pool Skus. - :type value: list[~storage_pool_management.models.DiskPoolZoneInfo] - :param next_link: URI to fetch the next section of the paginated response. - :type next_link: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Disk Pool Skus. + :vartype value: list[~storage_pool_management.models.DiskPoolZoneInfo] + :ivar next_link: URI to fetch the next section of the paginated response. + :vartype next_link: str """ + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + _attribute_map = { 'value': {'key': 'value', 'type': '[DiskPoolZoneInfo]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, @@ -444,14 +488,11 @@ class DiskPoolZoneListResult(msrest.serialization.Model): def __init__( self, - *, - value: Optional[List["DiskPoolZoneInfo"]] = None, - next_link: Optional[str] = None, **kwargs ): super(DiskPoolZoneListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + self.value = None + self.next_link = None class EndpointDependency(msrest.serialization.Model): @@ -705,6 +746,11 @@ class IscsiTarget(ProxyResource): :vartype type: str :ivar system_data: Resource metadata required by ARM RPC. :vartype system_data: ~storage_pool_management.models.SystemMetadata + :ivar managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :vartype managed_by: str + :ivar managed_by_extended: List of Azure resource ids that manage this resource. + :vartype managed_by_extended: list[str] :param acl_mode: Required. Mode for Target connectivity. Possible values include: "Dynamic", "Static". :type acl_mode: str or ~storage_pool_management.models.IscsiTargetAclMode @@ -727,6 +773,8 @@ class IscsiTarget(ProxyResource): :type endpoints: list[str] :param port: The port used by iSCSI Target portal group. :type port: int + :ivar sessions: List of identifiers for active sessions on the iSCSI target. + :vartype sessions: list[str] """ _validation = { @@ -734,10 +782,13 @@ class IscsiTarget(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, + 'managed_by': {'readonly': True}, + 'managed_by_extended': {'readonly': True}, 'acl_mode': {'required': True}, 'target_iqn': {'required': True}, 'provisioning_state': {'required': True, 'readonly': True}, 'status': {'required': True}, + 'sessions': {'readonly': True}, } _attribute_map = { @@ -745,6 +796,8 @@ class IscsiTarget(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemMetadata'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'acl_mode': {'key': 'properties.aclMode', 'type': 'str'}, 'static_acls': {'key': 'properties.staticAcls', 'type': '[Acl]'}, 'luns': {'key': 'properties.luns', 'type': '[IscsiLun]'}, @@ -753,6 +806,7 @@ class IscsiTarget(ProxyResource): 'status': {'key': 'properties.status', 'type': 'str'}, 'endpoints': {'key': 'properties.endpoints', 'type': '[str]'}, 'port': {'key': 'properties.port', 'type': 'int'}, + 'sessions': {'key': 'properties.sessions', 'type': '[str]'}, } def __init__( @@ -769,6 +823,8 @@ def __init__( ): super(IscsiTarget, self).__init__(**kwargs) self.system_data = None + self.managed_by = None + self.managed_by_extended = None self.acl_mode = acl_mode self.static_acls = static_acls self.luns = luns @@ -777,6 +833,7 @@ def __init__( self.status = status self.endpoints = endpoints self.port = port + self.sessions = None class IscsiTargetCreate(ProxyResource): @@ -794,6 +851,11 @@ class IscsiTargetCreate(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param acl_mode: Required. Mode for Target connectivity. Possible values include: "Dynamic", "Static". :type acl_mode: str or ~storage_pool_management.models.IscsiTargetAclMode @@ -817,6 +879,8 @@ class IscsiTargetCreate(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'acl_mode': {'key': 'properties.aclMode', 'type': 'str'}, 'target_iqn': {'key': 'properties.targetIqn', 'type': 'str'}, 'static_acls': {'key': 'properties.staticAcls', 'type': '[Acl]'}, @@ -827,12 +891,16 @@ def __init__( self, *, acl_mode: Union[str, "IscsiTargetAclMode"], + managed_by: Optional[str] = None, + managed_by_extended: Optional[List[str]] = None, target_iqn: Optional[str] = None, static_acls: Optional[List["Acl"]] = None, luns: Optional[List["IscsiLun"]] = None, **kwargs ): super(IscsiTargetCreate, self).__init__(**kwargs) + self.managed_by = managed_by + self.managed_by_extended = managed_by_extended self.acl_mode = acl_mode self.target_iqn = target_iqn self.static_acls = static_acls @@ -886,6 +954,11 @@ class IscsiTargetUpdate(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :param managed_by: Azure resource id. Indicates if this resource is managed by another Azure + resource. + :type managed_by: str + :param managed_by_extended: List of Azure resource ids that manage this resource. + :type managed_by_extended: list[str] :param static_acls: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. :type static_acls: list[~storage_pool_management.models.Acl] :param luns: List of LUNs to be exposed through iSCSI Target. @@ -902,6 +975,8 @@ class IscsiTargetUpdate(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, 'static_acls': {'key': 'properties.staticAcls', 'type': '[Acl]'}, 'luns': {'key': 'properties.luns', 'type': '[IscsiLun]'}, } @@ -909,11 +984,15 @@ class IscsiTargetUpdate(ProxyResource): def __init__( self, *, + managed_by: Optional[str] = None, + managed_by_extended: Optional[List[str]] = None, static_acls: Optional[List["Acl"]] = None, luns: Optional[List["IscsiLun"]] = None, **kwargs ): super(IscsiTargetUpdate, self).__init__(**kwargs) + self.managed_by = managed_by + self.managed_by_extended = managed_by_extended self.static_acls = static_acls self.luns = luns @@ -979,6 +1058,256 @@ def __init__( self.next_link = None +class ResourceSkuCapability(msrest.serialization.Model): + """Capability a resource SKU has. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Capability name. + :vartype name: str + :ivar value: Capability value. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ResourceSkuInfo(msrest.serialization.Model): + """Resource SKU Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar api_version: StoragePool RP API version. + :vartype api_version: str + :ivar resource_type: StoragePool resource type. + :vartype resource_type: str + :ivar capabilities: List of additional capabilities for StoragePool resource. + :vartype capabilities: list[~storage_pool_management.models.ResourceSkuCapability] + :ivar location_info: Zones and zone capabilities in those locations where the SKU is available. + :vartype location_info: ~storage_pool_management.models.ResourceSkuLocationInfo + :ivar name: Sku name. + :vartype name: str + :ivar tier: Sku tier. + :vartype tier: str + :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :vartype restrictions: list[~storage_pool_management.models.ResourceSkuRestrictions] + """ + + _validation = { + 'api_version': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'location_info': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapability]'}, + 'location_info': {'key': 'locationInfo', 'type': 'ResourceSkuLocationInfo'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuInfo, self).__init__(**kwargs) + self.api_version = None + self.resource_type = None + self.capabilities = None + self.location_info = None + self.name = None + self.tier = None + self.restrictions = None + + +class ResourceSkuListResult(msrest.serialization.Model): + """List Disk Pool skus operation response. + + :param value: The list of StoragePool resource skus. + :type value: list[~storage_pool_management.models.ResourceSkuInfo] + :param next_link: URI to fetch the next section of the paginated response. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceSkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ResourceSkuInfo"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ResourceSkuListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """Zone and capability info for resource sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~storage_pool_management.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuRestrictionInfo(msrest.serialization.Model): + """Describes an available Compute SKU Restriction Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ResourceSkuRestrictions(msrest.serialization.Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. Possible values include: "Location", "Zone". + :vartype type: str or ~storage_pool_management.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + :vartype restriction_info: ~storage_pool_management.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", + "NotAvailableForSubscription". + :vartype reason_code: str or ~storage_pool_management.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~storage_pool_management.models.ResourceSkuCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + class Sku(msrest.serialization.Model): """Sku for ARM resource. diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_storage_pool_management_enums.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_storage_pool_management_enums.py index e0d37e8e0c09..ce18e1a3cb2e 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_storage_pool_management_enums.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/models/_storage_pool_management_enums.py @@ -75,3 +75,17 @@ class ProvisioningStates(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CREATING = "Creating" UPDATING = "Updating" DELETING = "Deleting" + +class ResourceSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for restriction. + """ + + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + +class ResourceSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of restrictions. + """ + + LOCATION = "Location" + ZONE = "Zone" diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/__init__.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/__init__.py index 1620075f15e8..5f769185377c 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/__init__.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/__init__.py @@ -9,11 +9,13 @@ from ._operations import Operations from ._disk_pools_operations import DiskPoolsOperations from ._disk_pool_zones_operations import DiskPoolZonesOperations +from ._resource_skus_operations import ResourceSkusOperations from ._iscsi_targets_operations import IscsiTargetsOperations __all__ = [ 'Operations', 'DiskPoolsOperations', 'DiskPoolZonesOperations', + 'ResourceSkusOperations', 'IscsiTargetsOperations', ] diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pool_zones_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pool_zones_operations.py index 5fe18b0f3bc1..ad3ec8eb6995 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pool_zones_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pool_zones_operations.py @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pools_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pools_operations.py index 9c0b82b6881b..815decfd2fa4 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pools_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_disk_pools_operations.py @@ -64,7 +64,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -135,7 +135,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -200,7 +200,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -254,7 +254,8 @@ def begin_create_or_update( **kwargs # type: Any ): # type: (...) -> LROPoller["_models.DiskPool"] - """Create or Update Disk pool. + """Create or Update Disk pool. This create or update operation can take 15 minutes to complete. + This is expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -331,7 +332,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -459,7 +460,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -500,7 +501,8 @@ def begin_delete( **kwargs # type: Any ): # type: (...) -> LROPoller[None] - """Delete a Disk pool. + """Delete a Disk pool; attached disks are not affected. This delete operation can take 10 minutes + to complete. This is expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -581,7 +583,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -641,7 +643,7 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -706,7 +708,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -747,7 +749,8 @@ def begin_start( **kwargs # type: Any ): # type: (...) -> LROPoller[None] - """The operation to start a Disk Pool. + """The operation to start a Disk Pool. This start operation can take 10 minutes to complete. This + is expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -817,7 +820,7 @@ def _deallocate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -859,7 +862,8 @@ def begin_deallocate( ): # type: (...) -> LROPoller[None] """Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute - resources that this Disk Pool uses. + resources that this Disk Pool uses. This operation can take 10 minutes to complete. This is + expected service behavior. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -916,3 +920,115 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/deallocate'} # type: ignore + + def _upgrade_initial( + self, + resource_group_name, # type: str + disk_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._upgrade_initial.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _upgrade_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/upgrade'} # type: ignore + + def begin_upgrade( + self, + resource_group_name, # type: str + disk_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Upgrade replaces the underlying virtual machine hosts one at a time. This operation can take + 10-15 minutes to complete. This is expected service behavior. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._upgrade_initial( + resource_group_name=resource_group_name, + disk_pool_name=disk_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/upgrade'} # type: ignore diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_iscsi_targets_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_iscsi_targets_operations.py index 50b40a40f4c9..5191f43263be 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_iscsi_targets_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_iscsi_targets_operations.py @@ -70,7 +70,7 @@ def list_by_disk_pool( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): @@ -137,7 +137,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -275,7 +275,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -410,7 +410,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL @@ -541,7 +541,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" # Construct URL diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_operations.py index 1d6fed7ae229..f1219eda8bb5 100644 --- a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_operations.py +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-08-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_resource_skus_operations.py b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_resource_skus_operations.py new file mode 100644 index 000000000000..e3214639530b --- /dev/null +++ b/sdk/storagepool/azure-mgmt-storagepool/azure/mgmt/storagepool/operations/_resource_skus_operations.py @@ -0,0 +1,118 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceSkusOperations(object): + """ResourceSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_pool_management.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceSkuListResult"] + """Lists available StoragePool resources and skus in an Azure location. + + :param location: The location of the resource. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceSkuListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~storage_pool_management.models.ResourceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/locations/{location}/skus'} # type: ignore