diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/_meta.json b/sdk/elasticsan/azure-mgmt-elasticsan/_meta.json index 83c9e134b654..dfc04fa2e49f 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/_meta.json +++ b/sdk/elasticsan/azure-mgmt-elasticsan/_meta.json @@ -1,11 +1,11 @@ { - "commit": "eabc87b2e8e5ab5d5365cb2db064d7fd25a65f1a", + "commit": "53f50b70d34c195587f9ec11f31d2dbc4bf73e50", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.6.0", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/elasticsan/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/elasticsan/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/elasticsan/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_configuration.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_configuration.py index 79a8b89ce670..e000042acbec 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_configuration.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_configuration.py @@ -29,14 +29,14 @@ class ElasticSanMgmtClientConfiguration(Configuration): # pylint: disable=too-m :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ElasticSanMgmtClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-12-01-preview") + api_version: str = kwargs.pop("api_version", "2023-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_elastic_san_mgmt_client.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_elastic_san_mgmt_client.py index 55cbbfe0e296..afbd7d5b0689 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_elastic_san_mgmt_client.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_elastic_san_mgmt_client.py @@ -22,6 +22,7 @@ PrivateLinkResourcesOperations, SkusOperations, VolumeGroupsOperations, + VolumeSnapshotsOperations, VolumesOperations, ) @@ -49,14 +50,16 @@ class ElasticSanMgmtClient: # pylint: disable=client-accepts-api-version-keywor :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.elasticsan.operations.PrivateLinkResourcesOperations + :ivar volume_snapshots: VolumeSnapshotsOperations operations + :vartype volume_snapshots: azure.mgmt.elasticsan.operations.VolumeSnapshotsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -89,6 +92,9 @@ def __init__( self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.volume_snapshots = VolumeSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_serialization.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_serialization.py index 842ae727fbbc..4bae2292227b 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_serialization.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_serialization.py @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_vendor.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_vendor.py index bd0df84f5319..0dafe0e287ff 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_vendor.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_version.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_version.py index dfa6ee022f15..e5754a47ce68 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_version.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_configuration.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_configuration.py index 64ec51eaa3ac..cbd9306721db 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_configuration.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_configuration.py @@ -29,14 +29,14 @@ class ElasticSanMgmtClientConfiguration(Configuration): # pylint: disable=too-m :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ElasticSanMgmtClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-12-01-preview") + api_version: str = kwargs.pop("api_version", "2023-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_elastic_san_mgmt_client.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_elastic_san_mgmt_client.py index 611662fe6f7a..de7d474a9034 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_elastic_san_mgmt_client.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/_elastic_san_mgmt_client.py @@ -22,6 +22,7 @@ PrivateLinkResourcesOperations, SkusOperations, VolumeGroupsOperations, + VolumeSnapshotsOperations, VolumesOperations, ) @@ -49,14 +50,16 @@ class ElasticSanMgmtClient: # pylint: disable=client-accepts-api-version-keywor :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.elasticsan.aio.operations.PrivateLinkResourcesOperations + :ivar volume_snapshots: VolumeSnapshotsOperations operations + :vartype volume_snapshots: azure.mgmt.elasticsan.aio.operations.VolumeSnapshotsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -89,6 +92,9 @@ def __init__( self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.volume_snapshots = VolumeSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/__init__.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/__init__.py index 4006110c0358..4c05449daf80 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/__init__.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/__init__.py @@ -13,6 +13,7 @@ from ._volumes_operations import VolumesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._volume_snapshots_operations import VolumeSnapshotsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -26,6 +27,7 @@ "VolumesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", + "VolumeSnapshotsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volume_snapshots_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volume_snapshots_operations.py new file mode 100644 index 000000000000..256818209764 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volume_snapshots_operations.py @@ -0,0 +1,617 @@ +# pylint: disable=too-many-lines +# 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 io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._volume_snapshots_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_by_volume_group_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class VolumeSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.elasticsan.aio.ElasticSanMgmtClient`'s + :attr:`volume_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_volume_group( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.Snapshot"]: + """List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using + filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param filter: Specify $filter='volumeName eq :code:``' to filter on volume. + Default value is None. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Snapshot or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SnapshotList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_volume_group_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + template_url=self.list_by_volume_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_by_volume_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots" + } + + async def _create_initial( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: Union[_models.Snapshot, IO], + **kwargs: Any + ) -> _models.Snapshot: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + request = build_create_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + @overload + async def begin_create( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Snapshot]: + """Create a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :param parameters: Snapshot object. Required. + :type parameters: ~azure.mgmt.elasticsan.models.Snapshot + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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 Snapshot or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Snapshot]: + """Create a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :param parameters: Snapshot object. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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 Snapshot or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: Union[_models.Snapshot, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.Snapshot]: + """Create a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :param parameters: Snapshot object. Is either a Snapshot type or a IO type. Required. + :type parameters: ~azure.mgmt.elasticsan.models.Snapshot or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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 Snapshot or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Snapshot", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, snapshot_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, snapshot_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + @distributed_trace_async + async def get( + self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, snapshot_name: str, **kwargs: Any + ) -> _models.Snapshot: + """Get a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.elasticsan.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volumes_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volumes_operations.py index d2b853a4192a..4b63587d30dc 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volumes_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/aio/operations/_volumes_operations.py @@ -567,7 +567,14 @@ def get_long_running_output(pipeline_response): } async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, volume_name: str, **kwargs: Any + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + volume_name: str, + x_ms_delete_snapshots: Optional[Union[str, _models.XMsDeleteSnapshots]] = None, + x_ms_force_delete: Optional[Union[str, _models.XMsForceDelete]] = None, + **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -589,6 +596,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements volume_group_name=volume_group_name, volume_name=volume_name, subscription_id=self._config.subscription_id, + x_ms_delete_snapshots=x_ms_delete_snapshots, + x_ms_force_delete=x_ms_force_delete, api_version=api_version, template_url=self._delete_initial.metadata["url"], headers=_headers, @@ -622,7 +631,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( - self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, volume_name: str, **kwargs: Any + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + volume_name: str, + x_ms_delete_snapshots: Optional[Union[str, _models.XMsDeleteSnapshots]] = None, + x_ms_force_delete: Optional[Union[str, _models.XMsForceDelete]] = None, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete an Volume. @@ -635,6 +651,14 @@ async def begin_delete( :type volume_group_name: str :param volume_name: The name of the Volume. Required. :type volume_name: str + :param x_ms_delete_snapshots: Optional, used to delete snapshots under volume. Allowed value + are only true or false. Default value is false. Known values are: "true" and "false". Default + value is None. + :type x_ms_delete_snapshots: str or ~azure.mgmt.elasticsan.models.XMsDeleteSnapshots + :param x_ms_force_delete: Optional, used to delete volume if active sessions present. Allowed + value are only true or false. Default value is false. Known values are: "true" and "false". + Default value is None. + :type x_ms_force_delete: str or ~azure.mgmt.elasticsan.models.XMsForceDelete :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 @@ -661,6 +685,8 @@ async def begin_delete( elastic_san_name=elastic_san_name, volume_group_name=volume_group_name, volume_name=volume_name, + x_ms_delete_snapshots=x_ms_delete_snapshots, + x_ms_force_delete=x_ms_force_delete, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/__init__.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/__init__.py index 59f0f696c08b..84df1a5a3e30 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/__init__.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/__init__.py @@ -9,10 +9,15 @@ from ._models_py3 import ElasticSan from ._models_py3 import ElasticSanList from ._models_py3 import ElasticSanUpdate +from ._models_py3 import EncryptionIdentity +from ._models_py3 import EncryptionProperties from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse +from ._models_py3 import Identity from ._models_py3 import IscsiTargetInfo +from ._models_py3 import KeyVaultProperties +from ._models_py3 import ManagedByInfo from ._models_py3 import NetworkRuleSet from ._models_py3 import Operation from ._models_py3 import OperationDisplay @@ -30,9 +35,13 @@ from ._models_py3 import SkuInformation from ._models_py3 import SkuInformationList from ._models_py3 import SkuLocationInfo +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotCreationData +from ._models_py3 import SnapshotList from ._models_py3 import SourceCreationData from ._models_py3 import SystemData from ._models_py3 import TrackedResource +from ._models_py3 import UserAssignedIdentity from ._models_py3 import VirtualNetworkRule from ._models_py3 import Volume from ._models_py3 import VolumeGroup @@ -41,17 +50,22 @@ from ._models_py3 import VolumeList from ._models_py3 import VolumeUpdate +from ._elastic_san_mgmt_client_enums import Action from ._elastic_san_mgmt_client_enums import ActionType from ._elastic_san_mgmt_client_enums import CreatedByType from ._elastic_san_mgmt_client_enums import EncryptionType +from ._elastic_san_mgmt_client_enums import IdentityType from ._elastic_san_mgmt_client_enums import OperationalStatus from ._elastic_san_mgmt_client_enums import Origin from ._elastic_san_mgmt_client_enums import PrivateEndpointServiceConnectionStatus from ._elastic_san_mgmt_client_enums import ProvisioningStates +from ._elastic_san_mgmt_client_enums import PublicNetworkAccess from ._elastic_san_mgmt_client_enums import SkuName from ._elastic_san_mgmt_client_enums import SkuTier -from ._elastic_san_mgmt_client_enums import State from ._elastic_san_mgmt_client_enums import StorageTargetType +from ._elastic_san_mgmt_client_enums import VolumeCreateOption +from ._elastic_san_mgmt_client_enums import XMsDeleteSnapshots +from ._elastic_san_mgmt_client_enums import XMsForceDelete from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -60,10 +74,15 @@ "ElasticSan", "ElasticSanList", "ElasticSanUpdate", + "EncryptionIdentity", + "EncryptionProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", + "Identity", "IscsiTargetInfo", + "KeyVaultProperties", + "ManagedByInfo", "NetworkRuleSet", "Operation", "OperationDisplay", @@ -81,9 +100,13 @@ "SkuInformation", "SkuInformationList", "SkuLocationInfo", + "Snapshot", + "SnapshotCreationData", + "SnapshotList", "SourceCreationData", "SystemData", "TrackedResource", + "UserAssignedIdentity", "VirtualNetworkRule", "Volume", "VolumeGroup", @@ -91,17 +114,22 @@ "VolumeGroupUpdate", "VolumeList", "VolumeUpdate", + "Action", "ActionType", "CreatedByType", "EncryptionType", + "IdentityType", "OperationalStatus", "Origin", "PrivateEndpointServiceConnectionStatus", "ProvisioningStates", + "PublicNetworkAccess", "SkuName", "SkuTier", - "State", "StorageTargetType", + "VolumeCreateOption", + "XMsDeleteSnapshots", + "XMsForceDelete", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_elastic_san_mgmt_client_enums.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_elastic_san_mgmt_client_enums.py index 1cf7cf7de649..5e80730c84d4 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_elastic_san_mgmt_client_enums.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_elastic_san_mgmt_client_enums.py @@ -10,6 +10,12 @@ from azure.core import CaseInsensitiveEnumMeta +class Action(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The action of virtual network rule.""" + + ALLOW = "Allow" + + class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" @@ -30,6 +36,17 @@ class EncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = "EncryptionAtRestWithPlatformKey" """Volume is encrypted at rest with Platform managed key. It is the default encryption type.""" + ENCRYPTION_AT_REST_WITH_CUSTOMER_MANAGED_KEY = "EncryptionAtRestWithCustomerManagedKey" + """Volume is encrypted at rest with Customer managed key that can be changed and revoked by a + #: customer.""" + + +class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The identity type.""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" class OperationalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -77,6 +94,15 @@ class ProvisioningStates(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETING = "Deleting" +class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must + be 'Enabled' or 'Disabled'. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The sku name.""" @@ -93,18 +119,32 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Premium Tier""" -class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Gets the state of virtual network rule.""" - - PROVISIONING = "provisioning" - DEPROVISIONING = "deprovisioning" - SUCCEEDED = "succeeded" - FAILED = "failed" - NETWORK_SOURCE_DELETED = "networkSourceDeleted" - - class StorageTargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Storage Target type.""" ISCSI = "Iscsi" NONE = "None" + + +class VolumeCreateOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This enumerates the possible sources of a volume creation.""" + + NONE = "None" + VOLUME_SNAPSHOT = "VolumeSnapshot" + DISK_SNAPSHOT = "DiskSnapshot" + DISK = "Disk" + DISK_RESTORE_POINT = "DiskRestorePoint" + + +class XMsDeleteSnapshots(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """XMsDeleteSnapshots.""" + + TRUE = "true" + FALSE = "false" + + +class XMsForceDelete(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """XMsForceDelete.""" + + TRUE = "true" + FALSE = "false" diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_models_py3.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_models_py3.py index 0a8b37732142..d6140265ef8a 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_models_py3.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/models/_models_py3.py @@ -8,16 +8,10 @@ # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -164,6 +158,10 @@ class ElasticSan(TrackedResource): # pylint: disable=too-many-instance-attribut :ivar private_endpoint_connections: The list of Private Endpoint Connections. :vartype private_endpoint_connections: list[~azure.mgmt.elasticsan.models.PrivateEndpointConnection] + :ivar public_network_access: Allow or disallow public network access to ElasticSan. Value is + optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and + "Disabled". + :vartype public_network_access: str or ~azure.mgmt.elasticsan.models.PublicNetworkAccess """ _validation = { @@ -205,6 +203,7 @@ class ElasticSan(TrackedResource): # pylint: disable=too-many-instance-attribut "key": "properties.privateEndpointConnections", "type": "[PrivateEndpointConnection]", }, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, } def __init__( @@ -216,6 +215,7 @@ def __init__( extended_capacity_size_ti_b: int, tags: Optional[Dict[str, str]] = None, availability_zones: Optional[List[str]] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any ) -> None: """ @@ -232,6 +232,10 @@ def __init__( :keyword extended_capacity_size_ti_b: Extended size of the Elastic San appliance in TiB. Required. :paramtype extended_capacity_size_ti_b: int + :keyword public_network_access: Allow or disallow public network access to ElasticSan. Value is + optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and + "Disabled". + :paramtype public_network_access: str or ~azure.mgmt.elasticsan.models.PublicNetworkAccess """ super().__init__(tags=tags, location=location, **kwargs) self.sku = sku @@ -245,6 +249,7 @@ def __init__( self.total_m_bps = None self.total_size_ti_b = None self.private_endpoint_connections = None + self.public_network_access = public_network_access class ElasticSanList(_serialization.Model): @@ -286,12 +291,17 @@ class ElasticSanUpdate(_serialization.Model): :vartype base_size_ti_b: int :ivar extended_capacity_size_ti_b: Extended size of the Elastic San appliance in TiB. :vartype extended_capacity_size_ti_b: int + :ivar public_network_access: Allow or disallow public network access to ElasticSan Account. + Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: + "Enabled" and "Disabled". + :vartype public_network_access: str or ~azure.mgmt.elasticsan.models.PublicNetworkAccess """ _attribute_map = { "tags": {"key": "tags", "type": "{str}"}, "base_size_ti_b": {"key": "properties.baseSizeTiB", "type": "int"}, "extended_capacity_size_ti_b": {"key": "properties.extendedCapacitySizeTiB", "type": "int"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, } def __init__( @@ -300,6 +310,7 @@ def __init__( tags: Optional[Dict[str, str]] = None, base_size_ti_b: Optional[int] = None, extended_capacity_size_ti_b: Optional[int] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any ) -> None: """ @@ -309,11 +320,70 @@ def __init__( :paramtype base_size_ti_b: int :keyword extended_capacity_size_ti_b: Extended size of the Elastic San appliance in TiB. :paramtype extended_capacity_size_ti_b: int + :keyword public_network_access: Allow or disallow public network access to ElasticSan Account. + Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: + "Enabled" and "Disabled". + :paramtype public_network_access: str or ~azure.mgmt.elasticsan.models.PublicNetworkAccess """ super().__init__(**kwargs) self.tags = tags self.base_size_ti_b = base_size_ti_b self.extended_capacity_size_ti_b = extended_capacity_size_ti_b + self.public_network_access = public_network_access + + +class EncryptionIdentity(_serialization.Model): + """Encryption identity for the volume group. + + :ivar encryption_user_assigned_identity: Resource identifier of the UserAssigned identity to be + associated with server-side encryption on the volume group. + :vartype encryption_user_assigned_identity: str + """ + + _attribute_map = { + "encryption_user_assigned_identity": {"key": "userAssignedIdentity", "type": "str"}, + } + + def __init__(self, *, encryption_user_assigned_identity: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword encryption_user_assigned_identity: Resource identifier of the UserAssigned identity to + be associated with server-side encryption on the volume group. + :paramtype encryption_user_assigned_identity: str + """ + super().__init__(**kwargs) + self.encryption_user_assigned_identity = encryption_user_assigned_identity + + +class EncryptionProperties(_serialization.Model): + """The encryption settings on the volume group. + + :ivar key_vault_properties: Properties provided by key vault. + :vartype key_vault_properties: ~azure.mgmt.elasticsan.models.KeyVaultProperties + :ivar encryption_identity: The identity to be used with service-side encryption at rest. + :vartype encryption_identity: ~azure.mgmt.elasticsan.models.EncryptionIdentity + """ + + _attribute_map = { + "key_vault_properties": {"key": "keyVaultProperties", "type": "KeyVaultProperties"}, + "encryption_identity": {"key": "identity", "type": "EncryptionIdentity"}, + } + + def __init__( + self, + *, + key_vault_properties: Optional["_models.KeyVaultProperties"] = None, + encryption_identity: Optional["_models.EncryptionIdentity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword key_vault_properties: Properties provided by key vault. + :paramtype key_vault_properties: ~azure.mgmt.elasticsan.models.KeyVaultProperties + :keyword encryption_identity: The identity to be used with service-side encryption at rest. + :paramtype encryption_identity: ~azure.mgmt.elasticsan.models.EncryptionIdentity + """ + super().__init__(**kwargs) + self.key_vault_properties = key_vault_properties + self.encryption_identity = encryption_identity class ErrorAdditionalInfo(_serialization.Model): @@ -408,6 +478,64 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error +class Identity(_serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Required. Known values are: "None", "SystemAssigned", and + "UserAssigned". + :vartype type: str or ~azure.mgmt.elasticsan.models.IdentityType + :ivar user_assigned_identities: Gets or sets a list of key value pairs that describe the set of + User Assigned identities that will be used with this volume group. The key is the ARM resource + identifier of the identity. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.elasticsan.models.UserAssignedIdentity] + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, + } + + def __init__( + self, + *, + type: Union[str, "_models.IdentityType"], + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: The identity type. Required. Known values are: "None", "SystemAssigned", and + "UserAssigned". + :paramtype type: str or ~azure.mgmt.elasticsan.models.IdentityType + :keyword user_assigned_identities: Gets or sets a list of key value pairs that describe the set + of User Assigned identities that will be used with this volume group. The key is the ARM + resource identifier of the identity. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.elasticsan.models.UserAssignedIdentity] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + class IscsiTargetInfo(_serialization.Model): """Iscsi target information. @@ -458,6 +586,92 @@ def __init__(self, *, status: Optional[Union[str, "_models.OperationalStatus"]] self.status = status +class KeyVaultProperties(_serialization.Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: The name of KeyVault key. + :vartype key_name: str + :ivar key_version: The version of KeyVault key. + :vartype key_version: str + :ivar key_vault_uri: The Uri of KeyVault. + :vartype key_vault_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + :ivar current_versioned_key_expiration_timestamp: This is a read only property that represents + the expiration time of the current version of the customer managed key used for encryption. + :vartype current_versioned_key_expiration_timestamp: ~datetime.datetime + """ + + _validation = { + "current_versioned_key_identifier": {"readonly": True}, + "last_key_rotation_timestamp": {"readonly": True}, + "current_versioned_key_expiration_timestamp": {"readonly": True}, + } + + _attribute_map = { + "key_name": {"key": "keyName", "type": "str"}, + "key_version": {"key": "keyVersion", "type": "str"}, + "key_vault_uri": {"key": "keyVaultUri", "type": "str"}, + "current_versioned_key_identifier": {"key": "currentVersionedKeyIdentifier", "type": "str"}, + "last_key_rotation_timestamp": {"key": "lastKeyRotationTimestamp", "type": "iso-8601"}, + "current_versioned_key_expiration_timestamp": { + "key": "currentVersionedKeyExpirationTimestamp", + "type": "iso-8601", + }, + } + + def __init__( + self, + *, + key_name: Optional[str] = None, + key_version: Optional[str] = None, + key_vault_uri: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword key_name: The name of KeyVault key. + :paramtype key_name: str + :keyword key_version: The version of KeyVault key. + :paramtype key_version: str + :keyword key_vault_uri: The Uri of KeyVault. + :paramtype key_vault_uri: str + """ + super().__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + self.current_versioned_key_expiration_timestamp = None + + +class ManagedByInfo(_serialization.Model): + """Parent resource information. + + :ivar resource_id: Resource ID of the resource managing the volume, this is a restricted field + and can only be set for internal use. + :vartype resource_id: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource ID of the resource managing the volume, this is a restricted + field and can only be set for internal use. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + + class NetworkRuleSet(_serialization.Model): """A set of rules governing the network accessibility. @@ -1081,36 +1295,163 @@ def __init__(self, **kwargs: Any) -> None: self.zones = None +class Snapshot(ProxyResource): + """Response for Volume Snapshot request. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.elasticsan.models.SystemData + :ivar creation_data: Data used when creating a volume snapshot. Required. + :vartype creation_data: ~azure.mgmt.elasticsan.models.SnapshotCreationData + :ivar provisioning_state: State of the operation on the resource. Known values are: "Invalid", + "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.elasticsan.models.ProvisioningStates + :ivar source_volume_size_gi_b: Size of Source Volume. + :vartype source_volume_size_gi_b: int + :ivar volume_name: Source Volume Name of a snapshot. + :vartype volume_name: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "creation_data": {"required": True}, + "provisioning_state": {"readonly": True}, + "source_volume_size_gi_b": {"readonly": True}, + "volume_name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "creation_data": {"key": "properties.creationData", "type": "SnapshotCreationData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "source_volume_size_gi_b": {"key": "properties.sourceVolumeSizeGiB", "type": "int"}, + "volume_name": {"key": "properties.volumeName", "type": "str"}, + } + + def __init__(self, *, creation_data: "_models.SnapshotCreationData", **kwargs: Any) -> None: + """ + :keyword creation_data: Data used when creating a volume snapshot. Required. + :paramtype creation_data: ~azure.mgmt.elasticsan.models.SnapshotCreationData + """ + super().__init__(**kwargs) + self.creation_data = creation_data + self.provisioning_state = None + self.source_volume_size_gi_b = None + self.volume_name = None + + +class SnapshotCreationData(_serialization.Model): + """Data used when creating a volume snapshot. + + All required parameters must be populated in order to send to Azure. + + :ivar source_id: Fully qualified resource ID of the volume. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}". + Required. + :vartype source_id: str + """ + + _validation = { + "source_id": {"required": True}, + } + + _attribute_map = { + "source_id": {"key": "sourceId", "type": "str"}, + } + + def __init__(self, *, source_id: str, **kwargs: Any) -> None: + """ + :keyword source_id: Fully qualified resource ID of the volume. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}". + Required. + :paramtype source_id: str + """ + super().__init__(**kwargs) + self.source_id = source_id + + +class SnapshotList(_serialization.Model): + """List of Snapshots. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of Snapshot objects. + :vartype value: list[~azure.mgmt.elasticsan.models.Snapshot] + :ivar next_link: URI to fetch the next section of the paginated response. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Snapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: An array of Snapshot objects. + :paramtype value: list[~azure.mgmt.elasticsan.models.Snapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + class SourceCreationData(_serialization.Model): """Data source used when creating the volume. - :ivar create_source: This enumerates the possible sources of a volume creation. Default value - is "None". - :vartype create_source: str - :ivar source_uri: If createOption is Copy, this is the ARM id of the source snapshot or disk. - If createOption is Restore, this is the ARM-like id of the source disk restore point. - :vartype source_uri: str + :ivar create_source: This enumerates the possible sources of a volume creation. Known values + are: "None", "VolumeSnapshot", "DiskSnapshot", "Disk", and "DiskRestorePoint". + :vartype create_source: str or ~azure.mgmt.elasticsan.models.VolumeCreateOption + :ivar source_id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype source_id: str """ _attribute_map = { "create_source": {"key": "createSource", "type": "str"}, - "source_uri": {"key": "sourceUri", "type": "str"}, + "source_id": {"key": "sourceId", "type": "str"}, } def __init__( - self, *, create_source: Optional[Literal["None"]] = None, source_uri: Optional[str] = None, **kwargs: Any + self, + *, + create_source: Optional[Union[str, "_models.VolumeCreateOption"]] = None, + source_id: Optional[str] = None, + **kwargs: Any ) -> None: """ - :keyword create_source: This enumerates the possible sources of a volume creation. Default - value is "None". - :paramtype create_source: str - :keyword source_uri: If createOption is Copy, this is the ARM id of the source snapshot or - disk. If createOption is Restore, this is the ARM-like id of the source disk restore point. - :paramtype source_uri: str + :keyword create_source: This enumerates the possible sources of a volume creation. Known values + are: "None", "VolumeSnapshot", "DiskSnapshot", "Disk", and "DiskRestorePoint". + :paramtype create_source: str or ~azure.mgmt.elasticsan.models.VolumeCreateOption + :keyword source_id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :paramtype source_id: str """ super().__init__(**kwargs) self.create_source = create_source - self.source_uri = source_uri + self.source_id = source_id class SystemData(_serialization.Model): @@ -1177,48 +1518,70 @@ def __init__( self.last_modified_at = last_modified_at -class VirtualNetworkRule(_serialization.Model): - """Virtual Network rule. +class UserAssignedIdentity(_serialization.Model): + """UserAssignedIdentity for the resource. Variables are only populated by the server, and will be ignored when sending a request. + :ivar principal_id: The principal ID of the identity. + :vartype principal_id: str + :ivar client_id: The client ID of the identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class VirtualNetworkRule(_serialization.Model): + """Virtual Network rule. + All required parameters must be populated in order to send to Azure. :ivar virtual_network_resource_id: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. Required. :vartype virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value is "Allow". - :vartype action: str - :ivar state: Gets the state of virtual network rule. Known values are: "provisioning", - "deprovisioning", "succeeded", "failed", and "networkSourceDeleted". - :vartype state: str or ~azure.mgmt.elasticsan.models.State + :ivar action: The action of virtual network rule. "Allow" + :vartype action: str or ~azure.mgmt.elasticsan.models.Action """ _validation = { "virtual_network_resource_id": {"required": True}, - "state": {"readonly": True}, } _attribute_map = { "virtual_network_resource_id": {"key": "id", "type": "str"}, "action": {"key": "action", "type": "str"}, - "state": {"key": "state", "type": "str"}, } - def __init__(self, *, virtual_network_resource_id: str, action: Literal["Allow"] = "Allow", **kwargs: Any) -> None: + def __init__( + self, *, virtual_network_resource_id: str, action: Union[str, "_models.Action"] = "Allow", **kwargs: Any + ) -> None: """ :keyword virtual_network_resource_id: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. Required. :paramtype virtual_network_resource_id: str - :keyword action: The action of virtual network rule. Default value is "Allow". - :paramtype action: str + :keyword action: The action of virtual network rule. "Allow" + :paramtype action: str or ~azure.mgmt.elasticsan.models.Action """ super().__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id self.action = action - self.state = None class Volume(ProxyResource): @@ -1247,6 +1610,11 @@ class Volume(ProxyResource): :vartype size_gi_b: int :ivar storage_target: Storage target information. :vartype storage_target: ~azure.mgmt.elasticsan.models.IscsiTargetInfo + :ivar managed_by: Parent resource information. + :vartype managed_by: ~azure.mgmt.elasticsan.models.ManagedByInfo + :ivar provisioning_state: State of the operation on the resource. Known values are: "Invalid", + "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.elasticsan.models.ProvisioningStates """ _validation = { @@ -1257,6 +1625,7 @@ class Volume(ProxyResource): "volume_id": {"readonly": True}, "size_gi_b": {"required": True}, "storage_target": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { @@ -1268,25 +1637,36 @@ class Volume(ProxyResource): "creation_data": {"key": "properties.creationData", "type": "SourceCreationData"}, "size_gi_b": {"key": "properties.sizeGiB", "type": "int"}, "storage_target": {"key": "properties.storageTarget", "type": "IscsiTargetInfo"}, + "managed_by": {"key": "properties.managedBy", "type": "ManagedByInfo"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } def __init__( - self, *, size_gi_b: int, creation_data: Optional["_models.SourceCreationData"] = None, **kwargs: Any + self, + *, + size_gi_b: int, + creation_data: Optional["_models.SourceCreationData"] = None, + managed_by: Optional["_models.ManagedByInfo"] = None, + **kwargs: Any ) -> None: """ :keyword creation_data: State of the operation on the resource. :paramtype creation_data: ~azure.mgmt.elasticsan.models.SourceCreationData :keyword size_gi_b: Volume size. Required. :paramtype size_gi_b: int + :keyword managed_by: Parent resource information. + :paramtype managed_by: ~azure.mgmt.elasticsan.models.ManagedByInfo """ super().__init__(**kwargs) self.volume_id = None self.creation_data = creation_data self.size_gi_b = size_gi_b self.storage_target = None + self.managed_by = managed_by + self.provisioning_state = None -class VolumeGroup(ProxyResource): +class VolumeGroup(ProxyResource): # pylint: disable=too-many-instance-attributes """Response for Volume Group request. Variables are only populated by the server, and will be ignored when sending a request. @@ -1302,13 +1682,19 @@ class VolumeGroup(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.elasticsan.models.SystemData + :ivar identity: The identity of the resource. + :vartype identity: ~azure.mgmt.elasticsan.models.Identity :ivar provisioning_state: State of the operation on the resource. Known values are: "Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.elasticsan.models.ProvisioningStates :ivar protocol_type: Type of storage target. Known values are: "Iscsi" and "None". :vartype protocol_type: str or ~azure.mgmt.elasticsan.models.StorageTargetType - :ivar encryption: Type of encryption. "EncryptionAtRestWithPlatformKey" + :ivar encryption: Type of encryption. Known values are: "EncryptionAtRestWithPlatformKey" and + "EncryptionAtRestWithCustomerManagedKey". :vartype encryption: str or ~azure.mgmt.elasticsan.models.EncryptionType + :ivar encryption_properties: Encryption Properties describing Key Vault and Identity + information. + :vartype encryption_properties: ~azure.mgmt.elasticsan.models.EncryptionProperties :ivar network_acls: A collection of rules governing the accessibility from specific network locations. :vartype network_acls: ~azure.mgmt.elasticsan.models.NetworkRuleSet @@ -1331,9 +1717,11 @@ class VolumeGroup(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "Identity"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "protocol_type": {"key": "properties.protocolType", "type": "str"}, "encryption": {"key": "properties.encryption", "type": "str"}, + "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"}, "network_acls": {"key": "properties.networkAcls", "type": "NetworkRuleSet"}, "private_endpoint_connections": { "key": "properties.privateEndpointConnections", @@ -1344,24 +1732,34 @@ class VolumeGroup(ProxyResource): def __init__( self, *, + identity: Optional["_models.Identity"] = None, protocol_type: Optional[Union[str, "_models.StorageTargetType"]] = None, encryption: Optional[Union[str, "_models.EncryptionType"]] = None, + encryption_properties: Optional["_models.EncryptionProperties"] = None, network_acls: Optional["_models.NetworkRuleSet"] = None, **kwargs: Any ) -> None: """ + :keyword identity: The identity of the resource. + :paramtype identity: ~azure.mgmt.elasticsan.models.Identity :keyword protocol_type: Type of storage target. Known values are: "Iscsi" and "None". :paramtype protocol_type: str or ~azure.mgmt.elasticsan.models.StorageTargetType - :keyword encryption: Type of encryption. "EncryptionAtRestWithPlatformKey" + :keyword encryption: Type of encryption. Known values are: "EncryptionAtRestWithPlatformKey" + and "EncryptionAtRestWithCustomerManagedKey". :paramtype encryption: str or ~azure.mgmt.elasticsan.models.EncryptionType + :keyword encryption_properties: Encryption Properties describing Key Vault and Identity + information. + :paramtype encryption_properties: ~azure.mgmt.elasticsan.models.EncryptionProperties :keyword network_acls: A collection of rules governing the accessibility from specific network locations. :paramtype network_acls: ~azure.mgmt.elasticsan.models.NetworkRuleSet """ super().__init__(**kwargs) + self.identity = identity self.provisioning_state = None self.protocol_type = protocol_type self.encryption = encryption + self.encryption_properties = encryption_properties self.network_acls = network_acls self.private_endpoint_connections = None @@ -1399,41 +1797,59 @@ def __init__(self, *, value: Optional[List["_models.VolumeGroup"]] = None, **kwa class VolumeGroupUpdate(_serialization.Model): """Volume Group request. + :ivar identity: The identity of the resource. + :vartype identity: ~azure.mgmt.elasticsan.models.Identity :ivar protocol_type: Type of storage target. Known values are: "Iscsi" and "None". :vartype protocol_type: str or ~azure.mgmt.elasticsan.models.StorageTargetType - :ivar encryption: Type of encryption. "EncryptionAtRestWithPlatformKey" + :ivar encryption: Type of encryption. Known values are: "EncryptionAtRestWithPlatformKey" and + "EncryptionAtRestWithCustomerManagedKey". :vartype encryption: str or ~azure.mgmt.elasticsan.models.EncryptionType + :ivar encryption_properties: Encryption Properties describing Key Vault and Identity + information. + :vartype encryption_properties: ~azure.mgmt.elasticsan.models.EncryptionProperties :ivar network_acls: A collection of rules governing the accessibility from specific network locations. :vartype network_acls: ~azure.mgmt.elasticsan.models.NetworkRuleSet """ _attribute_map = { + "identity": {"key": "identity", "type": "Identity"}, "protocol_type": {"key": "properties.protocolType", "type": "str"}, "encryption": {"key": "properties.encryption", "type": "str"}, + "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"}, "network_acls": {"key": "properties.networkAcls", "type": "NetworkRuleSet"}, } def __init__( self, *, + identity: Optional["_models.Identity"] = None, protocol_type: Optional[Union[str, "_models.StorageTargetType"]] = None, encryption: Optional[Union[str, "_models.EncryptionType"]] = None, + encryption_properties: Optional["_models.EncryptionProperties"] = None, network_acls: Optional["_models.NetworkRuleSet"] = None, **kwargs: Any ) -> None: """ + :keyword identity: The identity of the resource. + :paramtype identity: ~azure.mgmt.elasticsan.models.Identity :keyword protocol_type: Type of storage target. Known values are: "Iscsi" and "None". :paramtype protocol_type: str or ~azure.mgmt.elasticsan.models.StorageTargetType - :keyword encryption: Type of encryption. "EncryptionAtRestWithPlatformKey" + :keyword encryption: Type of encryption. Known values are: "EncryptionAtRestWithPlatformKey" + and "EncryptionAtRestWithCustomerManagedKey". :paramtype encryption: str or ~azure.mgmt.elasticsan.models.EncryptionType + :keyword encryption_properties: Encryption Properties describing Key Vault and Identity + information. + :paramtype encryption_properties: ~azure.mgmt.elasticsan.models.EncryptionProperties :keyword network_acls: A collection of rules governing the accessibility from specific network locations. :paramtype network_acls: ~azure.mgmt.elasticsan.models.NetworkRuleSet """ super().__init__(**kwargs) + self.identity = identity self.protocol_type = protocol_type self.encryption = encryption + self.encryption_properties = encryption_properties self.network_acls = network_acls @@ -1472,16 +1888,24 @@ class VolumeUpdate(_serialization.Model): :ivar size_gi_b: Volume size. :vartype size_gi_b: int + :ivar managed_by: Parent resource information. + :vartype managed_by: ~azure.mgmt.elasticsan.models.ManagedByInfo """ _attribute_map = { "size_gi_b": {"key": "properties.sizeGiB", "type": "int"}, + "managed_by": {"key": "properties.managedBy", "type": "ManagedByInfo"}, } - def __init__(self, *, size_gi_b: Optional[int] = None, **kwargs: Any) -> None: + def __init__( + self, *, size_gi_b: Optional[int] = None, managed_by: Optional["_models.ManagedByInfo"] = None, **kwargs: Any + ) -> None: """ :keyword size_gi_b: Volume size. :paramtype size_gi_b: int + :keyword managed_by: Parent resource information. + :paramtype managed_by: ~azure.mgmt.elasticsan.models.ManagedByInfo """ super().__init__(**kwargs) self.size_gi_b = size_gi_b + self.managed_by = managed_by diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/__init__.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/__init__.py index 4006110c0358..4c05449daf80 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/__init__.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/__init__.py @@ -13,6 +13,7 @@ from ._volumes_operations import VolumesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._volume_snapshots_operations import VolumeSnapshotsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -26,6 +27,7 @@ "VolumesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", + "VolumeSnapshotsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_elastic_sans_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_elastic_sans_operations.py index 9539163824d6..529c34fdc7ab 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_elastic_sans_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_elastic_sans_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +43,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -67,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +82,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -99,7 +99,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +123,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -166,7 +166,7 @@ def build_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -185,7 +185,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +208,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -225,7 +225,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -248,7 +248,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_operations.py index 97eb0953c9e5..5fa56ca8ae10 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_operations.py @@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_endpoint_connections_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_endpoint_connections_operations.py index c4f7a99a4ab4..2c376baede6a 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_endpoint_connections_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_endpoint_connections_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +49,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -76,7 +76,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -99,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +125,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,7 +146,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +172,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -189,7 +189,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +212,7 @@ def build_list_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_link_resources_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_link_resources_operations.py index 1925047e5638..f6cf2331754c 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_link_resources_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_private_link_resources_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,7 @@ def build_list_by_elastic_san_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_elastic_san_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_skus_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_skus_operations.py index eb9a6524e9fe..2c17b5a11e09 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_skus_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_skus_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,7 @@ def build_list_request(subscription_id: str, *, filter: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +49,7 @@ def build_list_request(subscription_id: str, *, filter: Optional[str] = None, ** "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_groups_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_groups_operations.py index 2fe1a1a43d7f..bbe1ec449da1 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_groups_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_groups_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,7 @@ def build_list_by_elastic_san_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_elastic_san_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,7 +85,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -117,7 +117,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,7 +136,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,7 +168,7 @@ def build_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,7 +187,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,7 +235,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -266,7 +266,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_snapshots_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_snapshots_operations.py new file mode 100644 index 000000000000..274ce77c64c4 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volume_snapshots_operations.py @@ -0,0 +1,853 @@ +# pylint: disable=too-many-lines +# 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 io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_volume_group_request( + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "elasticSanName": _SERIALIZER.url( + "elastic_san_name", + elastic_san_name, + "str", + max_length=24, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "volumeGroupName": _SERIALIZER.url( + "volume_group_name", + volume_group_name, + "str", + max_length=63, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_request( + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "elasticSanName": _SERIALIZER.url( + "elastic_san_name", + elastic_san_name, + "str", + max_length=24, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "volumeGroupName": _SERIALIZER.url( + "volume_group_name", + volume_group_name, + "str", + max_length=63, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "snapshotName": _SERIALIZER.url( + "snapshot_name", + snapshot_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-z0-9]+(?:[._-][a-z0-9]+)*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "elasticSanName": _SERIALIZER.url( + "elastic_san_name", + elastic_san_name, + "str", + max_length=24, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "volumeGroupName": _SERIALIZER.url( + "volume_group_name", + volume_group_name, + "str", + max_length=63, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "snapshotName": _SERIALIZER.url( + "snapshot_name", + snapshot_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-z0-9]+(?:[._-][a-z0-9]+)*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "elasticSanName": _SERIALIZER.url( + "elastic_san_name", + elastic_san_name, + "str", + max_length=24, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "volumeGroupName": _SERIALIZER.url( + "volume_group_name", + volume_group_name, + "str", + max_length=63, + min_length=3, + pattern=r"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$", + ), + "snapshotName": _SERIALIZER.url( + "snapshot_name", + snapshot_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-z0-9]+(?:[._-][a-z0-9]+)*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class VolumeSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.elasticsan.ElasticSanMgmtClient`'s + :attr:`volume_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_volume_group( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.Snapshot"]: + """List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using + filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param filter: Specify $filter='volumeName eq :code:``' to filter on volume. + Default value is None. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Snapshot or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SnapshotList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_volume_group_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + template_url=self.list_by_volume_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_volume_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots" + } + + def _create_initial( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: Union[_models.Snapshot, IO], + **kwargs: Any + ) -> _models.Snapshot: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + request = build_create_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + @overload + def begin_create( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Snapshot]: + """Create a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :param parameters: Snapshot object. Required. + :type parameters: ~azure.mgmt.elasticsan.models.Snapshot + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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 Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Snapshot]: + """Create a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :param parameters: Snapshot object. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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 Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + snapshot_name: str, + parameters: Union[_models.Snapshot, IO], + **kwargs: Any + ) -> LROPoller[_models.Snapshot]: + """Create a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :param parameters: Snapshot object. Is either a Snapshot type or a IO type. Required. + :type parameters: ~azure.mgmt.elasticsan.models.Snapshot or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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 Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.elasticsan.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Snapshot", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, snapshot_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + @distributed_trace + def begin_delete( + self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, snapshot_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } + + @distributed_trace + def get( + self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, snapshot_name: str, **kwargs: Any + ) -> _models.Snapshot: + """Get a Volume Snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param elastic_san_name: The name of the ElasticSan. Required. + :type elastic_san_name: str + :param volume_group_name: The name of the VolumeGroup. Required. + :type volume_group_name: str + :param snapshot_name: The name of the volume snapshot within the given volume group. Required. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.elasticsan.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + elastic_san_name=elastic_san_name, + volume_group_name=volume_group_name, + snapshot_name=snapshot_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}" + } diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volumes_operations.py b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volumes_operations.py index a036ca8c73a5..53b4813333d4 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volumes_operations.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/azure/mgmt/elasticsan/operations/_volumes_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +50,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -85,7 +85,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +109,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -144,7 +144,7 @@ def build_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,12 +163,15 @@ def build_delete_request( volume_group_name: str, volume_name: str, subscription_id: str, + *, + x_ms_delete_snapshots: Optional[Union[str, _models.XMsDeleteSnapshots]] = None, + x_ms_force_delete: Optional[Union[str, _models.XMsForceDelete]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,12 +205,16 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if x_ms_delete_snapshots is not None: + _headers["x-ms-delete-snapshots"] = _SERIALIZER.header("x_ms_delete_snapshots", x_ms_delete_snapshots, "str") + if x_ms_force_delete is not None: + _headers["x-ms-force-delete"] = _SERIALIZER.header("x_ms_force_delete", x_ms_force_delete, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) @@ -224,7 +231,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +265,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -275,7 +282,7 @@ def build_list_by_volume_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -306,7 +313,7 @@ def build_list_by_volume_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -835,7 +842,14 @@ def get_long_running_output(pipeline_response): } def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, volume_name: str, **kwargs: Any + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + volume_name: str, + x_ms_delete_snapshots: Optional[Union[str, _models.XMsDeleteSnapshots]] = None, + x_ms_force_delete: Optional[Union[str, _models.XMsForceDelete]] = None, + **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -857,6 +871,8 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements volume_group_name=volume_group_name, volume_name=volume_name, subscription_id=self._config.subscription_id, + x_ms_delete_snapshots=x_ms_delete_snapshots, + x_ms_force_delete=x_ms_force_delete, api_version=api_version, template_url=self._delete_initial.metadata["url"], headers=_headers, @@ -890,7 +906,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace def begin_delete( - self, resource_group_name: str, elastic_san_name: str, volume_group_name: str, volume_name: str, **kwargs: Any + self, + resource_group_name: str, + elastic_san_name: str, + volume_group_name: str, + volume_name: str, + x_ms_delete_snapshots: Optional[Union[str, _models.XMsDeleteSnapshots]] = None, + x_ms_force_delete: Optional[Union[str, _models.XMsForceDelete]] = None, + **kwargs: Any ) -> LROPoller[None]: """Delete an Volume. @@ -903,6 +926,14 @@ def begin_delete( :type volume_group_name: str :param volume_name: The name of the Volume. Required. :type volume_name: str + :param x_ms_delete_snapshots: Optional, used to delete snapshots under volume. Allowed value + are only true or false. Default value is false. Known values are: "true" and "false". Default + value is None. + :type x_ms_delete_snapshots: str or ~azure.mgmt.elasticsan.models.XMsDeleteSnapshots + :param x_ms_force_delete: Optional, used to delete volume if active sessions present. Allowed + value are only true or false. Default value is false. Known values are: "true" and "false". + Default value is None. + :type x_ms_force_delete: str or ~azure.mgmt.elasticsan.models.XMsForceDelete :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 @@ -929,6 +960,8 @@ def begin_delete( elastic_san_name=elastic_san_name, volume_group_name=volume_group_name, volume_name=volume_name, + x_ms_delete_snapshots=x_ms_delete_snapshots, + x_ms_force_delete=x_ms_force_delete, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_maximum_set_gen.py index c9d97faac79a..c82eeedbd37e 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_maximum_set_gen.py @@ -33,11 +33,12 @@ def main(): resource_group_name="resourcegroupname", elastic_san_name="elasticsanname", parameters={ - "location": "South Central US", + "location": "France Central", "properties": { "availabilityZones": ["1"], "baseSizeTiB": 5, "extendedCapacitySizeTiB": 25, + "publicNetworkAccess": "Enabled", "sku": {"name": "Premium_LRS", "tier": "Premium"}, }, "tags": {"key9316": "ihndtieqibtob"}, @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_minimum_set_gen.py index 94a29b382b4e..871ac1b310a5 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_create_minimum_set_gen.py @@ -33,13 +33,13 @@ def main(): resource_group_name="resourcegroupname", elastic_san_name="elasticsanname", parameters={ - "location": "South Central US", - "properties": {"baseSizeTiB": 5, "extendedCapacitySizeTiB": 25, "sku": {"name": "Premium_LRS"}}, + "location": "France Central", + "properties": {"baseSizeTiB": 15, "extendedCapacitySizeTiB": 27, "sku": {"name": "Premium_LRS"}}, }, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_maximum_set_gen.py index 1bf3109efb5a..ca40686e1482 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_minimum_set_gen.py index 686f2c7ecc62..1a3aa1e20535 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_delete_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_maximum_set_gen.py index aded7ddd9e2e..33d5b3601ffa 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_minimum_set_gen.py index 2656cd09b4b9..ec9d4d13f923 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_get_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_maximum_set_gen.py index 2403d6ecca98..300402c869ad 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_minimum_set_gen.py index 2325e0669ffc..5c2d9c99d441 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_resource_group_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_maximum_set_gen.py index 9f5f47086825..0b6cebee9bd2 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_maximum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_minimum_set_gen.py index afebe3b21a84..0f38f9c7580e 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_list_by_subscription_minimum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_update_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_update_maximum_set_gen.py index 18f39c65596a..7aa0697b3dee 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_update_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/elastic_sans_update_maximum_set_gen.py @@ -33,13 +33,13 @@ def main(): resource_group_name="resourcegroupname", elastic_san_name="elasticsanname", parameters={ - "properties": {"baseSizeTiB": 10, "extendedCapacitySizeTiB": 22}, - "tags": {"key4212": "cqvcnwfefljntgeio"}, + "properties": {"baseSizeTiB": 13, "extendedCapacitySizeTiB": 29, "publicNetworkAccess": "Enabled"}, + "tags": {"key1931": "yhjwkgmrrwrcoxblgwgzjqusch"}, }, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_maximum_set_gen.py index c6ba31251900..4ff25ef71abf 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_maximum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_minimum_set_gen.py index ee25df63b402..dd171e31ec43 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/operations_list_minimum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_maximum_set_gen.py index 2aa23fed7bce..c8dbbe8d8756 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_maximum_set_gen.py @@ -35,11 +35,11 @@ def main(): private_endpoint_connection_name="privateendpointconnectionname", parameters={ "properties": { - "groupIds": ["sytxzqlcoapcaywthgwvwcw"], + "groupIds": ["jdwrzpemdjrpiwzvy"], "privateEndpoint": {}, "privateLinkServiceConnectionState": { - "actionsRequired": "None", - "description": "Auto-Approved", + "actionsRequired": "jhjdpwvyzipggtn", + "description": "dxl", "status": "Pending", }, } @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_minimum_set_gen.py index 2a7b550c94c3..42f1941ce22a 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_create_minimum_set_gen.py @@ -33,19 +33,11 @@ def main(): resource_group_name="resourcegroupname", elastic_san_name="elasticsanname", private_endpoint_connection_name="privateendpointconnectionname", - parameters={ - "properties": { - "privateLinkServiceConnectionState": { - "actionsRequired": "None", - "description": "Auto-Approved", - "status": "Pending", - } - } - }, + parameters={"properties": {"privateLinkServiceConnectionState": {}}}, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py index 298f5db0f2bb..27d41e6c54e8 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_minimum_set_gen.py index 7c7ac9a2f8ed..275767d0629f 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_delete_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_maximum_set_gen.py index 4d97e19238cc..e186b7e27e64 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_minimum_set_gen.py index 3e0b3b18f417..3dce6258a6ea 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_get_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_maximum_set_gen.py index 90483e50ced3..8b48ff24577b 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_minimum_set_gen.py index aa29b97d7dcc..c029e6d263e9 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_endpoint_connections_list_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_maximum_set_gen.py index 08d7fd3da38f..9289d3a5733e 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_minimum_set_gen.py index 3dc37ce6df9a..44dd080b2f30 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/private_link_resources_list_by_elastic_san_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_maximum_set_gen.py index 844af95fcda9..77a9cf9f0b58 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_maximum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_minimum_set_gen.py index 77f8480c29a1..386e2d607796 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/skus_list_minimum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_create_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_create_maximum_set_gen.py index be19358ef7e2..e5763f5edbd9 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_create_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_create_maximum_set_gen.py @@ -34,8 +34,17 @@ def main(): elastic_san_name="elasticsanname", volume_group_name="volumegroupname", parameters={ + "identity": {"type": "None", "userAssignedIdentities": {"key7482": {}}}, "properties": { - "encryption": "EncryptionAtRestWithPlatformKey", + "encryption": "EncryptionAtRestWithCustomerManagedKey", + "encryptionProperties": { + "identity": {"userAssignedIdentity": "im"}, + "keyVaultProperties": { + "keyName": "sftaiernmrzypnrkpakrrawxcbsqzc", + "keyVaultUri": "https://microsoft.com/axmblwp", + "keyVersion": "c", + }, + }, "networkAcls": { "virtualNetworkRules": [ { @@ -45,12 +54,12 @@ def main(): ] }, "protocolType": "Iscsi", - } + }, }, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_maximum_set_gen.py index e790a538934f..4242f602325e 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_minimum_set_gen.py index c28eb3cef3f0..738117e06f40 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_delete_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_maximum_set_gen.py index 651291634ae1..6f71dbf72588 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_minimum_set_gen.py index ea78a00efa98..be792a84af47 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_get_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_maximum_set_gen.py index 374ce0d3dfaa..f772ccef2c45 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_minimum_set_gen.py index 593918855a58..6c8ac293834f 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_list_by_elastic_san_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_update_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_update_maximum_set_gen.py index 756181038f5d..890d1952ed03 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_update_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_groups_update_maximum_set_gen.py @@ -34,8 +34,17 @@ def main(): elastic_san_name="elasticsanname", volume_group_name="volumegroupname", parameters={ + "identity": {"type": "None", "userAssignedIdentities": {"key7482": {}}}, "properties": { "encryption": "EncryptionAtRestWithPlatformKey", + "encryptionProperties": { + "identity": {"userAssignedIdentity": "im"}, + "keyVaultProperties": { + "keyName": "sftaiernmrzypnrkpakrrawxcbsqzc", + "keyVaultUri": "https://microsoft.com/axmblwp", + "keyVersion": "c", + }, + }, "networkAcls": { "virtualNetworkRules": [ { @@ -45,12 +54,12 @@ def main(): ] }, "protocolType": "Iscsi", - } + }, }, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_create_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_create_maximum_set_gen.py new file mode 100644 index 000000000000..a4063914fb0e --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_create_maximum_set_gen.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_create_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + response = client.volume_snapshots.begin_create( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + snapshot_name="snapshotname", + parameters={ + "properties": { + "creationData": { + "sourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_create_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_create_minimum_set_gen.py new file mode 100644 index 000000000000..4b5543a963ce --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_create_minimum_set_gen.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_create_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + response = client.volume_snapshots.begin_create( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + snapshot_name="snapshotname", + parameters={ + "properties": { + "creationData": { + "sourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_delete_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_delete_maximum_set_gen.py new file mode 100644 index 000000000000..205e2feaede7 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + client.volume_snapshots.begin_delete( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + snapshot_name="snapshotname", + ).result() + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_delete_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_delete_minimum_set_gen.py new file mode 100644 index 000000000000..80a18ee83b44 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_delete_minimum_set_gen.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_delete_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + client.volume_snapshots.begin_delete( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + snapshot_name="snapshotname", + ).result() + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_get_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_get_maximum_set_gen.py new file mode 100644 index 000000000000..6caf772f0ff5 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + response = client.volume_snapshots.get( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + snapshot_name="snapshotname", + ) + print(response) + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_get_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_get_minimum_set_gen.py new file mode 100644 index 000000000000..150ce46347bb --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_get_minimum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_get_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + response = client.volume_snapshots.get( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + snapshot_name="snapshotname", + ) + print(response) + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_list_by_volume_group_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_list_by_volume_group_maximum_set_gen.py new file mode 100644 index 000000000000..e4014efd11f4 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_list_by_volume_group_maximum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_list_by_volume_group_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + response = client.volume_snapshots.list_by_volume_group( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_list_by_volume_group_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_list_by_volume_group_minimum_set_gen.py new file mode 100644 index 000000000000..96abc463aac9 --- /dev/null +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volume_snapshots_list_by_volume_group_minimum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.elasticsan import ElasticSanMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elasticsan +# USAGE + python volume_snapshots_list_by_volume_group_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ElasticSanMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="subscriptionid", + ) + + response = client.volume_snapshots.list_by_volume_group( + resource_group_name="resourcegroupname", + elastic_san_name="elasticsanname", + volume_group_name="volumegroupname", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_maximum_set_gen.py index ac635661c01a..3aa5bf969a97 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_maximum_set_gen.py @@ -35,12 +35,16 @@ def main(): volume_group_name="volumegroupname", volume_name="volumename", parameters={ - "properties": {"creationData": {"createSource": "None", "sourceUri": " ARM Id of resource"}, "sizeGiB": 23} + "properties": { + "creationData": {"createSource": "None", "sourceId": "ARM Id of Resource"}, + "managedBy": {"resourceId": "mtkeip"}, + "sizeGiB": 9, + } }, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_minimum_set_gen.py index 4ed99144e095..c46304ec6991 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_create_minimum_set_gen.py @@ -34,11 +34,11 @@ def main(): elastic_san_name="elasticsanname", volume_group_name="volumegroupname", volume_name="volumename", - parameters={"properties": {"sizeGiB": 23}}, + parameters={"properties": {"sizeGiB": 9}}, ).result() print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_maximum_set_gen.py index c20340dd8f86..f24374dae334 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_minimum_set_gen.py index a353b777ed37..c7031464292e 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_delete_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_maximum_set_gen.py index 5b434995672c..4ecad17bfdcf 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_minimum_set_gen.py index f1fe3714267e..8ea341a3fb29 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_get_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_maximum_set_gen.py index 5ed60c9970d7..5aa804bbb093 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_minimum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_minimum_set_gen.py index ed2879551058..d9c194fcb167 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_minimum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_list_by_volume_group_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_update_maximum_set_gen.py b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_update_maximum_set_gen.py index cf637093f56b..eaeba94bd11d 100644 --- a/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_update_maximum_set_gen.py +++ b/sdk/elasticsan/azure-mgmt-elasticsan/generated_samples/volumes_update_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MaximumSet_Gen.json +# x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MaximumSet_Gen.json if __name__ == "__main__": main()