diff --git a/sdk/compute/azure-mgmt-avs/CHANGELOG.md b/sdk/compute/azure-mgmt-avs/CHANGELOG.md index 819ab99bb184..ae4c41384865 100644 --- a/sdk/compute/azure-mgmt-avs/CHANGELOG.md +++ b/sdk/compute/azure-mgmt-avs/CHANGELOG.md @@ -1,5 +1,50 @@ # Release History +## 9.1.0 (2025-05-12) + +### Features Added + + - Client `AVSClient` added operation group `skus` + - Client `AVSClient` added operation group `hosts` + - Client `AVSClient` added operation group `provisioned_networks` + - Client `AVSClient` added operation group `pure_storage_policies` + - Model `AddonHcxProperties` added property `management_network` + - Model `AddonHcxProperties` added property `uplink_network` + - Model `Datastore` added property `pure_storage_volume` + - Model `PrivateCloud` added property `zones` + - Added model `GeneralHostProperties` + - Added model `Host` + - Added enum `HostKind` + - Added model `HostListResult` + - Added enum `HostMaintenance` + - Added model `HostProperties` + - Added enum `HostProvisioningState` + - Added model `PagedResourceSku` + - Added model `ProvisionedNetwork` + - Added model `ProvisionedNetworkListResult` + - Added enum `ProvisionedNetworkProvisioningState` + - Added enum `ProvisionedNetworkTypes` + - Added model `PureStoragePolicy` + - Added model `PureStoragePolicyListResult` + - Added enum `PureStoragePolicyProvisioningState` + - Added model `PureStorageVolume` + - Added model `ResourceSku` + - Added model `ResourceSkuCapabilities` + - Added model `ResourceSkuLocationInfo` + - Added enum `ResourceSkuResourceType` + - Added model `ResourceSkuRestrictionInfo` + - Added model `ResourceSkuRestrictions` + - Added enum `ResourceSkuRestrictionsReasonCode` + - Added enum `ResourceSkuRestrictionsType` + - Added model `ResourceSkuZoneDetails` + - Added model `SpecializedHostProperties` + - Added model `HostsOperations` + - Added model `ProvisionedNetworksOperations` + - Added model `PureStoragePoliciesOperations` + - Added model `SkusOperations` + - Method `PureStoragePoliciesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, resource: PureStoragePolicy, content_type: str)` + - Method `PureStoragePoliciesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, resource: IO[bytes], content_type: str)` + ## 9.0.0 (2024-09-22) ### Features Added diff --git a/sdk/compute/azure-mgmt-avs/README.md b/sdk/compute/azure-mgmt-avs/README.md index 964cd257b281..4b89eb910cd4 100644 --- a/sdk/compute/azure-mgmt-avs/README.md +++ b/sdk/compute/azure-mgmt-avs/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Avs Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/compute/azure-mgmt-avs/_meta.json b/sdk/compute/azure-mgmt-avs/_meta.json index 2e03361f6a29..4744adfddcf0 100644 --- a/sdk/compute/azure-mgmt-avs/_meta.json +++ b/sdk/compute/azure-mgmt-avs/_meta.json @@ -1,11 +1,11 @@ { - "commit": "abb0052f400b0215d4fbbf479e5bbc54714199e0", + "commit": "4cb05484991756149f27956ffda2cec93ff10d4d", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.34.1", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/vmware/resource-manager/readme.md --generate-sample=True --generate-test=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.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/vmware/resource-manager/readme.md --generate-sample=True --generate-test=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.34.1 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/vmware/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py index f0a71cfec111..d70832c4694c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._avs_client import AVSClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._avs_client import AVSClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "AVSClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py index 20baf3de2ba1..e912bbdcc390 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models from ._configuration import AVSClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( AddonsOperations, AuthorizationsOperations, @@ -26,24 +28,27 @@ DatastoresOperations, GlobalReachConnectionsOperations, HcxEnterpriseSitesOperations, + HostsOperations, IscsiPathsOperations, LocationsOperations, Operations, PlacementPoliciesOperations, PrivateCloudsOperations, + ProvisionedNetworksOperations, + PureStoragePoliciesOperations, ScriptCmdletsOperations, ScriptExecutionsOperations, ScriptPackagesOperations, + SkusOperations, VirtualMachinesOperations, WorkloadNetworksOperations, ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class AVSClient: # pylint: disable=too-many-instance-attributes """Azure VMware Solution API. :ivar operations: Operations operations @@ -52,6 +57,8 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype locations: azure.mgmt.avs.operations.LocationsOperations :ivar private_clouds: PrivateCloudsOperations operations :vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.avs.operations.SkusOperations :ivar addons: AddonsOperations operations :vartype addons: azure.mgmt.avs.operations.AddonsOperations :ivar authorizations: AuthorizationsOperations operations @@ -62,6 +69,8 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype clusters: azure.mgmt.avs.operations.ClustersOperations :ivar datastores: DatastoresOperations operations :vartype datastores: azure.mgmt.avs.operations.DatastoresOperations + :ivar hosts: HostsOperations operations + :vartype hosts: azure.mgmt.avs.operations.HostsOperations :ivar placement_policies: PlacementPoliciesOperations operations :vartype placement_policies: azure.mgmt.avs.operations.PlacementPoliciesOperations :ivar virtual_machines: VirtualMachinesOperations operations @@ -72,6 +81,10 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations :ivar iscsi_paths: IscsiPathsOperations operations :vartype iscsi_paths: azure.mgmt.avs.operations.IscsiPathsOperations + :ivar provisioned_networks: ProvisionedNetworksOperations operations + :vartype provisioned_networks: azure.mgmt.avs.operations.ProvisionedNetworksOperations + :ivar pure_storage_policies: PureStoragePoliciesOperations operations + :vartype pure_storage_policies: azure.mgmt.avs.operations.PureStoragePoliciesOperations :ivar script_executions: ScriptExecutionsOperations operations :vartype script_executions: azure.mgmt.avs.operations.ScriptExecutionsOperations :ivar script_packages: ScriptPackagesOperations operations @@ -84,9 +97,9 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-09-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 @@ -94,13 +107,17 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: - self._config = AVSClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = AVSClientConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -119,7 +136,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -128,11 +145,13 @@ def __init__( self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_clouds = PrivateCloudsOperations(self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize) self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.hosts = HostsOperations(self._client, self._config, self._serialize, self._deserialize) self.placement_policies = PlacementPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -146,6 +165,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.iscsi_paths = IscsiPathsOperations(self._client, self._config, self._serialize, self._deserialize) + self.provisioned_networks = ProvisionedNetworksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.pure_storage_policies = PureStoragePoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.script_executions = ScriptExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py index 532223d9225b..4767b10aa909 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py @@ -14,7 +14,6 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -28,13 +27,13 @@ class AVSClientConfiguration: # pylint: disable=too-many-instance-attributes :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-09-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: - api_version: str = kwargs.pop("api_version", "2023-09-01") + api_version: str = kwargs.pop("api_version", "2024-09-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_utils/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_serialization.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_utils/serialization.py similarity index 83% rename from sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_serialization.py rename to sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_utils/serialization.py index 8139854b97bb..f5187701d7be 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_serialization.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -48,11 +30,8 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, - Mapping, ) try: @@ -62,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +70,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +93,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +136,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -179,80 +165,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +244,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +280,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,7 +304,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -380,12 +340,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,30 +358,31 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -426,9 +390,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +414,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +471,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +512,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -560,13 +532,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,12 +567,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -633,7 +610,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +642,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +681,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,11 +690,13 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -728,21 +708,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object 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, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +738,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +760,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,7 +784,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -821,11 +800,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +819,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +852,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +862,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - 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 + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +923,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +948,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +956,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +981,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1012,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1074,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1089,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1127,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1159,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1174,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1211,7 +1199,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1222,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1333,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1354,7 +1355,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,9 +1364,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1401,27 +1402,29 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1443,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1479,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1507,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1520,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1535,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1558,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1587,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1624,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1647,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1671,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1695,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,13 +1706,14 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1720,11 +1746,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,8 +1757,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1743,24 +1769,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1793,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1807,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1819,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1830,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,8 +1848,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1834,8 +1861,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1849,8 +1877,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,8 +1894,9 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1877,8 +1907,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1887,16 +1918,16 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1910,8 +1941,9 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1924,31 +1956,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1976,8 +2009,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,8 +2017,9 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1996,5 +2029,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py index b77ac9246082..f89ed38360ab 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "9.0.0" +VERSION = "9.1.0" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/__init__.py index 06785da19d54..f6384bd8ad78 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._avs_client import AVSClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._avs_client import AVSClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "AVSClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py index 0fbad17a0743..ab95775e503e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import AVSClientConfiguration from .operations import ( AddonsOperations, @@ -26,24 +28,27 @@ DatastoresOperations, GlobalReachConnectionsOperations, HcxEnterpriseSitesOperations, + HostsOperations, IscsiPathsOperations, LocationsOperations, Operations, PlacementPoliciesOperations, PrivateCloudsOperations, + ProvisionedNetworksOperations, + PureStoragePoliciesOperations, ScriptCmdletsOperations, ScriptExecutionsOperations, ScriptPackagesOperations, + SkusOperations, VirtualMachinesOperations, WorkloadNetworksOperations, ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class AVSClient: # pylint: disable=too-many-instance-attributes """Azure VMware Solution API. :ivar operations: Operations operations @@ -52,6 +57,8 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype locations: azure.mgmt.avs.aio.operations.LocationsOperations :ivar private_clouds: PrivateCloudsOperations operations :vartype private_clouds: azure.mgmt.avs.aio.operations.PrivateCloudsOperations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.avs.aio.operations.SkusOperations :ivar addons: AddonsOperations operations :vartype addons: azure.mgmt.avs.aio.operations.AddonsOperations :ivar authorizations: AuthorizationsOperations operations @@ -62,6 +69,8 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype clusters: azure.mgmt.avs.aio.operations.ClustersOperations :ivar datastores: DatastoresOperations operations :vartype datastores: azure.mgmt.avs.aio.operations.DatastoresOperations + :ivar hosts: HostsOperations operations + :vartype hosts: azure.mgmt.avs.aio.operations.HostsOperations :ivar placement_policies: PlacementPoliciesOperations operations :vartype placement_policies: azure.mgmt.avs.aio.operations.PlacementPoliciesOperations :ivar virtual_machines: VirtualMachinesOperations operations @@ -73,6 +82,10 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype hcx_enterprise_sites: azure.mgmt.avs.aio.operations.HcxEnterpriseSitesOperations :ivar iscsi_paths: IscsiPathsOperations operations :vartype iscsi_paths: azure.mgmt.avs.aio.operations.IscsiPathsOperations + :ivar provisioned_networks: ProvisionedNetworksOperations operations + :vartype provisioned_networks: azure.mgmt.avs.aio.operations.ProvisionedNetworksOperations + :ivar pure_storage_policies: PureStoragePoliciesOperations operations + :vartype pure_storage_policies: azure.mgmt.avs.aio.operations.PureStoragePoliciesOperations :ivar script_executions: ScriptExecutionsOperations operations :vartype script_executions: azure.mgmt.avs.aio.operations.ScriptExecutionsOperations :ivar script_packages: ScriptPackagesOperations operations @@ -85,9 +98,9 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-09-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 @@ -95,13 +108,17 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: - self._config = AVSClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = AVSClientConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -120,7 +137,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -129,11 +148,13 @@ def __init__( self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_clouds = PrivateCloudsOperations(self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize) self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.hosts = HostsOperations(self._client, self._config, self._serialize, self._deserialize) self.placement_policies = PlacementPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -147,6 +168,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.iscsi_paths = IscsiPathsOperations(self._client, self._config, self._serialize, self._deserialize) + self.provisioned_networks = ProvisionedNetworksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.pure_storage_policies = PureStoragePoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.script_executions = ScriptExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py index 6bf1c2ec3ebe..2eb5cd6cbe5f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py @@ -14,7 +14,6 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -28,13 +27,13 @@ class AVSClientConfiguration: # pylint: disable=too-many-instance-attributes :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-09-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: - api_version: str = kwargs.pop("api_version", "2023-09-01") + api_version: str = kwargs.pop("api_version", "2024-09-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py index e6a84c5d03a3..2c842b6b4c54 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py @@ -5,47 +5,61 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._locations_operations import LocationsOperations -from ._private_clouds_operations import PrivateCloudsOperations -from ._addons_operations import AddonsOperations -from ._authorizations_operations import AuthorizationsOperations -from ._cloud_links_operations import CloudLinksOperations -from ._clusters_operations import ClustersOperations -from ._datastores_operations import DatastoresOperations -from ._placement_policies_operations import PlacementPoliciesOperations -from ._virtual_machines_operations import VirtualMachinesOperations -from ._global_reach_connections_operations import GlobalReachConnectionsOperations -from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations -from ._iscsi_paths_operations import IscsiPathsOperations -from ._script_executions_operations import ScriptExecutionsOperations -from ._script_packages_operations import ScriptPackagesOperations -from ._script_cmdlets_operations import ScriptCmdletsOperations -from ._workload_networks_operations import WorkloadNetworksOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._locations_operations import LocationsOperations # type: ignore +from ._private_clouds_operations import PrivateCloudsOperations # type: ignore +from ._skus_operations import SkusOperations # type: ignore +from ._addons_operations import AddonsOperations # type: ignore +from ._authorizations_operations import AuthorizationsOperations # type: ignore +from ._cloud_links_operations import CloudLinksOperations # type: ignore +from ._clusters_operations import ClustersOperations # type: ignore +from ._datastores_operations import DatastoresOperations # type: ignore +from ._hosts_operations import HostsOperations # type: ignore +from ._placement_policies_operations import PlacementPoliciesOperations # type: ignore +from ._virtual_machines_operations import VirtualMachinesOperations # type: ignore +from ._global_reach_connections_operations import GlobalReachConnectionsOperations # type: ignore +from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations # type: ignore +from ._iscsi_paths_operations import IscsiPathsOperations # type: ignore +from ._provisioned_networks_operations import ProvisionedNetworksOperations # type: ignore +from ._pure_storage_policies_operations import PureStoragePoliciesOperations # type: ignore +from ._script_executions_operations import ScriptExecutionsOperations # type: ignore +from ._script_packages_operations import ScriptPackagesOperations # type: ignore +from ._script_cmdlets_operations import ScriptCmdletsOperations # type: ignore +from ._workload_networks_operations import WorkloadNetworksOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "Operations", "LocationsOperations", "PrivateCloudsOperations", + "SkusOperations", "AddonsOperations", "AuthorizationsOperations", "CloudLinksOperations", "ClustersOperations", "DatastoresOperations", + "HostsOperations", "PlacementPoliciesOperations", "VirtualMachinesOperations", "GlobalReachConnectionsOperations", "HcxEnterpriseSitesOperations", "IscsiPathsOperations", + "ProvisionedNetworksOperations", + "PureStoragePoliciesOperations", "ScriptExecutionsOperations", "ScriptPackagesOperations", "ScriptCmdletsOperations", "WorkloadNetworksOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py index f20541811014..1453e878d5f1 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._addons_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class AddonsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> AsyncIterable["_models.Addon"]: @@ -85,7 +83,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.Addon :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +215,7 @@ async def _create_or_update_initial( addon: Union[_models.Addon, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -420,7 +418,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, addon_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py index 60537eecf6bd..8b1e8a1dbe61 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._authorizations_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class AuthorizationsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -89,7 +87,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExpressRouteAuthorizationList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.ExpressRouteAuthorization :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +219,7 @@ async def _create_or_update_initial( authorization: Union[_models.ExpressRouteAuthorization, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +426,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, authorization_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py index 599f52e8e9aa..92e35a85e756 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._cloud_links_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class CloudLinksOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -87,7 +85,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudLinkList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +165,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.CloudLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +217,7 @@ async def _create_or_update_initial( cloud_link: Union[_models.CloudLink, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +424,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, cloud_link_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py index 50c7e2842f15..cd4677c31d87 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._clusters_operations import ( build_create_or_update_request, build_delete_request, @@ -40,11 +41,8 @@ build_list_zones_request, build_update_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,10 +61,10 @@ class ClustersOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -89,7 +87,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +219,7 @@ async def _create_or_update_initial( cluster: Union[_models.Cluster, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +431,7 @@ async def _update_initial( cluster_update: Union[_models.ClusterUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -519,7 +517,7 @@ async def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Required. + :param cluster_update: The resource properties to be updated. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -550,7 +548,7 @@ async def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Required. + :param cluster_update: The resource properties to be updated. Required. :type cluster_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -579,7 +577,7 @@ async def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Is either a ClusterUpdate type or + :param cluster_update: The resource properties to be updated. Is either a ClusterUpdate type or a IO[bytes] type. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns either Cluster or the result of @@ -640,7 +638,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +769,7 @@ async def list_zones( :rtype: ~azure.mgmt.avs.models.ClusterZoneList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py index 17728666a1d2..2aa67c00f9ac 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._datastores_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class DatastoresOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -89,7 +87,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatastoreList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +170,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.Datastore :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +224,7 @@ async def _create_or_update_initial( datastore: Union[_models.Datastore, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +442,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, datastore_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py index 6614188a38a0..ab829d92cb78 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._global_reach_connections_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class GlobalReachConnectionsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -88,7 +86,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalReachConnectionList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.GlobalReachConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +218,7 @@ async def _create_or_update_initial( global_reach_connection: Union[_models.GlobalReachConnection, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +425,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, global_reach_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py index 68300d31f32e..929d0f884d3f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,17 +28,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._hcx_enterprise_sites_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +55,10 @@ class HcxEnterpriseSitesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -83,7 +81,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HcxEnterpriseSiteList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.HcxEnterpriseSite :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +290,7 @@ async def create_or_update( :rtype: ~azure.mgmt.avs.models.HcxEnterpriseSite :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +347,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> None: """Delete a HcxEnterpriseSite. @@ -365,7 +363,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hosts_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hosts_operations.py new file mode 100644 index 000000000000..cde0b154c024 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hosts_operations.py @@ -0,0 +1,206 @@ +# 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 collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core import AsyncPipelineClient +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.rest import AsyncHttpResponse, 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 ... import models as _models +from ..._utils.serialization import Deserializer, Serializer +from ...operations._hosts_operations import build_get_request, build_list_request +from .._configuration import AVSClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class HostsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.aio.AVSClient`'s + :attr:`hosts` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Host"]: + """List Host resources by Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param cluster_name: Name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of either Host or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.Host] + :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.HostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("HostListResult", 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) + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_cloud_name: str, cluster_name: str, host_id: str, **kwargs: Any + ) -> _models.Host: + """Get a Host. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param cluster_name: Name of the cluster. Required. + :type cluster_name: str + :param host_id: The host identifier. Required. + :type host_id: str + :return: Host or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.Host + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.Host] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + host_id=host_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("Host", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py index 2e66d9cd8681..c3fe2139356b 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._iscsi_paths_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_private_cloud_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class IscsiPathsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_private_cloud( @@ -87,7 +85,7 @@ def list_by_private_cloud( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IscsiPathListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +161,7 @@ async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: :rtype: ~azure.mgmt.avs.models.IscsiPath :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +211,7 @@ async def _create_or_update_initial( resource: Union[_models.IscsiPath, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +407,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py index c96a62b6fa8b..20822b7c3b68 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,15 +25,13 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._locations_operations import ( build_check_quota_availability_request, build_check_trial_availability_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,10 +50,10 @@ class LocationsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quota: @@ -67,7 +65,7 @@ async def check_quota_availability(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.avs.models.Quota :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +158,7 @@ async def check_trial_availability( :rtype: ~azure.mgmt.avs.models.Trial :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py index 12711cf997a1..201577220d9e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class Operations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -69,7 +67,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py index d6480ad3b31e..9b8e4b3a66cf 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._placement_policies_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +60,10 @@ class PlacementPoliciesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -90,7 +88,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PlacementPoliciesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -178,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.PlacementPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +230,7 @@ async def _create_or_update_initial( placement_policy: Union[_models.PlacementPolicy, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +454,7 @@ async def _update_initial( placement_policy_update: Union[_models.PlacementPolicyUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +544,7 @@ async def begin_update( :type cluster_name: str :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties to be updated. Required. + :param placement_policy_update: The resource properties to be updated. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -580,7 +578,7 @@ async def begin_update( :type cluster_name: str :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties to be updated. Required. + :param placement_policy_update: The resource properties to be updated. Required. :type placement_policy_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -612,7 +610,7 @@ async def begin_update( :type cluster_name: str :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties to be updated. Is either a + :param placement_policy_update: The resource properties to be updated. Is either a PlacementPolicyUpdate type or a IO[bytes] type. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns either PlacementPolicy or the result of @@ -679,7 +677,7 @@ async def _delete_initial( placement_policy_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py index 7e82ea94c7a2..6590194a6d3d 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_clouds_operations import ( build_create_or_update_request, build_delete_request, @@ -43,11 +45,8 @@ build_rotate_vcenter_password_request, build_update_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,10 +65,10 @@ class PrivateCloudsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateCloud"]: @@ -85,7 +84,7 @@ def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateC api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +162,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +237,7 @@ async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: :rtype: ~azure.mgmt.avs.models.PrivateCloud :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +287,7 @@ async def _create_or_update_initial( private_cloud: Union[_models.PrivateCloud, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +487,7 @@ async def _update_initial( private_cloud_update: Union[_models.PrivateCloudUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +569,7 @@ async def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Required. + :param private_cloud_update: The resource properties to be updated. Required. :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -598,7 +597,7 @@ async def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Required. + :param private_cloud_update: The resource properties to be updated. Required. :type private_cloud_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -624,7 +623,7 @@ async def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Is either a + :param private_cloud_update: The resource properties to be updated. Is either a PrivateCloudUpdate type or a IO[bytes] type. Required. :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns either PrivateCloud or the result of @@ -684,7 +683,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -809,7 +808,7 @@ async def list_admin_credentials( :rtype: ~azure.mgmt.avs.models.AdminCredentials :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -855,7 +854,7 @@ async def list_admin_credentials( async def _rotate_nsxt_password_initial( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +967,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_vcenter_password_initial( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_provisioned_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_provisioned_networks_operations.py new file mode 100644 index 000000000000..d6184dc04114 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_provisioned_networks_operations.py @@ -0,0 +1,200 @@ +# 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 collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core import AsyncPipelineClient +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.rest import AsyncHttpResponse, 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 ... import models as _models +from ..._utils.serialization import Deserializer, Serializer +from ...operations._provisioned_networks_operations import build_get_request, build_list_request +from .._configuration import AVSClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ProvisionedNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.aio.AVSClient`'s + :attr:`provisioned_networks` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ProvisionedNetwork"]: + """List ProvisionedNetwork resources by PrivateCloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :return: An iterator like instance of either ProvisionedNetwork or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.ProvisionedNetwork] + :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.ProvisionedNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProvisionedNetworkListResult", 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) + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_cloud_name: str, provisioned_network_name: str, **kwargs: Any + ) -> _models.ProvisionedNetwork: + """Get a ProvisionedNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param provisioned_network_name: Name of the cloud link. Required. + :type provisioned_network_name: str + :return: ProvisionedNetwork or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.ProvisionedNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.ProvisionedNetwork] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + provisioned_network_name=provisioned_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("ProvisionedNetwork", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_pure_storage_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_pure_storage_policies_operations.py new file mode 100644 index 000000000000..ce04afb08974 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_pure_storage_policies_operations.py @@ -0,0 +1,542 @@ +# 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 collections.abc import MutableMapping +from io import IOBase +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, 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 ..._utils.serialization import Deserializer, Serializer +from ...operations._pure_storage_policies_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) +from .._configuration import AVSClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PureStoragePoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.aio.AVSClient`'s + :attr:`pure_storage_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PureStoragePolicy"]: + """List PureStoragePolicy resources by PrivateCloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :return: An iterator like instance of either PureStoragePolicy or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.PureStoragePolicy] + :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.PureStoragePolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PureStoragePolicyListResult", 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) + + @distributed_trace_async + async def get( + self, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, **kwargs: Any + ) -> _models.PureStoragePolicy: + """Get a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :return: PureStoragePolicy or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.PureStoragePolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.PureStoragePolicy] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("PureStoragePolicy", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: Union[_models.PureStoragePolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "PureStoragePolicy") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + 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 == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: _models.PureStoragePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PureStoragePolicy]: + """Create a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.avs.models.PureStoragePolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PureStoragePolicy or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.PureStoragePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PureStoragePolicy]: + """Create a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either PureStoragePolicy or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.PureStoragePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: Union[_models.PureStoragePolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PureStoragePolicy]: + """Create a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :param resource: Resource create parameters. Is either a PureStoragePolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.avs.models.PureStoragePolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns either PureStoragePolicy or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.PureStoragePolicy] + :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.PureStoragePolicy] = 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_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PureStoragePolicy", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PureStoragePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PureStoragePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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 [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + 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")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :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( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py index 1ff48f3a91a4..a801dc6bae12 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._script_cmdlets_operations import build_get_request, build_list_request +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -51,10 +49,10 @@ class ScriptCmdletsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -79,7 +77,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptCmdletsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +165,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.ScriptCmdlet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py index 640fbb10c03c..e1d01f38f87a 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,25 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import ( - Any, - AsyncIterable, - AsyncIterator, - Callable, - Dict, - IO, - List, - Optional, - Type, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -46,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._script_executions_operations import ( build_create_or_update_request, build_delete_request, @@ -53,11 +40,8 @@ build_get_request, build_list_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,10 +60,10 @@ class ScriptExecutionsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -102,7 +86,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptExecutionsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.ScriptExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -234,7 +218,7 @@ async def _create_or_update_initial( script_execution: Union[_models.ScriptExecution, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +425,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, private_cloud_name: str, script_execution_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +628,7 @@ async def get_execution_logs( :rtype: ~azure.mgmt.avs.models.ScriptExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py index 1d7e92320823..5e9c197b7126 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._script_packages_operations import build_get_request, build_list_request +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -51,10 +49,10 @@ class ScriptPackagesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -77,7 +75,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptPackagesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +155,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.ScriptPackage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_skus_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_skus_operations.py new file mode 100644 index 000000000000..589bf93a37db --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_skus_operations.py @@ -0,0 +1,129 @@ +# 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 collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core import AsyncPipelineClient +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.rest import AsyncHttpResponse, 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 ... import models as _models +from ..._utils.serialization import Deserializer, Serializer +from ...operations._skus_operations import build_list_request +from .._configuration import AVSClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.aio.AVSClient`'s + :attr:`skus` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: + """A list of SKUs. + + :return: An iterator like instance of either ResourceSku or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.ResourceSku] + :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.PagedResourceSku] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PagedResourceSku", 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) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py index 60d344cab81e..d6a497d41a7d 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,16 +32,14 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._virtual_machines_operations import ( build_get_request, build_list_request, build_restrict_movement_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +58,10 @@ class VirtualMachinesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -88,7 +86,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualMachinesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.avs.models.VirtualMachine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +228,7 @@ async def _restrict_movement_initial( restrict_movement: Union[_models.VirtualMachineRestrictMovement, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +317,7 @@ async def begin_restrict_movement( :type cluster_name: str :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: The body type of the operation request. Required. + :param restrict_movement: The content of the action request. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -352,7 +350,7 @@ async def begin_restrict_movement( :type cluster_name: str :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: The body type of the operation request. Required. + :param restrict_movement: The content of the action request. Required. :type restrict_movement: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -383,7 +381,7 @@ async def begin_restrict_movement( :type cluster_name: str :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: The body type of the operation request. Is either a + :param restrict_movement: The content of the action request. Is either a VirtualMachineRestrictMovement type or a IO[bytes] type. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py index a934319538d9..2e93943412e3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._workload_networks_operations import ( build_create_dhcp_request, build_create_dns_service_request, @@ -74,11 +76,8 @@ build_update_segments_request, build_update_vm_group_request, ) +from .._configuration import AVSClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,10 +96,10 @@ class WorkloadNetworksOperations: # pylint: disable=too-many-public-methods 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -123,7 +122,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -199,7 +198,7 @@ async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: :rtype: ~azure.mgmt.avs.models.WorkloadNetwork :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +262,7 @@ def list_dhcp( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDhcpList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +342,7 @@ async def get_dhcp( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -395,7 +394,7 @@ async def _create_dhcp_initial( workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -607,7 +606,7 @@ async def _update_dhcp_initial( workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +813,7 @@ def get_long_running_output(pipeline_response): async def _delete_dhcp_initial( self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,7 +950,7 @@ def list_dns_services( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsServicesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1031,7 +1030,7 @@ async def get_dns_service( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1083,7 +1082,7 @@ async def _create_dns_service_initial( workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1296,7 +1295,7 @@ async def _update_dns_service_initial( workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1504,7 +1503,7 @@ def get_long_running_output(pipeline_response): async def _delete_dns_service_initial( self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1640,7 +1639,7 @@ def list_dns_zones( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsZonesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1720,7 +1719,7 @@ async def get_dns_zone( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1772,7 +1771,7 @@ async def _create_dns_zone_initial( workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1984,7 +1983,7 @@ async def _update_dns_zone_initial( workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2191,7 +2190,7 @@ def get_long_running_output(pipeline_response): async def _delete_dns_zone_initial( self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2327,7 +2326,7 @@ def list_gateways( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkGatewayList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2407,7 +2406,7 @@ async def get_gateway( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2474,7 +2473,7 @@ def list_port_mirroring( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPortMirroringList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2554,7 +2553,7 @@ async def get_port_mirroring( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2606,7 +2605,7 @@ async def _create_port_mirroring_initial( workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2819,7 +2818,7 @@ async def _update_port_mirroring_initial( workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3027,7 +3026,7 @@ def get_long_running_output(pipeline_response): async def _delete_port_mirroring_initial( self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3163,7 +3162,7 @@ def list_public_ips( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPublicIPsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3243,7 +3242,7 @@ async def get_public_ip( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3295,7 +3294,7 @@ async def _create_public_ip_initial( workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3502,7 +3501,7 @@ def get_long_running_output(pipeline_response): async def _delete_public_ip_initial( self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3638,7 +3637,7 @@ def list_segments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkSegmentsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3718,7 +3717,7 @@ async def get_segment( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3770,7 +3769,7 @@ async def _create_segments_initial( workload_network_segment: Union[_models.WorkloadNetworkSegment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3982,7 +3981,7 @@ async def _update_segments_initial( workload_network_segment: Union[_models.WorkloadNetworkSegment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4189,7 +4188,7 @@ def get_long_running_output(pipeline_response): async def _delete_segment_initial( self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4326,7 +4325,7 @@ def list_virtual_machines( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVirtualMachinesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4406,7 +4405,7 @@ async def get_virtual_machine( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4472,7 +4471,7 @@ def list_vm_groups( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVMGroupsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4552,7 +4551,7 @@ async def get_vm_group( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4604,7 +4603,7 @@ async def _create_vm_group_initial( workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4816,7 +4815,7 @@ async def _update_vm_group_initial( workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5023,7 +5022,7 @@ def get_long_running_output(pipeline_response): async def _delete_vm_group_initial( self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py index 5edc6d7fee51..2fe0b515963e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py @@ -5,170 +5,207 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import Addon -from ._models_py3 import AddonArcProperties -from ._models_py3 import AddonHcxProperties -from ._models_py3 import AddonList -from ._models_py3 import AddonProperties -from ._models_py3 import AddonSrmProperties -from ._models_py3 import AddonVrProperties -from ._models_py3 import AdminCredentials -from ._models_py3 import AvailabilityProperties -from ._models_py3 import Circuit -from ._models_py3 import CloudLink -from ._models_py3 import CloudLinkList -from ._models_py3 import Cluster -from ._models_py3 import ClusterList -from ._models_py3 import ClusterUpdate -from ._models_py3 import ClusterZone -from ._models_py3 import ClusterZoneList -from ._models_py3 import Datastore -from ._models_py3 import DatastoreList -from ._models_py3 import DiskPoolVolume -from ._models_py3 import ElasticSanVolume -from ._models_py3 import Encryption -from ._models_py3 import EncryptionKeyVaultProperties -from ._models_py3 import Endpoints -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import ExpressRouteAuthorization -from ._models_py3 import ExpressRouteAuthorizationList -from ._models_py3 import GlobalReachConnection -from ._models_py3 import GlobalReachConnectionList -from ._models_py3 import HcxEnterpriseSite -from ._models_py3 import HcxEnterpriseSiteList -from ._models_py3 import IdentitySource -from ._models_py3 import IscsiPath -from ._models_py3 import IscsiPathListResult -from ._models_py3 import ManagementCluster -from ._models_py3 import NetAppVolume -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import PSCredentialExecutionParameter -from ._models_py3 import PlacementPoliciesList -from ._models_py3 import PlacementPolicy -from ._models_py3 import PlacementPolicyProperties -from ._models_py3 import PlacementPolicyUpdate -from ._models_py3 import PrivateCloud -from ._models_py3 import PrivateCloudIdentity -from ._models_py3 import PrivateCloudList -from ._models_py3 import PrivateCloudUpdate -from ._models_py3 import ProxyResource -from ._models_py3 import Quota -from ._models_py3 import Resource -from ._models_py3 import ScriptCmdlet -from ._models_py3 import ScriptCmdletsList -from ._models_py3 import ScriptExecution -from ._models_py3 import ScriptExecutionParameter -from ._models_py3 import ScriptExecutionsList -from ._models_py3 import ScriptPackage -from ._models_py3 import ScriptPackagesList -from ._models_py3 import ScriptParameter -from ._models_py3 import ScriptSecureStringExecutionParameter -from ._models_py3 import ScriptStringExecutionParameter -from ._models_py3 import Sku -from ._models_py3 import SystemData -from ._models_py3 import TrackedResource -from ._models_py3 import Trial -from ._models_py3 import VirtualMachine -from ._models_py3 import VirtualMachineRestrictMovement -from ._models_py3 import VirtualMachinesList -from ._models_py3 import VmHostPlacementPolicyProperties -from ._models_py3 import VmPlacementPolicyProperties -from ._models_py3 import WorkloadNetwork -from ._models_py3 import WorkloadNetworkDhcp -from ._models_py3 import WorkloadNetworkDhcpEntity -from ._models_py3 import WorkloadNetworkDhcpList -from ._models_py3 import WorkloadNetworkDhcpRelay -from ._models_py3 import WorkloadNetworkDhcpServer -from ._models_py3 import WorkloadNetworkDnsService -from ._models_py3 import WorkloadNetworkDnsServicesList -from ._models_py3 import WorkloadNetworkDnsZone -from ._models_py3 import WorkloadNetworkDnsZonesList -from ._models_py3 import WorkloadNetworkGateway -from ._models_py3 import WorkloadNetworkGatewayList -from ._models_py3 import WorkloadNetworkList -from ._models_py3 import WorkloadNetworkPortMirroring -from ._models_py3 import WorkloadNetworkPortMirroringList -from ._models_py3 import WorkloadNetworkPublicIP -from ._models_py3 import WorkloadNetworkPublicIPsList -from ._models_py3 import WorkloadNetworkSegment -from ._models_py3 import WorkloadNetworkSegmentPortVif -from ._models_py3 import WorkloadNetworkSegmentSubnet -from ._models_py3 import WorkloadNetworkSegmentsList -from ._models_py3 import WorkloadNetworkVMGroup -from ._models_py3 import WorkloadNetworkVMGroupsList -from ._models_py3 import WorkloadNetworkVirtualMachine -from ._models_py3 import WorkloadNetworkVirtualMachinesList +from typing import TYPE_CHECKING -from ._avs_client_enums import ActionType -from ._avs_client_enums import AddonProvisioningState -from ._avs_client_enums import AddonType -from ._avs_client_enums import AffinityStrength -from ._avs_client_enums import AffinityType -from ._avs_client_enums import AvailabilityStrategy -from ._avs_client_enums import AzureHybridBenefitType -from ._avs_client_enums import CloudLinkProvisioningState -from ._avs_client_enums import CloudLinkStatus -from ._avs_client_enums import ClusterProvisioningState -from ._avs_client_enums import CreatedByType -from ._avs_client_enums import DatastoreProvisioningState -from ._avs_client_enums import DatastoreStatus -from ._avs_client_enums import DhcpTypeEnum -from ._avs_client_enums import DnsServiceLogLevelEnum -from ._avs_client_enums import DnsServiceStatusEnum -from ._avs_client_enums import DnsZoneType -from ._avs_client_enums import EncryptionKeyStatus -from ._avs_client_enums import EncryptionState -from ._avs_client_enums import EncryptionVersionType -from ._avs_client_enums import ExpressRouteAuthorizationProvisioningState -from ._avs_client_enums import GlobalReachConnectionProvisioningState -from ._avs_client_enums import GlobalReachConnectionStatus -from ._avs_client_enums import HcxEnterpriseSiteProvisioningState -from ._avs_client_enums import HcxEnterpriseSiteStatus -from ._avs_client_enums import InternetEnum -from ._avs_client_enums import IscsiPathProvisioningState -from ._avs_client_enums import MountOptionEnum -from ._avs_client_enums import NsxPublicIpQuotaRaisedEnum -from ._avs_client_enums import OptionalParamEnum -from ._avs_client_enums import Origin -from ._avs_client_enums import PlacementPolicyProvisioningState -from ._avs_client_enums import PlacementPolicyState -from ._avs_client_enums import PlacementPolicyType -from ._avs_client_enums import PortMirroringDirectionEnum -from ._avs_client_enums import PortMirroringStatusEnum -from ._avs_client_enums import PrivateCloudProvisioningState -from ._avs_client_enums import QuotaEnabled -from ._avs_client_enums import ResourceIdentityType -from ._avs_client_enums import ScriptCmdletAudience -from ._avs_client_enums import ScriptCmdletProvisioningState -from ._avs_client_enums import ScriptExecutionParameterType -from ._avs_client_enums import ScriptExecutionProvisioningState -from ._avs_client_enums import ScriptOutputStreamType -from ._avs_client_enums import ScriptPackageProvisioningState -from ._avs_client_enums import ScriptParameterTypes -from ._avs_client_enums import SegmentStatusEnum -from ._avs_client_enums import SkuTier -from ._avs_client_enums import SslEnum -from ._avs_client_enums import TrialStatus -from ._avs_client_enums import VMGroupStatusEnum -from ._avs_client_enums import VMTypeEnum -from ._avs_client_enums import VirtualMachineProvisioningState -from ._avs_client_enums import VirtualMachineRestrictMovementState -from ._avs_client_enums import VisibilityParameterEnum -from ._avs_client_enums import WorkloadNetworkDhcpProvisioningState -from ._avs_client_enums import WorkloadNetworkDnsServiceProvisioningState -from ._avs_client_enums import WorkloadNetworkDnsZoneProvisioningState -from ._avs_client_enums import WorkloadNetworkPortMirroringProvisioningState -from ._avs_client_enums import WorkloadNetworkProvisioningState -from ._avs_client_enums import WorkloadNetworkPublicIPProvisioningState -from ._avs_client_enums import WorkloadNetworkSegmentProvisioningState -from ._avs_client_enums import WorkloadNetworkVMGroupProvisioningState +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + Addon, + AddonArcProperties, + AddonHcxProperties, + AddonList, + AddonProperties, + AddonSrmProperties, + AddonVrProperties, + AdminCredentials, + AvailabilityProperties, + Circuit, + CloudLink, + CloudLinkList, + Cluster, + ClusterList, + ClusterUpdate, + ClusterZone, + ClusterZoneList, + Datastore, + DatastoreList, + DiskPoolVolume, + ElasticSanVolume, + Encryption, + EncryptionKeyVaultProperties, + Endpoints, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExpressRouteAuthorization, + ExpressRouteAuthorizationList, + GeneralHostProperties, + GlobalReachConnection, + GlobalReachConnectionList, + HcxEnterpriseSite, + HcxEnterpriseSiteList, + Host, + HostListResult, + HostProperties, + IdentitySource, + IscsiPath, + IscsiPathListResult, + ManagementCluster, + NetAppVolume, + Operation, + OperationDisplay, + OperationListResult, + PSCredentialExecutionParameter, + PagedResourceSku, + PlacementPoliciesList, + PlacementPolicy, + PlacementPolicyProperties, + PlacementPolicyUpdate, + PrivateCloud, + PrivateCloudIdentity, + PrivateCloudList, + PrivateCloudUpdate, + ProvisionedNetwork, + ProvisionedNetworkListResult, + ProxyResource, + PureStoragePolicy, + PureStoragePolicyListResult, + PureStorageVolume, + Quota, + Resource, + ResourceSku, + ResourceSkuCapabilities, + ResourceSkuLocationInfo, + ResourceSkuRestrictionInfo, + ResourceSkuRestrictions, + ResourceSkuZoneDetails, + ScriptCmdlet, + ScriptCmdletsList, + ScriptExecution, + ScriptExecutionParameter, + ScriptExecutionsList, + ScriptPackage, + ScriptPackagesList, + ScriptParameter, + ScriptSecureStringExecutionParameter, + ScriptStringExecutionParameter, + Sku, + SpecializedHostProperties, + SystemData, + TrackedResource, + Trial, + VirtualMachine, + VirtualMachineRestrictMovement, + VirtualMachinesList, + VmHostPlacementPolicyProperties, + VmPlacementPolicyProperties, + WorkloadNetwork, + WorkloadNetworkDhcp, + WorkloadNetworkDhcpEntity, + WorkloadNetworkDhcpList, + WorkloadNetworkDhcpRelay, + WorkloadNetworkDhcpServer, + WorkloadNetworkDnsService, + WorkloadNetworkDnsServicesList, + WorkloadNetworkDnsZone, + WorkloadNetworkDnsZonesList, + WorkloadNetworkGateway, + WorkloadNetworkGatewayList, + WorkloadNetworkList, + WorkloadNetworkPortMirroring, + WorkloadNetworkPortMirroringList, + WorkloadNetworkPublicIP, + WorkloadNetworkPublicIPsList, + WorkloadNetworkSegment, + WorkloadNetworkSegmentPortVif, + WorkloadNetworkSegmentSubnet, + WorkloadNetworkSegmentsList, + WorkloadNetworkVMGroup, + WorkloadNetworkVMGroupsList, + WorkloadNetworkVirtualMachine, + WorkloadNetworkVirtualMachinesList, +) + +from ._avs_client_enums import ( # type: ignore + ActionType, + AddonProvisioningState, + AddonType, + AffinityStrength, + AffinityType, + AvailabilityStrategy, + AzureHybridBenefitType, + CloudLinkProvisioningState, + CloudLinkStatus, + ClusterProvisioningState, + CreatedByType, + DatastoreProvisioningState, + DatastoreStatus, + DhcpTypeEnum, + DnsServiceLogLevelEnum, + DnsServiceStatusEnum, + DnsZoneType, + EncryptionKeyStatus, + EncryptionState, + EncryptionVersionType, + ExpressRouteAuthorizationProvisioningState, + GlobalReachConnectionProvisioningState, + GlobalReachConnectionStatus, + HcxEnterpriseSiteProvisioningState, + HcxEnterpriseSiteStatus, + HostKind, + HostMaintenance, + HostProvisioningState, + InternetEnum, + IscsiPathProvisioningState, + MountOptionEnum, + NsxPublicIpQuotaRaisedEnum, + OptionalParamEnum, + Origin, + PlacementPolicyProvisioningState, + PlacementPolicyState, + PlacementPolicyType, + PortMirroringDirectionEnum, + PortMirroringStatusEnum, + PrivateCloudProvisioningState, + ProvisionedNetworkProvisioningState, + ProvisionedNetworkTypes, + PureStoragePolicyProvisioningState, + QuotaEnabled, + ResourceIdentityType, + ResourceSkuResourceType, + ResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsType, + ScriptCmdletAudience, + ScriptCmdletProvisioningState, + ScriptExecutionParameterType, + ScriptExecutionProvisioningState, + ScriptOutputStreamType, + ScriptPackageProvisioningState, + ScriptParameterTypes, + SegmentStatusEnum, + SkuTier, + SslEnum, + TrialStatus, + VMGroupStatusEnum, + VMTypeEnum, + VirtualMachineProvisioningState, + VirtualMachineRestrictMovementState, + VisibilityParameterEnum, + WorkloadNetworkDhcpProvisioningState, + WorkloadNetworkDnsServiceProvisioningState, + WorkloadNetworkDnsZoneProvisioningState, + WorkloadNetworkPortMirroringProvisioningState, + WorkloadNetworkProvisioningState, + WorkloadNetworkPublicIPProvisioningState, + WorkloadNetworkSegmentProvisioningState, + WorkloadNetworkVMGroupProvisioningState, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -201,10 +238,14 @@ "ErrorResponse", "ExpressRouteAuthorization", "ExpressRouteAuthorizationList", + "GeneralHostProperties", "GlobalReachConnection", "GlobalReachConnectionList", "HcxEnterpriseSite", "HcxEnterpriseSiteList", + "Host", + "HostListResult", + "HostProperties", "IdentitySource", "IscsiPath", "IscsiPathListResult", @@ -214,6 +255,7 @@ "OperationDisplay", "OperationListResult", "PSCredentialExecutionParameter", + "PagedResourceSku", "PlacementPoliciesList", "PlacementPolicy", "PlacementPolicyProperties", @@ -222,9 +264,20 @@ "PrivateCloudIdentity", "PrivateCloudList", "PrivateCloudUpdate", + "ProvisionedNetwork", + "ProvisionedNetworkListResult", "ProxyResource", + "PureStoragePolicy", + "PureStoragePolicyListResult", + "PureStorageVolume", "Quota", "Resource", + "ResourceSku", + "ResourceSkuCapabilities", + "ResourceSkuLocationInfo", + "ResourceSkuRestrictionInfo", + "ResourceSkuRestrictions", + "ResourceSkuZoneDetails", "ScriptCmdlet", "ScriptCmdletsList", "ScriptExecution", @@ -236,6 +289,7 @@ "ScriptSecureStringExecutionParameter", "ScriptStringExecutionParameter", "Sku", + "SpecializedHostProperties", "SystemData", "TrackedResource", "Trial", @@ -294,6 +348,9 @@ "GlobalReachConnectionStatus", "HcxEnterpriseSiteProvisioningState", "HcxEnterpriseSiteStatus", + "HostKind", + "HostMaintenance", + "HostProvisioningState", "InternetEnum", "IscsiPathProvisioningState", "MountOptionEnum", @@ -306,8 +363,14 @@ "PortMirroringDirectionEnum", "PortMirroringStatusEnum", "PrivateCloudProvisioningState", + "ProvisionedNetworkProvisioningState", + "ProvisionedNetworkTypes", + "PureStoragePolicyProvisioningState", "QuotaEnabled", "ResourceIdentityType", + "ResourceSkuResourceType", + "ResourceSkuRestrictionsReasonCode", + "ResourceSkuRestrictionsType", "ScriptCmdletAudience", "ScriptCmdletProvisioningState", "ScriptExecutionParameterType", @@ -333,5 +396,5 @@ "WorkloadNetworkSegmentProvisioningState", "WorkloadNetworkVMGroupProvisioningState", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py index 5eb924a3fd65..91e04980f777 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py @@ -300,6 +300,33 @@ class HcxEnterpriseSiteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """is deleted""" +class HostKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of host.""" + + GENERAL = "General" + SPECIALIZED = "Specialized" + + +class HostMaintenance(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The reason for host maintenance.""" + + REPLACEMENT = "Replacement" + """The host is a replacement host.""" + UPGRADE = "Upgrade" + """The host is for an upgrade, such as an upgrade to ESXi, NSX-T, or other component.""" + + +class HostProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """provisioning state of the host.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + + class InternetEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Whether internet is enabled or disabled.""" @@ -441,6 +468,51 @@ class PrivateCloudProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta """is updating""" +class ProvisionedNetworkProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """provisioned network provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + + +class ProvisionedNetworkTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of network provisioned.""" + + ESX_MANAGEMENT = "esxManagement" + """network for ESX management""" + ESX_REPLICATION = "esxReplication" + """network for ESX replication""" + HCX_MANAGEMENT = "hcxManagement" + """network for HCX management""" + HCX_UPLINK = "hcxUplink" + """network for HCX uplink""" + VCENTER_MANAGEMENT = "vcenterManagement" + """network for vCenter management""" + VMOTION = "vmotion" + """network for vmotion""" + VSAN = "vsan" + """network for vsan""" + + +class PureStoragePolicyProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Pure Storage Policy Based Management policy provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + DELETING = "Deleting" + """is deleting""" + UPDATING = "Updating" + """is updating""" + + class QuotaEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): """quota enabled.""" @@ -457,6 +529,33 @@ class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SYSTEM_ASSIGNED = "SystemAssigned" +class ResourceSkuResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes the type of resource the SKU applies to.""" + + PRIVATE_CLOUDS = "privateClouds" + """The SKU is for a private cloud.""" + PRIVATE_CLOUDS_CLUSTERS = "privateClouds/clusters" + """The SKU is for a private cloud cluster.""" + + +class ResourceSkuRestrictionsReasonCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes the reason for SKU restriction.""" + + QUOTA_ID = "QuotaId" + """The restriction is due to exceeding a quota limitation.""" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + """The restriction is not available for this subscription.""" + + +class ResourceSkuRestrictionsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes the kind of SKU restrictions that can exist.""" + + LOCATION = "Location" + """SKU restricted by location.""" + ZONE = "Zone" + """SKU restricted by availability zone.""" + + class ScriptCmdletAudience(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies whether a script cmdlet is intended to be invoked only through automation or visible to customers. diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py index 00f0ce6b919f..8cef3b69411f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py @@ -1,5 +1,5 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,21 +7,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping import datetime -import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from .. import _serialization - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +from .._utils import serialization as _serialization if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] class Resource(_serialization.Model): @@ -30,7 +24,7 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -59,10 +53,10 @@ class Resource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None class ProxyResource(Resource): @@ -72,7 +66,7 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -91,7 +85,7 @@ class Addon(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -169,7 +163,7 @@ def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.addon_type: Optional[str] = None - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.AddonProvisioningState"]] = None class AddonArcProperties(AddonProperties): @@ -223,6 +217,10 @@ class AddonHcxProperties(AddonProperties): :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState :ivar offer: The HCX offer, example VMware MaaS Cloud Provider (Enterprise). Required. :vartype offer: str + :ivar management_network: HCX management network. + :vartype management_network: str + :ivar uplink_network: HCX uplink network. + :vartype uplink_network: str """ _validation = { @@ -235,16 +233,31 @@ class AddonHcxProperties(AddonProperties): "addon_type": {"key": "addonType", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "offer": {"key": "offer", "type": "str"}, + "management_network": {"key": "managementNetwork", "type": "str"}, + "uplink_network": {"key": "uplinkNetwork", "type": "str"}, } - def __init__(self, *, offer: str, **kwargs: Any) -> None: + def __init__( + self, + *, + offer: str, + management_network: Optional[str] = None, + uplink_network: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword offer: The HCX offer, example VMware MaaS Cloud Provider (Enterprise). Required. :paramtype offer: str + :keyword management_network: HCX management network. + :paramtype management_network: str + :keyword uplink_network: HCX uplink network. + :paramtype uplink_network: str """ super().__init__(**kwargs) self.addon_type: str = "HCX" self.offer = offer + self.management_network = management_network + self.uplink_network = uplink_network class AddonList(_serialization.Model): @@ -386,10 +399,10 @@ class AdminCredentials(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.nsxt_username = None - self.nsxt_password = None - self.vcenter_username = None - self.vcenter_password = None + self.nsxt_username: Optional[str] = None + self.nsxt_password: Optional[str] = None + self.vcenter_username: Optional[str] = None + self.vcenter_password: Optional[str] = None class AvailabilityProperties(_serialization.Model): @@ -465,10 +478,10 @@ class Circuit(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.primary_subnet = None - self.secondary_subnet = None - self.express_route_id = None - self.express_route_private_peering_id = None + self.primary_subnet: Optional[str] = None + self.secondary_subnet: Optional[str] = None + self.express_route_id: Optional[str] = None + self.express_route_private_peering_id: Optional[str] = None class CloudLink(ProxyResource): @@ -477,7 +490,7 @@ class CloudLink(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -522,8 +535,8 @@ def __init__(self, *, linked_cloud: Optional[str] = None, **kwargs: Any) -> None :paramtype linked_cloud: str """ super().__init__(**kwargs) - self.provisioning_state = None - self.status = None + self.provisioning_state: Optional[Union[str, "_models.CloudLinkProvisioningState"]] = None + self.status: Optional[Union[str, "_models.CloudLinkStatus"]] = None self.linked_cloud = linked_cloud @@ -567,7 +580,7 @@ class Cluster(ProxyResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -637,8 +650,8 @@ def __init__( super().__init__(**kwargs) self.sku = sku self.cluster_size = cluster_size - self.provisioning_state = None - self.cluster_id = None + self.provisioning_state: Optional[Union[str, "_models.ClusterProvisioningState"]] = None + self.cluster_id: Optional[int] = None self.hosts = hosts self.vsan_datastore_name = vsan_datastore_name @@ -738,8 +751,8 @@ class ClusterZone(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.hosts = None - self.zone = None + self.hosts: Optional[List[str]] = None + self.zone: Optional[str] = None class ClusterZoneList(_serialization.Model): @@ -768,7 +781,7 @@ class Datastore(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -788,6 +801,8 @@ class Datastore(ProxyResource): :vartype disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume :ivar elastic_san_volume: An Elastic SAN volume. :vartype elastic_san_volume: ~azure.mgmt.avs.models.ElasticSanVolume + :ivar pure_storage_volume: A Pure Storage volume. + :vartype pure_storage_volume: ~azure.mgmt.avs.models.PureStorageVolume :ivar status: The operational status of the datastore. Known values are: "Unknown", "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", and "DeadOrError". :vartype status: str or ~azure.mgmt.avs.models.DatastoreStatus @@ -811,6 +826,7 @@ class Datastore(ProxyResource): "net_app_volume": {"key": "properties.netAppVolume", "type": "NetAppVolume"}, "disk_pool_volume": {"key": "properties.diskPoolVolume", "type": "DiskPoolVolume"}, "elastic_san_volume": {"key": "properties.elasticSanVolume", "type": "ElasticSanVolume"}, + "pure_storage_volume": {"key": "properties.pureStorageVolume", "type": "PureStorageVolume"}, "status": {"key": "properties.status", "type": "str"}, } @@ -820,6 +836,7 @@ def __init__( net_app_volume: Optional["_models.NetAppVolume"] = None, disk_pool_volume: Optional["_models.DiskPoolVolume"] = None, elastic_san_volume: Optional["_models.ElasticSanVolume"] = None, + pure_storage_volume: Optional["_models.PureStorageVolume"] = None, **kwargs: Any ) -> None: """ @@ -829,13 +846,16 @@ def __init__( :paramtype disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume :keyword elastic_san_volume: An Elastic SAN volume. :paramtype elastic_san_volume: ~azure.mgmt.avs.models.ElasticSanVolume + :keyword pure_storage_volume: A Pure Storage volume. + :paramtype pure_storage_volume: ~azure.mgmt.avs.models.PureStorageVolume """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.DatastoreProvisioningState"]] = None self.net_app_volume = net_app_volume self.disk_pool_volume = disk_pool_volume self.elastic_san_volume = elastic_san_volume - self.status = None + self.pure_storage_volume = pure_storage_volume + self.status: Optional[Union[str, "_models.DatastoreStatus"]] = None class DatastoreList(_serialization.Model): @@ -922,7 +942,7 @@ def __init__( self.target_id = target_id self.lun_name = lun_name self.mount_option = mount_option - self.path = None + self.path: Optional[str] = None class ElasticSanVolume(_serialization.Model): @@ -1040,10 +1060,10 @@ def __init__( super().__init__(**kwargs) self.key_name = key_name self.key_version = key_version - self.auto_detected_key_version = None + self.auto_detected_key_version: Optional[str] = None self.key_vault_url = key_vault_url - self.key_state = None - self.version_type = None + self.key_state: Optional[Union[str, "_models.EncryptionKeyStatus"]] = None + self.version_type: Optional[Union[str, "_models.EncryptionVersionType"]] = None class Endpoints(_serialization.Model): @@ -1086,12 +1106,12 @@ class Endpoints(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.nsxt_manager = None - self.vcsa = None - self.hcx_cloud_manager = None - self.nsxt_manager_ip = None - self.vcenter_ip = None - self.hcx_cloud_manager_ip = None + self.nsxt_manager: Optional[str] = None + self.vcsa: Optional[str] = None + self.hcx_cloud_manager: Optional[str] = None + self.nsxt_manager_ip: Optional[str] = None + self.vcenter_ip: Optional[str] = None + self.hcx_cloud_manager_ip: Optional[str] = None class ErrorAdditionalInfo(_serialization.Model): @@ -1118,8 +1138,8 @@ class ErrorAdditionalInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.info = None + self.type: Optional[str] = None + self.info: Optional[JSON] = None class ErrorDetail(_serialization.Model): @@ -1158,11 +1178,11 @@ class ErrorDetail(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None + self.details: Optional[List["_models.ErrorDetail"]] = None + self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None class ErrorResponse(_serialization.Model): @@ -1192,7 +1212,7 @@ class ExpressRouteAuthorization(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1241,9 +1261,9 @@ def __init__(self, *, express_route_id: Optional[str] = None, **kwargs: Any) -> :paramtype express_route_id: str """ super().__init__(**kwargs) - self.provisioning_state = None - self.express_route_authorization_id = None - self.express_route_authorization_key = None + self.provisioning_state: Optional[Union[str, "_models.ExpressRouteAuthorizationProvisioningState"]] = None + self.express_route_authorization_id: Optional[str] = None + self.express_route_authorization_key: Optional[str] = None self.express_route_id = express_route_id @@ -1281,13 +1301,146 @@ def __init__( self.next_link = next_link +class HostProperties(_serialization.Model): + """The properties of a host. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + GeneralHostProperties, SpecializedHostProperties + + 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 server. + + :ivar kind: The kind of host. Required. Known values are: "General" and "Specialized". + :vartype kind: str or ~azure.mgmt.avs.models.HostKind + :ivar provisioning_state: The state of the host provisioning. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.HostProvisioningState + :ivar display_name: Display name of the host in VMware vCenter. + :vartype display_name: str + :ivar mo_ref_id: vCenter managed object reference ID of the host. + :vartype mo_ref_id: str + :ivar fqdn: Fully qualified domain name of the host. + :vartype fqdn: str + :ivar maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :vartype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + :ivar fault_domain: + :vartype fault_domain: str + """ + + _validation = { + "kind": {"required": True}, + "provisioning_state": {"readonly": True}, + "mo_ref_id": {"readonly": True}, + "fqdn": {"readonly": True, "max_length": 255, "min_length": 1}, + "fault_domain": {"readonly": True}, + } + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "mo_ref_id": {"key": "moRefId", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "maintenance": {"key": "maintenance", "type": "str"}, + "fault_domain": {"key": "faultDomain", "type": "str"}, + } + + _subtype_map = {"kind": {"General": "GeneralHostProperties", "Specialized": "SpecializedHostProperties"}} + + def __init__( + self, + *, + display_name: Optional[str] = None, + maintenance: Optional[Union[str, "_models.HostMaintenance"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the host in VMware vCenter. + :paramtype display_name: str + :keyword maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :paramtype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + """ + super().__init__(**kwargs) + self.kind: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.HostProvisioningState"]] = None + self.display_name = display_name + self.mo_ref_id: Optional[str] = None + self.fqdn: Optional[str] = None + self.maintenance = maintenance + self.fault_domain: Optional[str] = None + + +class GeneralHostProperties(HostProperties): + """The properties of a general host. + + 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 server. + + :ivar kind: The kind of host. Required. Known values are: "General" and "Specialized". + :vartype kind: str or ~azure.mgmt.avs.models.HostKind + :ivar provisioning_state: The state of the host provisioning. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.HostProvisioningState + :ivar display_name: Display name of the host in VMware vCenter. + :vartype display_name: str + :ivar mo_ref_id: vCenter managed object reference ID of the host. + :vartype mo_ref_id: str + :ivar fqdn: Fully qualified domain name of the host. + :vartype fqdn: str + :ivar maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :vartype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + :ivar fault_domain: + :vartype fault_domain: str + """ + + _validation = { + "kind": {"required": True}, + "provisioning_state": {"readonly": True}, + "mo_ref_id": {"readonly": True}, + "fqdn": {"readonly": True, "max_length": 255, "min_length": 1}, + "fault_domain": {"readonly": True}, + } + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "mo_ref_id": {"key": "moRefId", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "maintenance": {"key": "maintenance", "type": "str"}, + "fault_domain": {"key": "faultDomain", "type": "str"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + maintenance: Optional[Union[str, "_models.HostMaintenance"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the host in VMware vCenter. + :paramtype display_name: str + :keyword maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :paramtype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + """ + super().__init__(display_name=display_name, maintenance=maintenance, **kwargs) + self.kind: str = "General" + + class GlobalReachConnection(ProxyResource): """A global reach connection resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1368,10 +1521,10 @@ def __init__( :paramtype express_route_id: str """ super().__init__(**kwargs) - self.provisioning_state = None - self.address_prefix = None + self.provisioning_state: Optional[Union[str, "_models.GlobalReachConnectionProvisioningState"]] = None + self.address_prefix: Optional[str] = None self.authorization_key = authorization_key - self.circuit_connection_status = None + self.circuit_connection_status: Optional[Union[str, "_models.GlobalReachConnectionStatus"]] = None self.peer_express_route_circuit = peer_express_route_circuit self.express_route_id = express_route_id @@ -1416,7 +1569,7 @@ class HcxEnterpriseSite(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1459,9 +1612,9 @@ class HcxEnterpriseSite(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.activation_key = None - self.status = None + self.provisioning_state: Optional[Union[str, "_models.HcxEnterpriseSiteProvisioningState"]] = None + self.activation_key: Optional[str] = None + self.status: Optional[Union[str, "_models.HcxEnterpriseSiteStatus"]] = None class HcxEnterpriseSiteList(_serialization.Model): @@ -1498,6 +1651,135 @@ def __init__( self.next_link = next_link +class Host(ProxyResource): + """A host resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.avs.models.SystemData + :ivar zones: The availability zones. + :vartype zones: list[str] + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: ~azure.mgmt.avs.models.Sku + :ivar kind: The kind of host. Known values are: "General" and "Specialized". + :vartype kind: str or ~azure.mgmt.avs.models.HostKind + :ivar provisioning_state: The state of the host provisioning. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.HostProvisioningState + :ivar display_name: Display name of the host in VMware vCenter. + :vartype display_name: str + :ivar mo_ref_id: vCenter managed object reference ID of the host. + :vartype mo_ref_id: str + :ivar fqdn: Fully qualified domain name of the host. + :vartype fqdn: str + :ivar maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :vartype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + :ivar fault_domain: + :vartype fault_domain: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "mo_ref_id": {"readonly": True}, + "fqdn": {"readonly": True, "max_length": 255, "min_length": 1}, + "fault_domain": {"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"}, + "zones": {"key": "zones", "type": "[str]"}, + "sku": {"key": "sku", "type": "Sku"}, + "kind": {"key": "properties.kind", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "display_name": {"key": "properties.displayName", "type": "str"}, + "mo_ref_id": {"key": "properties.moRefId", "type": "str"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "maintenance": {"key": "properties.maintenance", "type": "str"}, + "fault_domain": {"key": "properties.faultDomain", "type": "str"}, + } + + def __init__( + self, + *, + zones: Optional[List[str]] = None, + sku: Optional["_models.Sku"] = None, + display_name: Optional[str] = None, + maintenance: Optional[Union[str, "_models.HostMaintenance"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword zones: The availability zones. + :paramtype zones: list[str] + :keyword sku: The SKU (Stock Keeping Unit) assigned to this resource. + :paramtype sku: ~azure.mgmt.avs.models.Sku + :keyword display_name: Display name of the host in VMware vCenter. + :paramtype display_name: str + :keyword maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :paramtype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + """ + super().__init__(**kwargs) + self.zones = zones + self.sku = sku + self.kind: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.HostProvisioningState"]] = None + self.display_name = display_name + self.mo_ref_id: Optional[str] = None + self.fqdn: Optional[str] = None + self.maintenance = maintenance + self.fault_domain: Optional[str] = None + + +class HostListResult(_serialization.Model): + """The response of a Host list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The Host items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.Host] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Host]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.Host"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The Host items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.Host] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class IdentitySource(_serialization.Model): """vCenter Single Sign On Identity Source. @@ -1505,7 +1787,7 @@ class IdentitySource(_serialization.Model): :vartype name: str :ivar alias: The domain's NetBIOS name. :vartype alias: str - :ivar domain: The domain's dns name. + :ivar domain: The domain's DNS name. :vartype domain: str :ivar base_user_dn: The base distinguished name for users. :vartype base_user_dn: str @@ -1559,7 +1841,7 @@ def __init__( :paramtype name: str :keyword alias: The domain's NetBIOS name. :paramtype alias: str - :keyword domain: The domain's dns name. + :keyword domain: The domain's DNS name. :paramtype domain: str :keyword base_user_dn: The base distinguished name for users. :paramtype base_user_dn: str @@ -1600,7 +1882,7 @@ class IscsiPath(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1640,7 +1922,7 @@ def __init__(self, *, network_block: Optional[str] = None, **kwargs: Any) -> Non :paramtype network_block: str """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.IscsiPathProvisioningState"]] = None self.network_block = network_block @@ -1725,8 +2007,8 @@ def __init__( """ super().__init__(**kwargs) self.cluster_size = cluster_size - self.provisioning_state = None - self.cluster_id = None + self.provisioning_state: Optional[Union[str, "_models.ClusterProvisioningState"]] = None + self.cluster_id: Optional[int] = None self.hosts = hosts self.vsan_datastore_name = vsan_datastore_name @@ -1800,11 +2082,11 @@ def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kw :paramtype display: ~azure.mgmt.avs.models.OperationDisplay """ super().__init__(**kwargs) - self.name = None - self.is_data_action = None + self.name: Optional[str] = None + self.is_data_action: Optional[bool] = None self.display = display - self.origin = None - self.action_type = None + self.origin: Optional[Union[str, "_models.Origin"]] = None + self.action_type: Optional[Union[str, "_models.ActionType"]] = None class OperationDisplay(_serialization.Model): @@ -1843,10 +2125,10 @@ class OperationDisplay(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None + self.provider: Optional[str] = None + self.resource: Optional[str] = None + self.operation: Optional[str] = None + self.description: Optional[str] = None class OperationListResult(_serialization.Model): @@ -1874,8 +2156,40 @@ class OperationListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Operation"]] = None + self.next_link: Optional[str] = None + + +class PagedResourceSku(_serialization.Model): + """Paged collection of ResourceSku items. + + All required parameters must be populated in order to send to server. + + :ivar value: The ResourceSku items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.ResourceSku] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ResourceSku]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.ResourceSku"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The ResourceSku items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.ResourceSku] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link class PlacementPoliciesList(_serialization.Model): @@ -1918,7 +2232,7 @@ class PlacementPolicy(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2010,7 +2324,7 @@ def __init__( self.type: Optional[str] = None self.state = state self.display_name = display_name - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.PlacementPolicyProvisioningState"]] = None class PlacementPolicyUpdate(_serialization.Model): @@ -2081,7 +2395,7 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2126,7 +2440,7 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.location = location -class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attributes +class PrivateCloud(TrackedResource): """A private cloud resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2134,7 +2448,7 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2152,6 +2466,8 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib :vartype sku: ~azure.mgmt.avs.models.Sku :ivar identity: The managed service identities assigned to this resource. :vartype identity: ~azure.mgmt.avs.models.PrivateCloudIdentity + :ivar zones: The availability zones. + :vartype zones: list[str] :ivar management_cluster: The default cluster used for management. :vartype management_cluster: ~azure.mgmt.avs.models.ManagementCluster :ivar internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" @@ -2241,6 +2557,7 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib "location": {"key": "location", "type": "str"}, "sku": {"key": "sku", "type": "Sku"}, "identity": {"key": "identity", "type": "PrivateCloudIdentity"}, + "zones": {"key": "zones", "type": "[str]"}, "management_cluster": {"key": "properties.managementCluster", "type": "ManagementCluster"}, "internet": {"key": "properties.internet", "type": "str"}, "identity_sources": {"key": "properties.identitySources", "type": "[IdentitySource]"}, @@ -2272,6 +2589,7 @@ def __init__( # pylint: disable=too-many-locals sku: "_models.Sku", tags: Optional[Dict[str, str]] = None, identity: Optional["_models.PrivateCloudIdentity"] = None, + zones: Optional[List[str]] = None, management_cluster: Optional["_models.ManagementCluster"] = None, internet: Optional[Union[str, "_models.InternetEnum"]] = None, identity_sources: Optional[List["_models.IdentitySource"]] = None, @@ -2296,6 +2614,8 @@ def __init__( # pylint: disable=too-many-locals :paramtype sku: ~azure.mgmt.avs.models.Sku :keyword identity: The managed service identities assigned to this resource. :paramtype identity: ~azure.mgmt.avs.models.PrivateCloudIdentity + :keyword zones: The availability zones. + :paramtype zones: list[str] :keyword management_cluster: The default cluster used for management. :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster :keyword internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" @@ -2339,26 +2659,27 @@ def __init__( # pylint: disable=too-many-locals super().__init__(tags=tags, location=location, **kwargs) self.sku = sku self.identity = identity + self.zones = zones self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources self.availability = availability self.encryption = encryption self.extended_network_blocks = extended_network_blocks - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.PrivateCloudProvisioningState"]] = None self.circuit = circuit - self.endpoints = None + self.endpoints: Optional["_models.Endpoints"] = None self.network_block = network_block - self.management_network = None - self.provisioning_network = None - self.vmotion_network = None + self.management_network: Optional[str] = None + self.provisioning_network: Optional[str] = None + self.vmotion_network: Optional[str] = None self.vcenter_password = vcenter_password self.nsxt_password = nsxt_password - self.vcenter_certificate_thumbprint = None - self.nsxt_certificate_thumbprint = None - self.external_cloud_links = None + self.vcenter_certificate_thumbprint: Optional[str] = None + self.nsxt_certificate_thumbprint: Optional[str] = None + self.external_cloud_links: Optional[List[str]] = None self.secondary_circuit = secondary_circuit - self.nsx_public_ip_quota_raised = None + self.nsx_public_ip_quota_raised: Optional[Union[str, "_models.NsxPublicIpQuotaRaisedEnum"]] = None self.virtual_network_id = virtual_network_id self.dns_zone_type = dns_zone_type @@ -2400,8 +2721,8 @@ def __init__(self, *, type: Union[str, "_models.ResourceIdentityType"], **kwargs :paramtype type: str or ~azure.mgmt.avs.models.ResourceIdentityType """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type @@ -2537,6 +2858,94 @@ def __init__( self.dns_zone_type = dns_zone_type +class ProvisionedNetwork(ProxyResource): + """A provisioned network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ProvisionedNetworkProvisioningState + :ivar address_prefix: The address prefixes of the provisioned network in CIDR notation. + :vartype address_prefix: str + :ivar network_type: The type of network provisioned. Known values are: "esxManagement", + "esxReplication", "hcxManagement", "hcxUplink", "vcenterManagement", "vmotion", and "vsan". + :vartype network_type: str or ~azure.mgmt.avs.models.ProvisionedNetworkTypes + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "address_prefix": {"readonly": True}, + "network_type": {"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"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "network_type": {"key": "properties.networkType", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.ProvisionedNetworkProvisioningState"]] = None + self.address_prefix: Optional[str] = None + self.network_type: Optional[Union[str, "_models.ProvisionedNetworkTypes"]] = None + + +class ProvisionedNetworkListResult(_serialization.Model): + """The response of a ProvisionedNetwork list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The ProvisionedNetwork items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.ProvisionedNetwork] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ProvisionedNetwork]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.ProvisionedNetwork"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The ProvisionedNetwork items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.ProvisionedNetwork] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class ScriptExecutionParameter(_serialization.Model): """The arguments passed in to the execution. @@ -2626,6 +3035,135 @@ def __init__( self.password = password +class PureStoragePolicy(ProxyResource): + """An instance describing a Pure Storage Policy Based Management policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.avs.models.SystemData + :ivar storage_policy_definition: Definition of a Pure Storage Policy Based Management policy. + :vartype storage_policy_definition: str + :ivar storage_pool_id: Azure resource ID of the Pure Storage Pool associated with the storage + policy. + :vartype storage_pool_id: str + :ivar provisioning_state: The state of the Pure Storage Policy Based Management policy + provisioning. Known values are: "Succeeded", "Failed", "Canceled", "Deleting", and "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PureStoragePolicyProvisioningState + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"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"}, + "storage_policy_definition": {"key": "properties.storagePolicyDefinition", "type": "str"}, + "storage_pool_id": {"key": "properties.storagePoolId", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, *, storage_policy_definition: Optional[str] = None, storage_pool_id: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword storage_policy_definition: Definition of a Pure Storage Policy Based Management + policy. + :paramtype storage_policy_definition: str + :keyword storage_pool_id: Azure resource ID of the Pure Storage Pool associated with the + storage policy. + :paramtype storage_pool_id: str + """ + super().__init__(**kwargs) + self.storage_policy_definition = storage_policy_definition + self.storage_pool_id = storage_pool_id + self.provisioning_state: Optional[Union[str, "_models.PureStoragePolicyProvisioningState"]] = None + + +class PureStoragePolicyListResult(_serialization.Model): + """The response of a PureStoragePolicy list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The PureStoragePolicy items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.PureStoragePolicy] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[PureStoragePolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.PureStoragePolicy"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The PureStoragePolicy items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.PureStoragePolicy] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PureStorageVolume(_serialization.Model): + """A Pure Storage volume from PureStorage.Block provider. + + All required parameters must be populated in order to send to server. + + :ivar storage_pool_id: Azure resource ID of the Pure Storage Pool. Required. + :vartype storage_pool_id: str + :ivar size_gb: Volume size to be used to create a Virtual Volumes (vVols) datastore. Required. + :vartype size_gb: int + """ + + _validation = { + "storage_pool_id": {"required": True}, + "size_gb": {"required": True}, + } + + _attribute_map = { + "storage_pool_id": {"key": "storagePoolId", "type": "str"}, + "size_gb": {"key": "sizeGb", "type": "int"}, + } + + def __init__(self, *, storage_pool_id: str, size_gb: int, **kwargs: Any) -> None: + """ + :keyword storage_pool_id: Azure resource ID of the Pure Storage Pool. Required. + :paramtype storage_pool_id: str + :keyword size_gb: Volume size to be used to create a Virtual Volumes (vVols) datastore. + Required. + :paramtype size_gb: int + """ + super().__init__(**kwargs) + self.storage_pool_id = storage_pool_id + self.size_gb = size_gb + + class Quota(_serialization.Model): """Subscription quotas. @@ -2651,8 +3189,306 @@ class Quota(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.hosts_remaining = None - self.quota_enabled = None + self.hosts_remaining: Optional[Dict[str, int]] = None + self.quota_enabled: Optional[Union[str, "_models.QuotaEnabled"]] = None + + +class ResourceSku(_serialization.Model): + """A SKU for a resource. + + All required parameters must be populated in order to send to server. + + :ivar resource_type: The type of resource the SKU applies to. Required. Known values are: + "privateClouds" and "privateClouds/clusters". + :vartype resource_type: str or ~azure.mgmt.avs.models.ResourceSkuResourceType + :ivar name: The name of the SKU. Required. + :vartype name: str + :ivar tier: The tier of virtual machines in a scale set. + :vartype tier: str + :ivar size: The size of the SKU. + :vartype size: str + :ivar family: The family of the SKU. + :vartype family: str + :ivar locations: The set of locations that the SKU is available. Required. + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. Required. + :vartype location_info: list[~azure.mgmt.avs.models.ResourceSkuLocationInfo] + :ivar capabilities: Name value pairs to describe the capability. + :vartype capabilities: list[~azure.mgmt.avs.models.ResourceSkuCapabilities] + :ivar restrictions: The restrictions of the SKU. Required. + :vartype restrictions: list[~azure.mgmt.avs.models.ResourceSkuRestrictions] + """ + + _validation = { + "resource_type": {"required": True}, + "name": {"required": True}, + "locations": {"required": True}, + "location_info": {"required": True}, + "restrictions": {"required": True}, + } + + _attribute_map = { + "resource_type": {"key": "resourceType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "location_info": {"key": "locationInfo", "type": "[ResourceSkuLocationInfo]"}, + "capabilities": {"key": "capabilities", "type": "[ResourceSkuCapabilities]"}, + "restrictions": {"key": "restrictions", "type": "[ResourceSkuRestrictions]"}, + } + + def __init__( + self, + *, + resource_type: Union[str, "_models.ResourceSkuResourceType"], + name: str, + locations: List[str], + location_info: List["_models.ResourceSkuLocationInfo"], + restrictions: List["_models.ResourceSkuRestrictions"], + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capabilities: Optional[List["_models.ResourceSkuCapabilities"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_type: The type of resource the SKU applies to. Required. Known values are: + "privateClouds" and "privateClouds/clusters". + :paramtype resource_type: str or ~azure.mgmt.avs.models.ResourceSkuResourceType + :keyword name: The name of the SKU. Required. + :paramtype name: str + :keyword tier: The tier of virtual machines in a scale set. + :paramtype tier: str + :keyword size: The size of the SKU. + :paramtype size: str + :keyword family: The family of the SKU. + :paramtype family: str + :keyword locations: The set of locations that the SKU is available. Required. + :paramtype locations: list[str] + :keyword location_info: A list of locations and availability zones in those locations where the + SKU is available. Required. + :paramtype location_info: list[~azure.mgmt.avs.models.ResourceSkuLocationInfo] + :keyword capabilities: Name value pairs to describe the capability. + :paramtype capabilities: list[~azure.mgmt.avs.models.ResourceSkuCapabilities] + :keyword restrictions: The restrictions of the SKU. Required. + :paramtype restrictions: list[~azure.mgmt.avs.models.ResourceSkuRestrictions] + """ + super().__init__(**kwargs) + self.resource_type = resource_type + self.name = name + self.tier = tier + self.size = size + self.family = family + self.locations = locations + self.location_info = location_info + self.capabilities = capabilities + self.restrictions = restrictions + + +class ResourceSkuCapabilities(_serialization.Model): + """Describes The SKU capabilities object. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the SKU capability. Required. + :vartype name: str + :ivar value: The value of the SKU capability. Required. + :vartype value: str + """ + + _validation = { + "name": {"required": True}, + "value": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: str, value: str, **kwargs: Any) -> None: + """ + :keyword name: The name of the SKU capability. Required. + :paramtype name: str + :keyword value: The value of the SKU capability. Required. + :paramtype value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + + +class ResourceSkuLocationInfo(_serialization.Model): + """Describes an available Compute SKU Location Information. + + All required parameters must be populated in order to send to server. + + :ivar location: Location of the SKU. Required. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. Required. + :vartype zones: list[str] + :ivar zone_details: Gets details of capabilities available to a SKU in specific zones. + Required. + :vartype zone_details: list[~azure.mgmt.avs.models.ResourceSkuZoneDetails] + """ + + _validation = { + "location": {"required": True}, + "zones": {"required": True}, + "zone_details": {"required": True}, + } + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "zone_details": {"key": "zoneDetails", "type": "[ResourceSkuZoneDetails]"}, + } + + def __init__( + self, *, location: str, zones: List[str], zone_details: List["_models.ResourceSkuZoneDetails"], **kwargs: Any + ) -> None: + """ + :keyword location: Location of the SKU. Required. + :paramtype location: str + :keyword zones: List of availability zones where the SKU is supported. Required. + :paramtype zones: list[str] + :keyword zone_details: Gets details of capabilities available to a SKU in specific zones. + Required. + :paramtype zone_details: list[~azure.mgmt.avs.models.ResourceSkuZoneDetails] + """ + super().__init__(**kwargs) + self.location = location + self.zones = zones + self.zone_details = zone_details + + +class ResourceSkuRestrictionInfo(_serialization.Model): + """Describes an available Compute SKU Restriction Information. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _attribute_map = { + "locations": {"key": "locations", "type": "[str]"}, + "zones": {"key": "zones", "type": "[str]"}, + } + + def __init__( + self, *, locations: Optional[List[str]] = None, zones: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword locations: Locations where the SKU is restricted. + :paramtype locations: list[str] + :keyword zones: List of availability zones where the SKU is restricted. + :paramtype zones: list[str] + """ + super().__init__(**kwargs) + self.locations = locations + self.zones = zones + + +class ResourceSkuRestrictions(_serialization.Model): + """The restrictions of the SKU. + + All required parameters must be populated in order to send to server. + + :ivar type: the type of restrictions. Known values are: "Location" and "Zone". + :vartype type: str or ~azure.mgmt.avs.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. Required. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + Required. + :vartype restriction_info: ~azure.mgmt.avs.models.ResourceSkuRestrictionInfo + :ivar reason_code: the reason for restriction. Known values are: "QuotaId" and + "NotAvailableForSubscription". + :vartype reason_code: str or ~azure.mgmt.avs.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + "values": {"required": True}, + "restriction_info": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, + "restriction_info": {"key": "restrictionInfo", "type": "ResourceSkuRestrictionInfo"}, + "reason_code": {"key": "reasonCode", "type": "str"}, + } + + def __init__( + self, + *, + values: List[str], + restriction_info: "_models.ResourceSkuRestrictionInfo", + type: Optional[Union[str, "_models.ResourceSkuRestrictionsType"]] = None, + reason_code: Optional[Union[str, "_models.ResourceSkuRestrictionsReasonCode"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: the type of restrictions. Known values are: "Location" and "Zone". + :paramtype type: str or ~azure.mgmt.avs.models.ResourceSkuRestrictionsType + :keyword values: The value of restrictions. If the restriction type is set to location. This + would be different locations where the SKU is restricted. Required. + :paramtype values: list[str] + :keyword restriction_info: The information about the restriction where the SKU cannot be used. + Required. + :paramtype restriction_info: ~azure.mgmt.avs.models.ResourceSkuRestrictionInfo + :keyword reason_code: the reason for restriction. Known values are: "QuotaId" and + "NotAvailableForSubscription". + :paramtype reason_code: str or ~azure.mgmt.avs.models.ResourceSkuRestrictionsReasonCode + """ + super().__init__(**kwargs) + self.type = type + self.values = values + self.restriction_info = restriction_info + self.reason_code = reason_code + + +class ResourceSkuZoneDetails(_serialization.Model): + """Describes The zonal capabilities of a SKU. + + All required parameters must be populated in order to send to server. + + :ivar name: Gets the set of zones that the SKU is available in with the specified capabilities. + Required. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. Required. + :vartype capabilities: list[~azure.mgmt.avs.models.ResourceSkuCapabilities] + """ + + _validation = { + "name": {"required": True}, + "capabilities": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "[str]"}, + "capabilities": {"key": "capabilities", "type": "[ResourceSkuCapabilities]"}, + } + + def __init__( + self, *, name: List[str], capabilities: List["_models.ResourceSkuCapabilities"], **kwargs: Any + ) -> None: + """ + :keyword name: Gets the set of zones that the SKU is available in with the specified + capabilities. Required. + :paramtype name: list[str] + :keyword capabilities: A list of capabilities that are available for the SKU in the specified + list of zones. Required. + :paramtype capabilities: list[~azure.mgmt.avs.models.ResourceSkuCapabilities] + """ + super().__init__(**kwargs) + self.name = name + self.capabilities = capabilities class ScriptCmdlet(ProxyResource): @@ -2661,7 +3497,7 @@ class ScriptCmdlet(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2712,11 +3548,11 @@ class ScriptCmdlet(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.description = None - self.timeout = None - self.audience = None - self.parameters = None + self.provisioning_state: Optional[Union[str, "_models.ScriptCmdletProvisioningState"]] = None + self.description: Optional[str] = None + self.timeout: Optional[str] = None + self.audience: Optional[Union[str, "_models.ScriptCmdletAudience"]] = None + self.parameters: Optional[List["_models.ScriptParameter"]] = None class ScriptCmdletsList(_serialization.Model): @@ -2751,13 +3587,13 @@ def __init__(self, *, value: List["_models.ScriptCmdlet"], next_link: Optional[s self.next_link = next_link -class ScriptExecution(ProxyResource): # pylint: disable=too-many-instance-attributes +class ScriptExecution(ProxyResource): """An instance of a script executed by a user - custom or AVS. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2885,15 +3721,15 @@ def __init__( self.failure_reason = failure_reason self.timeout = timeout self.retention = retention - self.submitted_at = None - self.started_at = None - self.finished_at = None - self.provisioning_state = None + self.submitted_at: Optional[datetime.datetime] = None + self.started_at: Optional[datetime.datetime] = None + self.finished_at: Optional[datetime.datetime] = None + self.provisioning_state: Optional[Union[str, "_models.ScriptExecutionProvisioningState"]] = None self.output = output self.named_outputs = named_outputs - self.information = None - self.warnings = None - self.errors = None + self.information: Optional[List[str]] = None + self.warnings: Optional[List[str]] = None + self.errors: Optional[List[str]] = None class ScriptExecutionsList(_serialization.Model): @@ -2936,7 +3772,7 @@ class ScriptPackage(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2986,11 +3822,11 @@ class ScriptPackage(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.description = None - self.version = None - self.company = None - self.uri = None + self.provisioning_state: Optional[Union[str, "_models.ScriptPackageProvisioningState"]] = None + self.description: Optional[str] = None + self.version: Optional[str] = None + self.company: Optional[str] = None + self.uri: Optional[str] = None class ScriptPackagesList(_serialization.Model): @@ -3067,11 +3903,11 @@ def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: :paramtype name: str """ super().__init__(**kwargs) - self.type = None + self.type: Optional[Union[str, "_models.ScriptParameterTypes"]] = None self.name = name - self.description = None - self.visibility = None - self.optional = None + self.description: Optional[str] = None + self.visibility: Optional[Union[str, "_models.VisibilityParameterEnum"]] = None + self.optional: Optional[Union[str, "_models.OptionalParamEnum"]] = None class ScriptSecureStringExecutionParameter(ScriptExecutionParameter): @@ -3217,6 +4053,67 @@ def __init__( self.capacity = capacity +class SpecializedHostProperties(HostProperties): + """The properties of a specialized host. + + 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 server. + + :ivar kind: The kind of host. Required. Known values are: "General" and "Specialized". + :vartype kind: str or ~azure.mgmt.avs.models.HostKind + :ivar provisioning_state: The state of the host provisioning. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.HostProvisioningState + :ivar display_name: Display name of the host in VMware vCenter. + :vartype display_name: str + :ivar mo_ref_id: vCenter managed object reference ID of the host. + :vartype mo_ref_id: str + :ivar fqdn: Fully qualified domain name of the host. + :vartype fqdn: str + :ivar maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :vartype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + :ivar fault_domain: + :vartype fault_domain: str + """ + + _validation = { + "kind": {"required": True}, + "provisioning_state": {"readonly": True}, + "mo_ref_id": {"readonly": True}, + "fqdn": {"readonly": True, "max_length": 255, "min_length": 1}, + "fault_domain": {"readonly": True}, + } + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "mo_ref_id": {"key": "moRefId", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "maintenance": {"key": "maintenance", "type": "str"}, + "fault_domain": {"key": "faultDomain", "type": "str"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + maintenance: Optional[Union[str, "_models.HostMaintenance"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the host in VMware vCenter. + :paramtype display_name: str + :keyword maintenance: If provided, the host is in maintenance. The value is the reason for + maintenance. Known values are: "Replacement" and "Upgrade". + :paramtype maintenance: str or ~azure.mgmt.avs.models.HostMaintenance + """ + super().__init__(display_name=display_name, maintenance=maintenance, **kwargs) + self.kind: str = "Specialized" + + class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -3306,8 +4203,8 @@ class Trial(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.status = None - self.available_hosts = None + self.status: Optional[Union[str, "_models.TrialStatus"]] = None + self.available_hosts: Optional[int] = None class VirtualMachine(ProxyResource): @@ -3316,7 +4213,7 @@ class VirtualMachine(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3331,7 +4228,7 @@ class VirtualMachine(ProxyResource): :vartype provisioning_state: str or ~azure.mgmt.avs.models.VirtualMachineProvisioningState :ivar display_name: Display name of the VM. :vartype display_name: str - :ivar mo_ref_id: Virtual machine managed object reference id. + :ivar mo_ref_id: vCenter managed object reference ID of the virtual machine. :vartype mo_ref_id: str :ivar folder_path: Path to virtual machine's folder starting from datacenter virtual machine folder. @@ -3368,11 +4265,11 @@ class VirtualMachine(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.display_name = None - self.mo_ref_id = None - self.folder_path = None - self.restrict_movement = None + self.provisioning_state: Optional[Union[str, "_models.VirtualMachineProvisioningState"]] = None + self.display_name: Optional[str] = None + self.mo_ref_id: Optional[str] = None + self.folder_path: Optional[str] = None + self.restrict_movement: Optional[Union[str, "_models.VirtualMachineRestrictMovementState"]] = None class VirtualMachineRestrictMovement(_serialization.Model): @@ -3602,7 +4499,7 @@ class WorkloadNetwork(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3636,7 +4533,7 @@ class WorkloadNetwork(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkProvisioningState"]] = None class WorkloadNetworkDhcp(ProxyResource): @@ -3645,7 +4542,7 @@ class WorkloadNetworkDhcp(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3734,8 +4631,8 @@ def __init__(self, *, display_name: Optional[str] = None, revision: Optional[int super().__init__(**kwargs) self.dhcp_type: Optional[str] = None self.display_name = display_name - self.segments = None - self.provisioning_state = None + self.segments: Optional[List[str]] = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkDhcpProvisioningState"]] = None self.revision = revision @@ -3899,13 +4796,13 @@ def __init__( self.lease_time = lease_time -class WorkloadNetworkDnsService(ProxyResource): # pylint: disable=too-many-instance-attributes +class WorkloadNetworkDnsService(ProxyResource): """NSX DNS Service. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3992,8 +4889,8 @@ def __init__( self.default_dns_zone = default_dns_zone self.fqdn_zones = fqdn_zones self.log_level = log_level - self.status = None - self.provisioning_state = None + self.status: Optional[Union[str, "_models.DnsServiceStatusEnum"]] = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkDnsServiceProvisioningState"]] = None self.revision = revision @@ -4031,13 +4928,13 @@ def __init__( self.next_link = next_link -class WorkloadNetworkDnsZone(ProxyResource): # pylint: disable=too-many-instance-attributes +class WorkloadNetworkDnsZone(ProxyResource): """NSX DNS Zone. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4118,7 +5015,7 @@ def __init__( self.dns_server_ips = dns_server_ips self.source_ip = source_ip self.dns_services = dns_services - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkDnsZoneProvisioningState"]] = None self.revision = revision @@ -4162,7 +5059,7 @@ class WorkloadNetworkGateway(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4206,9 +5103,9 @@ def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None :paramtype display_name: str """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkProvisioningState"]] = None self.display_name = display_name - self.path = None + self.path: Optional[str] = None class WorkloadNetworkGatewayList(_serialization.Model): @@ -4279,13 +5176,13 @@ def __init__( self.next_link = next_link -class WorkloadNetworkPortMirroring(ProxyResource): # pylint: disable=too-many-instance-attributes +class WorkloadNetworkPortMirroring(ProxyResource): """NSX Port Mirroring. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4365,8 +5262,8 @@ def __init__( self.direction = direction self.source = source self.destination = destination - self.status = None - self.provisioning_state = None + self.status: Optional[Union[str, "_models.PortMirroringStatusEnum"]] = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkPortMirroringProvisioningState"]] = None self.revision = revision @@ -4410,7 +5307,7 @@ class WorkloadNetworkPublicIP(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4464,8 +5361,8 @@ def __init__( super().__init__(**kwargs) self.display_name = display_name self.number_of_public_i_ps = number_of_public_i_ps - self.public_ip_block = None - self.provisioning_state = None + self.public_ip_block: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkPublicIPProvisioningState"]] = None class WorkloadNetworkPublicIPsList(_serialization.Model): @@ -4502,13 +5399,13 @@ def __init__( self.next_link = next_link -class WorkloadNetworkSegment(ProxyResource): # pylint: disable=too-many-instance-attributes +class WorkloadNetworkSegment(ProxyResource): """NSX Segment. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4583,9 +5480,9 @@ def __init__( self.display_name = display_name self.connected_gateway = connected_gateway self.subnet = subnet - self.port_vif = None - self.status = None - self.provisioning_state = None + self.port_vif: Optional[List["_models.WorkloadNetworkSegmentPortVif"]] = None + self.status: Optional[Union[str, "_models.SegmentStatusEnum"]] = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkSegmentProvisioningState"]] = None self.revision = revision @@ -4677,7 +5574,7 @@ class WorkloadNetworkVirtualMachine(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4721,9 +5618,9 @@ def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None :paramtype display_name: str """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkProvisioningState"]] = None self.display_name = display_name - self.vm_type = None + self.vm_type: Optional[Union[str, "_models.VMTypeEnum"]] = None class WorkloadNetworkVirtualMachinesList(_serialization.Model): @@ -4766,7 +5663,7 @@ class WorkloadNetworkVMGroup(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4830,8 +5727,8 @@ def __init__( super().__init__(**kwargs) self.display_name = display_name self.members = members - self.status = None - self.provisioning_state = None + self.status: Optional[Union[str, "_models.VMGroupStatusEnum"]] = None + self.provisioning_state: Optional[Union[str, "_models.WorkloadNetworkVMGroupProvisioningState"]] = None self.revision = revision diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py index e6a84c5d03a3..2c842b6b4c54 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py @@ -5,47 +5,61 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._locations_operations import LocationsOperations -from ._private_clouds_operations import PrivateCloudsOperations -from ._addons_operations import AddonsOperations -from ._authorizations_operations import AuthorizationsOperations -from ._cloud_links_operations import CloudLinksOperations -from ._clusters_operations import ClustersOperations -from ._datastores_operations import DatastoresOperations -from ._placement_policies_operations import PlacementPoliciesOperations -from ._virtual_machines_operations import VirtualMachinesOperations -from ._global_reach_connections_operations import GlobalReachConnectionsOperations -from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations -from ._iscsi_paths_operations import IscsiPathsOperations -from ._script_executions_operations import ScriptExecutionsOperations -from ._script_packages_operations import ScriptPackagesOperations -from ._script_cmdlets_operations import ScriptCmdletsOperations -from ._workload_networks_operations import WorkloadNetworksOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._locations_operations import LocationsOperations # type: ignore +from ._private_clouds_operations import PrivateCloudsOperations # type: ignore +from ._skus_operations import SkusOperations # type: ignore +from ._addons_operations import AddonsOperations # type: ignore +from ._authorizations_operations import AuthorizationsOperations # type: ignore +from ._cloud_links_operations import CloudLinksOperations # type: ignore +from ._clusters_operations import ClustersOperations # type: ignore +from ._datastores_operations import DatastoresOperations # type: ignore +from ._hosts_operations import HostsOperations # type: ignore +from ._placement_policies_operations import PlacementPoliciesOperations # type: ignore +from ._virtual_machines_operations import VirtualMachinesOperations # type: ignore +from ._global_reach_connections_operations import GlobalReachConnectionsOperations # type: ignore +from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations # type: ignore +from ._iscsi_paths_operations import IscsiPathsOperations # type: ignore +from ._provisioned_networks_operations import ProvisionedNetworksOperations # type: ignore +from ._pure_storage_policies_operations import PureStoragePoliciesOperations # type: ignore +from ._script_executions_operations import ScriptExecutionsOperations # type: ignore +from ._script_packages_operations import ScriptPackagesOperations # type: ignore +from ._script_cmdlets_operations import ScriptCmdletsOperations # type: ignore +from ._workload_networks_operations import WorkloadNetworksOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "Operations", "LocationsOperations", "PrivateCloudsOperations", + "SkusOperations", "AddonsOperations", "AuthorizationsOperations", "CloudLinksOperations", "ClustersOperations", "DatastoresOperations", + "HostsOperations", "PlacementPoliciesOperations", "VirtualMachinesOperations", "GlobalReachConnectionsOperations", "HcxEnterpriseSitesOperations", "IscsiPathsOperations", + "ProvisionedNetworksOperations", + "PureStoragePoliciesOperations", "ScriptExecutionsOperations", "ScriptPackagesOperations", "ScriptCmdletsOperations", "WorkloadNetworksOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py index 139a66ab802a..7a7ca1fc9985 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -117,7 +115,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -154,14 +152,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -196,10 +194,10 @@ class AddonsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterable["_models.Addon"]: @@ -220,7 +218,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -298,7 +296,7 @@ def get(self, resource_group_name: str, private_cloud_name: str, addon_name: str :rtype: ~azure.mgmt.avs.models.Addon :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +348,7 @@ def _create_or_update_initial( addon: Union[_models.Addon, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +550,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, addon_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py index 9b210b5d1e0c..35031c2857df 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -117,7 +115,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -154,14 +152,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -196,10 +194,10 @@ class AuthorizationsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -223,7 +221,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExpressRouteAuthorizationList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +301,7 @@ def get( :rtype: ~azure.mgmt.avs.models.ExpressRouteAuthorization :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +353,7 @@ def _create_or_update_initial( authorization: Union[_models.ExpressRouteAuthorization, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +559,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, authorization_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py index c69eca5ed914..13c088f400cc 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -117,7 +115,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -154,14 +152,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -196,10 +194,10 @@ class CloudLinksOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterable["_models.CloudLink"]: @@ -220,7 +218,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudLinkList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -300,7 +298,7 @@ def get( :rtype: ~azure.mgmt.avs.models.CloudLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -352,7 +350,7 @@ def _create_or_update_initial( cloud_link: Union[_models.CloudLink, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -555,7 +553,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, cloud_link_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py index 95416aaa6466..7948dc9a96ba 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -117,7 +115,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -154,7 +152,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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -162,7 +160,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -191,14 +189,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -225,14 +223,14 @@ def build_list_zones_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/listZones", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -267,10 +265,10 @@ class ClustersOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterable["_models.Cluster"]: @@ -291,7 +289,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -371,7 +369,7 @@ def get( :rtype: ~azure.mgmt.avs.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +421,7 @@ def _create_or_update_initial( cluster: Union[_models.Cluster, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,7 +629,7 @@ def _update_initial( cluster_update: Union[_models.ClusterUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -717,7 +715,7 @@ def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Required. + :param cluster_update: The resource properties to be updated. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -747,7 +745,7 @@ def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Required. + :param cluster_update: The resource properties to be updated. Required. :type cluster_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -775,7 +773,7 @@ def begin_update( :type private_cloud_name: str :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster_update: The cluster properties to be updated. Is either a ClusterUpdate type or + :param cluster_update: The resource properties to be updated. Is either a ClusterUpdate type or a IO[bytes] type. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate or IO[bytes] :return: An instance of LROPoller that returns either Cluster or the result of cls(response) @@ -835,7 +833,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +964,7 @@ def list_zones( :rtype: ~azure.mgmt.avs.models.ClusterZoneList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py index 569a94e53377..0757afb15538 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -89,14 +87,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -129,7 +127,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +135,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -172,14 +170,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -215,10 +213,10 @@ class DatastoresOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -243,7 +241,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatastoreList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +324,7 @@ def get( :rtype: ~azure.mgmt.avs.models.Datastore :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +378,7 @@ def _create_or_update_initial( datastore: Union[_models.Datastore, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -594,7 +592,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, datastore_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py index de916f8cffea..5185fd51ba20 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -87,14 +85,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -127,7 +125,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -135,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -170,14 +168,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -214,10 +212,10 @@ class GlobalReachConnectionsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -241,7 +239,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalReachConnectionList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +319,7 @@ def get( :rtype: ~azure.mgmt.avs.models.GlobalReachConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +371,7 @@ def _create_or_update_initial( global_reach_connection: Union[_models.GlobalReachConnection, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -579,7 +577,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, global_reach_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py index e34f8a32970e..e0c492d3bc14 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +44,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -123,7 +121,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +129,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -166,14 +164,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -210,10 +208,10 @@ class HcxEnterpriseSitesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -236,7 +234,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.HcxEnterpriseSiteList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +314,7 @@ def get( :rtype: ~azure.mgmt.avs.models.HcxEnterpriseSite :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +443,7 @@ def create_or_update( :rtype: ~azure.mgmt.avs.models.HcxEnterpriseSite :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +516,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hosts_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hosts_operations.py new file mode 100644 index 000000000000..6f8455984a72 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hosts_operations.py @@ -0,0 +1,282 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core import PipelineClient +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.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, private_cloud_name: str, cluster_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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/hosts", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + } + + _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) + + +def build_get_request( + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + host_id: 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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/hosts/{hostId}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), + "hostId": _SERIALIZER.url("host_id", host_id, "str", pattern=r"^[-\w\._]+$"), + } + + _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 HostsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.AVSClient`'s + :attr:`hosts` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.Host"]: + """List Host resources by Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param cluster_name: Name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of either Host or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.Host] + :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.HostListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("HostListResult", 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) + + @distributed_trace + def get( + self, resource_group_name: str, private_cloud_name: str, cluster_name: str, host_id: str, **kwargs: Any + ) -> _models.Host: + """Get a Host. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param cluster_name: Name of the cluster. Required. + :type cluster_name: str + :param host_id: The host identifier. Required. + :type host_id: str + :return: Host or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.Host + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.Host] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + host_id=host_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("Host", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py index dc9f03400656..f19603821b8b 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ def build_list_by_private_cloud_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -116,7 +114,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,7 +122,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -152,14 +150,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -193,10 +191,10 @@ class IscsiPathsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_private_cloud( @@ -219,7 +217,7 @@ def list_by_private_cloud( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IscsiPathListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +293,7 @@ def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) :rtype: ~azure.mgmt.avs.models.IscsiPath :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +343,7 @@ def _create_or_update_initial( resource: Union[_models.IscsiPath, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -535,7 +533,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py index d31f89a23417..dae9eebd469a 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +39,14 @@ def build_check_quota_availability_request(location: str, subscription_id: str, _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-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -70,7 +67,7 @@ def build_check_trial_availability_request(location: str, subscription_id: str, _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-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -78,7 +75,7 @@ def build_check_trial_availability_request(location: str, subscription_id: str, _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -111,10 +108,10 @@ class LocationsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quota: @@ -126,7 +123,7 @@ def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quot :rtype: ~azure.mgmt.avs.models.Quota :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +216,7 @@ def check_trial_availability( :rtype: ~azure.mgmt.avs.models.Trial :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py index f73f436bb0d9..2a184feefabc 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,10 +69,10 @@ class Operations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -91,7 +88,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py index 34c862a2da59..44aace415d86 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -89,14 +87,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -131,7 +129,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +137,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -176,7 +174,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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -184,7 +182,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -221,14 +219,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -266,10 +264,10 @@ class PlacementPoliciesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -294,7 +292,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PlacementPoliciesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +380,7 @@ def get( :rtype: ~azure.mgmt.avs.models.PlacementPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +434,7 @@ def _create_or_update_initial( placement_policy: Union[_models.PlacementPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +657,7 @@ def _update_initial( placement_policy_update: Union[_models.PlacementPolicyUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -749,7 +747,7 @@ def begin_update( :type cluster_name: str :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties to be updated. Required. + :param placement_policy_update: The resource properties to be updated. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -783,7 +781,7 @@ def begin_update( :type cluster_name: str :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties to be updated. Required. + :param placement_policy_update: The resource properties to be updated. Required. :type placement_policy_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -815,7 +813,7 @@ def begin_update( :type cluster_name: str :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties to be updated. Is either a + :param placement_policy_update: The resource properties to be updated. Is either a PlacementPolicyUpdate type or a IO[bytes] type. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate or IO[bytes] :return: An instance of LROPoller that returns either PlacementPolicy or the result of @@ -882,7 +880,7 @@ def _delete_initial( placement_policy_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py index deae76c1083d..9d5ebc4a9806 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ def build_list_in_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _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-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +135,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +143,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -173,7 +171,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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -181,7 +179,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -209,14 +207,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -242,14 +240,14 @@ def build_list_admin_credentials_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -275,14 +273,14 @@ def build_rotate_nsxt_password_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -308,14 +306,14 @@ def build_rotate_vcenter_password_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -349,10 +347,10 @@ class PrivateCloudsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud"]: @@ -368,7 +366,7 @@ def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +444,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Pri api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +519,7 @@ def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) :rtype: ~azure.mgmt.avs.models.PrivateCloud :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +569,7 @@ def _create_or_update_initial( private_cloud: Union[_models.PrivateCloud, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -770,7 +768,7 @@ def _update_initial( private_cloud_update: Union[_models.PrivateCloudUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +850,7 @@ def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Required. + :param private_cloud_update: The resource properties to be updated. Required. :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -880,7 +878,7 @@ def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Required. + :param private_cloud_update: The resource properties to be updated. Required. :type private_cloud_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -906,7 +904,7 @@ def begin_update( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud_update: The private cloud properties to be updated. Is either a + :param private_cloud_update: The resource properties to be updated. Is either a PrivateCloudUpdate type or a IO[bytes] type. Required. :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate or IO[bytes] :return: An instance of LROPoller that returns either PrivateCloud or the result of @@ -964,7 +962,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1087,7 +1085,7 @@ def list_admin_credentials( :rtype: ~azure.mgmt.avs.models.AdminCredentials :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1133,7 +1131,7 @@ def list_admin_credentials( def _rotate_nsxt_password_initial( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1246,7 +1244,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_vcenter_password_initial( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_provisioned_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_provisioned_networks_operations.py new file mode 100644 index 000000000000..178507ce5558 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_provisioned_networks_operations.py @@ -0,0 +1,275 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core import PipelineClient +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.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, private_cloud_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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/provisionedNetworks", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + } + + _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) + + +def build_get_request( + resource_group_name: str, + private_cloud_name: str, + provisioned_network_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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/provisionedNetworks/{provisionedNetworkName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "provisionedNetworkName": _SERIALIZER.url( + "provisioned_network_name", provisioned_network_name, "str", pattern=r"^[-\w\._]+$" + ), + } + + _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 ProvisionedNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.AVSClient`'s + :attr:`provisioned_networks` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> Iterable["_models.ProvisionedNetwork"]: + """List ProvisionedNetwork resources by PrivateCloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :return: An iterator like instance of either ProvisionedNetwork or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.ProvisionedNetwork] + :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.ProvisionedNetworkListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProvisionedNetworkListResult", 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) + + @distributed_trace + def get( + self, resource_group_name: str, private_cloud_name: str, provisioned_network_name: str, **kwargs: Any + ) -> _models.ProvisionedNetwork: + """Get a ProvisionedNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param provisioned_network_name: Name of the cloud link. Required. + :type provisioned_network_name: str + :return: ProvisionedNetwork or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.ProvisionedNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.ProvisionedNetwork] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + provisioned_network_name=provisioned_network_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("ProvisionedNetwork", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_pure_storage_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_pure_storage_policies_operations.py new file mode 100644 index 000000000000..b39d929025c8 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_pure_storage_policies_operations.py @@ -0,0 +1,676 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 collections.abc import MutableMapping +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +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 .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, private_cloud_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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/pureStoragePolicies", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + } + + _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) + + +def build_get_request( + resource_group_name: str, private_cloud_name: str, storage_policy_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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/pureStoragePolicies/{storagePolicyName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "storagePolicyName": _SERIALIZER.url("storage_policy_name", storage_policy_name, "str", pattern=r"^[-\w\._]+$"), + } + + _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) + + +def build_create_or_update_request( + resource_group_name: str, private_cloud_name: str, storage_policy_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", "2024-09-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.AVS/privateClouds/{privateCloudName}/pureStoragePolicies/{storagePolicyName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "storagePolicyName": _SERIALIZER.url("storage_policy_name", storage_policy_name, "str", pattern=r"^[-\w\._]+$"), + } + + _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, private_cloud_name: str, storage_policy_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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/pureStoragePolicies/{storagePolicyName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "storagePolicyName": _SERIALIZER.url("storage_policy_name", storage_policy_name, "str", pattern=r"^[-\w\._]+$"), + } + + _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) + + +class PureStoragePoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.AVSClient`'s + :attr:`pure_storage_policies` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> Iterable["_models.PureStoragePolicy"]: + """List PureStoragePolicy resources by PrivateCloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :return: An iterator like instance of either PureStoragePolicy or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.PureStoragePolicy] + :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.PureStoragePolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PureStoragePolicyListResult", 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) + + @distributed_trace + def get( + self, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, **kwargs: Any + ) -> _models.PureStoragePolicy: + """Get a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :return: PureStoragePolicy or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.PureStoragePolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.PureStoragePolicy] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("PureStoragePolicy", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: Union[_models.PureStoragePolicy, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "PureStoragePolicy") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + 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 == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: _models.PureStoragePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PureStoragePolicy]: + """Create a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.avs.models.PureStoragePolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PureStoragePolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.PureStoragePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PureStoragePolicy]: + """Create a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either PureStoragePolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.PureStoragePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + storage_policy_name: str, + resource: Union[_models.PureStoragePolicy, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PureStoragePolicy]: + """Create a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :param resource: Resource create parameters. Is either a PureStoragePolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.avs.models.PureStoragePolicy or IO[bytes] + :return: An instance of LROPoller that returns either PureStoragePolicy or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.PureStoragePolicy] + :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.PureStoragePolicy] = 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_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("PureStoragePolicy", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PureStoragePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PureStoragePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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 [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + 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")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, private_cloud_name: str, storage_policy_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a PureStoragePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param storage_policy_name: Name of the storage policy. Required. + :type storage_policy_name: str + :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( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + storage_policy_name=storage_policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py index e05d3bce7f0b..a26a39d3f0b9 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -86,14 +84,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -131,10 +129,10 @@ class ScriptCmdletsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -159,7 +157,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptCmdletsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +245,7 @@ def get( :rtype: ~azure.mgmt.avs.models.ScriptCmdlet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py index bfe64185aac8..55435b5c454e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -119,7 +117,7 @@ def build_create_or_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,7 +125,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -158,14 +156,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -194,7 +192,7 @@ def build_get_execution_logs_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -202,7 +200,7 @@ def build_get_execution_logs_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -241,10 +239,10 @@ class ScriptExecutionsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -267,7 +265,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptExecutionsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +345,7 @@ def get( :rtype: ~azure.mgmt.avs.models.ScriptExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -399,7 +397,7 @@ def _create_or_update_initial( script_execution: Union[_models.ScriptExecution, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -605,7 +603,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, private_cloud_name: str, script_execution_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +806,7 @@ def get_execution_logs( :rtype: ~azure.mgmt.avs.models.ScriptExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py index e08ec8f8ecac..edd4898d6ab3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -78,14 +76,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -122,10 +120,10 @@ class ScriptPackagesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -148,7 +146,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ScriptPackagesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +226,7 @@ def get( :rtype: ~azure.mgmt.avs.models.ScriptPackage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_skus_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_skus_operations.py new file mode 100644 index 000000000000..e4838be0ae7e --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_skus_operations.py @@ -0,0 +1,155 @@ +# 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 collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core import PipelineClient +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.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(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", "2024-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/skus") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _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 SkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.AVSClient`'s + :attr:`skus` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: + """A list of SKUs. + + :return: An iterator like instance of either ResourceSku or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.ResourceSku] + :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.PagedResourceSku] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PagedResourceSku", 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) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py index 8737483cd554..9742e6218d81 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -89,14 +87,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -129,7 +127,7 @@ def build_restrict_movement_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +135,7 @@ def build_restrict_movement_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -175,10 +173,10 @@ class VirtualMachinesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -203,7 +201,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualMachinesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +289,7 @@ def get( :rtype: ~azure.mgmt.avs.models.VirtualMachine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +343,7 @@ def _restrict_movement_initial( restrict_movement: Union[_models.VirtualMachineRestrictMovement, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -434,7 +432,7 @@ def begin_restrict_movement( :type cluster_name: str :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: The body type of the operation request. Required. + :param restrict_movement: The content of the action request. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -467,7 +465,7 @@ def begin_restrict_movement( :type cluster_name: str :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: The body type of the operation request. Required. + :param restrict_movement: The content of the action request. Required. :type restrict_movement: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -498,7 +496,7 @@ def begin_restrict_movement( :type cluster_name: str :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: The body type of the operation request. Is either a + :param restrict_movement: The content of the action request. Is either a VirtualMachineRestrictMovement type or a IO[bytes] type. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py index 829263342ebd..2ff6915f0892 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AVSClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -116,14 +114,14 @@ def build_list_dhcp_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -149,14 +147,14 @@ def build_get_dhcp_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -183,7 +181,7 @@ def build_create_dhcp_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,7 +189,7 @@ def build_create_dhcp_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -220,7 +218,7 @@ def build_update_dhcp_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -228,7 +226,7 @@ def build_update_dhcp_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -257,14 +255,14 @@ def build_delete_dhcp_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -291,14 +289,14 @@ def build_list_dns_services_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -324,14 +322,14 @@ def build_get_dns_service_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -358,7 +356,7 @@ def build_create_dns_service_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -366,7 +364,7 @@ def build_create_dns_service_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -395,7 +393,7 @@ def build_update_dns_service_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -403,7 +401,7 @@ def build_update_dns_service_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -432,14 +430,14 @@ def build_delete_dns_service_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -466,14 +464,14 @@ def build_list_dns_zones_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -499,14 +497,14 @@ def build_get_dns_zone_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -533,7 +531,7 @@ def build_create_dns_zone_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -541,7 +539,7 @@ def build_create_dns_zone_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -570,7 +568,7 @@ def build_update_dns_zone_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -578,7 +576,7 @@ def build_update_dns_zone_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -607,14 +605,14 @@ def build_delete_dns_zone_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -641,14 +639,14 @@ def build_list_gateways_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -674,14 +672,14 @@ def build_get_gateway_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -708,14 +706,14 @@ def build_list_port_mirroring_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -741,14 +739,14 @@ def build_get_port_mirroring_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -775,7 +773,7 @@ def build_create_port_mirroring_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -783,7 +781,7 @@ def build_create_port_mirroring_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -812,7 +810,7 @@ def build_update_port_mirroring_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -820,7 +818,7 @@ def build_update_port_mirroring_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -849,14 +847,14 @@ def build_delete_port_mirroring_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -883,14 +881,14 @@ def build_list_public_ips_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -916,14 +914,14 @@ def build_get_public_ip_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -950,7 +948,7 @@ def build_create_public_ip_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -958,7 +956,7 @@ def build_create_public_ip_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -987,14 +985,14 @@ def build_delete_public_ip_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1021,14 +1019,14 @@ def build_list_segments_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1054,14 +1052,14 @@ def build_get_segment_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1088,7 +1086,7 @@ def build_create_segments_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1096,7 +1094,7 @@ def build_create_segments_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1125,7 +1123,7 @@ def build_update_segments_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1133,7 +1131,7 @@ def build_update_segments_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1162,14 +1160,14 @@ def build_delete_segment_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1196,14 +1194,14 @@ def build_list_virtual_machines_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1229,14 +1227,14 @@ def build_get_virtual_machine_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1263,14 +1261,14 @@ def build_list_vm_groups_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1296,14 +1294,14 @@ def build_get_vm_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1330,7 +1328,7 @@ def build_create_vm_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1338,7 +1336,7 @@ def build_create_vm_group_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1367,7 +1365,7 @@ def build_update_vm_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1375,7 +1373,7 @@ def build_update_vm_group_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1404,14 +1402,14 @@ def build_delete_vm_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1446,10 +1444,10 @@ class WorkloadNetworksOperations: # pylint: disable=too-many-public-methods 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AVSClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -1472,7 +1470,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1548,7 +1546,7 @@ def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) :rtype: ~azure.mgmt.avs.models.WorkloadNetwork :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1612,7 +1610,7 @@ def list_dhcp( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDhcpList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1692,7 +1690,7 @@ def get_dhcp( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1744,7 +1742,7 @@ def _create_dhcp_initial( workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1955,7 +1953,7 @@ def _update_dhcp_initial( workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2162,7 +2160,7 @@ def get_long_running_output(pipeline_response): def _delete_dhcp_initial( self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2298,7 +2296,7 @@ def list_dns_services( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsServicesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2378,7 +2376,7 @@ def get_dns_service( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2430,7 +2428,7 @@ def _create_dns_service_initial( workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2642,7 +2640,7 @@ def _update_dns_service_initial( workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2850,7 +2848,7 @@ def get_long_running_output(pipeline_response): def _delete_dns_service_initial( self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2986,7 +2984,7 @@ def list_dns_zones( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkDnsZonesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3066,7 +3064,7 @@ def get_dns_zone( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3118,7 +3116,7 @@ def _create_dns_zone_initial( workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3329,7 +3327,7 @@ def _update_dns_zone_initial( workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3536,7 +3534,7 @@ def get_long_running_output(pipeline_response): def _delete_dns_zone_initial( self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3672,7 +3670,7 @@ def list_gateways( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkGatewayList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3752,7 +3750,7 @@ def get_gateway( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3818,7 +3816,7 @@ def list_port_mirroring( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPortMirroringList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3898,7 +3896,7 @@ def get_port_mirroring( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3950,7 +3948,7 @@ def _create_port_mirroring_initial( workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4162,7 +4160,7 @@ def _update_port_mirroring_initial( workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4370,7 +4368,7 @@ def get_long_running_output(pipeline_response): def _delete_port_mirroring_initial( self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4506,7 +4504,7 @@ def list_public_ips( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkPublicIPsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4586,7 +4584,7 @@ def get_public_ip( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4638,7 +4636,7 @@ def _create_public_ip_initial( workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4844,7 +4842,7 @@ def get_long_running_output(pipeline_response): def _delete_public_ip_initial( self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4980,7 +4978,7 @@ def list_segments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkSegmentsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5060,7 +5058,7 @@ def get_segment( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5112,7 +5110,7 @@ def _create_segments_initial( workload_network_segment: Union[_models.WorkloadNetworkSegment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5323,7 +5321,7 @@ def _update_segments_initial( workload_network_segment: Union[_models.WorkloadNetworkSegment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5530,7 +5528,7 @@ def get_long_running_output(pipeline_response): def _delete_segment_initial( self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5666,7 +5664,7 @@ def list_virtual_machines( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVirtualMachinesList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5746,7 +5744,7 @@ def get_virtual_machine( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5812,7 +5810,7 @@ def list_vm_groups( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadNetworkVMGroupsList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5892,7 +5890,7 @@ def get_vm_group( :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5944,7 +5942,7 @@ def _create_vm_group_initial( workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6155,7 +6153,7 @@ def _update_vm_group_initial( workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6362,7 +6360,7 @@ def get_long_running_output(pipeline_response): def _delete_vm_group_initial( self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py index 9c144ab7fdc1..cf404fd73dea 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_ArcReg.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_CreateOrUpdate_ArcReg.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py index 78c3e8d75f10..51e8d142c7e2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_HCX.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_CreateOrUpdate_HCX.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx_with_networks.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx_with_networks.py new file mode 100644 index 000000000000..18e26ea7f7a2 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx_with_networks.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python addons_create_or_update_hcx_with_networks.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.addons.begin_create_or_update( + resource_group_name="group1", + private_cloud_name="cloud1", + addon_name="hcx", + addon={ + "properties": { + "addonType": "HCX", + "managementNetwork": "10.3.1.0/24", + "offer": "VMware MaaS Cloud Provider (Enterprise)", + "uplinkNetwork": "10.3.2.0/24", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_CreateOrUpdate_HCX_With_Networks.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py index 0a2a098b0a65..4b0a68d19794 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_SRM.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_CreateOrUpdate_SRM.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py index 09c5b7e43624..c879b22fa5e0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_VR.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_CreateOrUpdate_VR.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py index ac6352d6e4e0..a40e81446c9b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py index 857fb47879fe..75c6fdc90c4d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_ArcReg.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_Get_ArcReg.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py index 1a2caa60d8e8..bde1c9039a1e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_HCX.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_Get_HCX.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx_with_networks.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx_with_networks.py new file mode 100644 index 000000000000..b3559898c764 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx_with_networks.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python addons_get_hcx_with_networks.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.addons.get( + resource_group_name="group1", + private_cloud_name="cloud1", + addon_name="hcx", + ) + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_Get_HCX_With_Networks.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py index 45f9129f4f3f..284c3c724ec2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_SRM.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_Get_SRM.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py index b64dcfa110e5..736592e86204 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_VR.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_Get_VR.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py index 3a24576d2f3f..06f78516b648 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Addons_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py index 2afba9f258d4..fc18826e8592 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Authorizations_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py index bda55f39ffa2..94b7d8733a56 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Authorizations_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py index a7ac0bf9c235..e9c722024a10 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Authorizations_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py index a7518e432ae6..f1bd1e8b06ae 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -43,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/CloudLinks_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py index 2d93ee6791df..2c8aa7e75b66 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/CloudLinks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py index d31a83acfe62..b43e18267136 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/CloudLinks_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py index 66b67b12123f..7c61b92af31f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/CloudLinks_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py index 28006a999e82..17984610019b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py index d879e70a5844..4143bae7e2c3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py index 5400b820788f..da1964e51759 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py index fb2e42b85713..67daf9e1ebe9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py index fff714096b8c..80c04c8e657d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_ListZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py index bc91085d488c..5a2c82a0756d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_ListZones_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py index 55769d9f01ce..809a8e0e9efe 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Clusters_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py index 08f9621176a0..9fd92c8fd8d7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Datastores_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py index dc8ce46d5094..849fee95fec3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Datastores_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py index 9f5a4ad104a8..9cd3f7f04856 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Datastores_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py index f40c368a6056..289c9b6a4f51 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Datastores_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py index 38bfd91fd852..a28925a5ac6a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/GlobalReachConnections_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py index 1ad1ebd41a64..ab5eecae20fe 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/GlobalReachConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py index cce06dd7ba8f..29e67d81f516 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/GlobalReachConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py index 008d2fd9f070..82b3c05b3a30 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/GlobalReachConnections_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py index dad47ce9ef2b..8c7867208f95 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/HcxEnterpriseSites_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py index 5c2521db3ebe..59cf3e73dee3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/HcxEnterpriseSites_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py index e83389722194..3f6dd1ceb2a8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/HcxEnterpriseSites_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hosts_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/hosts_get.py new file mode 100644 index 000000000000..15fb738f8678 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hosts_get.py @@ -0,0 +1,44 @@ +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python hosts_get.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.hosts.get( + resource_group_name="group1", + private_cloud_name="cloud1", + cluster_name="cluster1", + host_id="esx03-r52.1111111111111111111.westcentralus.prod.azure.com", + ) + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Hosts_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hosts_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/hosts_list.py new file mode 100644 index 000000000000..6c9e1e69382c --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hosts_list.py @@ -0,0 +1,44 @@ +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python hosts_list.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.hosts.list( + resource_group_name="group1", + private_cloud_name="cloud1", + cluster_name="cluster1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Hosts_List.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py index d7bd25b49800..5da78681a5a3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/IscsiPaths_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py index 7407743aa846..9b4f57fc9e43 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/IscsiPaths_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py index 7a94cc469b2f..ac7e3179a9e1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/IscsiPaths_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py index 275e70f8f38e..8765f5be3466 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/IscsiPaths_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py index 9d9b0cd0bd93..775b6b8aed43 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckQuotaAvailability.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Locations_CheckQuotaAvailability.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py index 9acbb0b2cd3a..0138bb074e48 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckTrialAvailability.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Locations_CheckTrialAvailability.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py index fc84afd5e87e..750ca5906a9b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckTrialAvailabilityWithSku.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Locations_CheckTrialAvailabilityWithSku.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py index 6f835266f01c..e8e5b60220a1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Operations_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py index f96a82b2e453..a5023adfa091 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PlacementPolicies_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py index 52f65e7ad9da..dbc93bd54bb3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PlacementPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py index 3f54bf9f827e..0a4a750595e1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PlacementPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py index 3763cd3afd0e..665424bab1a7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PlacementPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py index 957c21d04b94..6b2b4f9efeb8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PlacementPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py index fc6d29a454da..acf8757563cf 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_fleet_native.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_fleet_native.py new file mode 100644 index 000000000000..ec06d52ef10b --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_fleet_native.py @@ -0,0 +1,54 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python private_clouds_create_or_update_fleet_native.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.private_clouds.begin_create_or_update( + resource_group_name="group1", + private_cloud_name="cloud1", + private_cloud={ + "location": "eastus2", + "properties": { + "dnsZoneType": "Private", + "managementCluster": {"clusterSize": 4}, + "networkBlock": "192.168.48.0/22", + "virtualNetworkId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/vnet", + }, + "sku": {"name": "AV64"}, + "tags": {}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_CreateOrUpdate_FleetNative.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py index 1b43dc07f5ce..c4f130f69002 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched_zones.py new file mode 100644 index 000000000000..33d760875311 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched_zones.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python private_clouds_create_or_update_stretched_zones.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.private_clouds.begin_create_or_update( + resource_group_name="group1", + private_cloud_name="cloud1", + private_cloud={ + "location": "eastus2", + "properties": {"managementCluster": {"clusterSize": 4}, "networkBlock": "192.168.48.0/22"}, + "sku": {"name": "AV36"}, + "tags": {}, + "zones": ["1", "2"], + }, + ).result() + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_CreateOrUpdate_StretchedZones.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py index c8e817ad1e4e..7770e4c7b7b5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py index ae29418cbe38..20cd891a2a24 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py index 22229ae328eb..b9febfbabf54 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_Get_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py index ca6e24707bf1..aeee4cd11d79 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py index 4916d5a5c4b2..67be70d17097 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_ListAdminCredentials.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py index a1bbefb09ad8..1e0e120834ed 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListInSubscription.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_ListInSubscription.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py index 9f4e2328bcbc..d355a24b1ac0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListInSubscription_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_ListInSubscription_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py index df7a72efc90c..017bdb19765a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_List_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py index 23c3490ac9c4..b970d9b43d5a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_RotateNsxtPassword.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_RotateNsxtPassword.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py index 963c90bb5e01..2bb2005468b9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_RotateVcenterPassword.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_RotateVcenterPassword.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py index 0b2a8b3114e6..cf09e3745dd7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py index 59576bc854fa..c9a8a5e3af21 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PrivateClouds_Update_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/provisioned_networks_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/provisioned_networks_get.py new file mode 100644 index 000000000000..71223c99698e --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/provisioned_networks_get.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python provisioned_networks_get.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.provisioned_networks.get( + resource_group_name="group1", + private_cloud_name="cloud1", + provisioned_network_name="vsan", + ) + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ProvisionedNetworks_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/provisioned_networks_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/provisioned_networks_list.py new file mode 100644 index 000000000000..1b47e4a95d35 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/provisioned_networks_list.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python provisioned_networks_list.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.provisioned_networks.list( + resource_group_name="group1", + private_cloud_name="cloud1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ProvisionedNetworks_List.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_create_or_update.py new file mode 100644 index 000000000000..1c96633f9786 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_create_or_update.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python pure_storage_policies_create_or_update.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.pure_storage_policies.begin_create_or_update( + resource_group_name="group1", + private_cloud_name="cloud1", + storage_policy_name="storagePolicy1", + resource={ + "properties": { + "storagePolicyDefinition": "storagePolicyDefinition1", + "storagePoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/PureStorage.Block/storagePools/storagePool1", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PureStoragePolicies_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_delete.py new file mode 100644 index 000000000000..01eeae988513 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_delete.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python pure_storage_policies_delete.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.pure_storage_policies.begin_delete( + resource_group_name="group1", + private_cloud_name="cloud1", + storage_policy_name="storagePolicy1", + ).result() + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PureStoragePolicies_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_get.py new file mode 100644 index 000000000000..508e3d24842a --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_get.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python pure_storage_policies_get.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.pure_storage_policies.get( + resource_group_name="group1", + private_cloud_name="cloud1", + storage_policy_name="storagePolicy1", + ) + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PureStoragePolicies_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_list.py new file mode 100644 index 000000000000..eb7212b7a6c3 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/pure_storage_policies_list.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python pure_storage_policies_list.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.pure_storage_policies.list( + resource_group_name="group1", + private_cloud_name="cloud1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/PureStoragePolicies_List.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py index 2419d800ee75..e26df8f9a787 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptCmdlets_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py index 33f12411b4ff..c8a1e7a754cb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptCmdlets_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py index ca4d4f6970e1..b5a11df999bb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptExecutions_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py index 7b25ad242532..92faad8fcfdf 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptExecutions_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py index 68e307f66b0a..e6437970bf33 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptExecutions_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py index 7d7d00535882..b31d2f9e21f0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_GetExecutionLogs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptExecutions_GetExecutionLogs.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py index 61a5cdf77ed3..d45c5a90d593 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptExecutions_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py index 898bf4f8dddd..280129897535 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptPackages_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py index 198756373511..e44445665cbb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/ScriptPackages_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/skus_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/skus_list.py new file mode 100644 index 000000000000..16cf02319856 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/skus_list.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python skus_list.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 = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.skus.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/Skus_List.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py index 56266abe632b..7d2833d7c92a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/VirtualMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py index 08d7cd344450..99ff96e1c61a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/VirtualMachines_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py index aaeb9544c61c..211da4cd9ef4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_RestrictMovement.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/VirtualMachines_RestrictMovement.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py index 1329cabee91d..7b8b57568b7f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDhcp.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_CreateDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py index 5e9ea9710ced..889b647f8241 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsService.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_CreateDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py index 2b0e28c40cc1..0fa18796f0f2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsZone.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_CreateDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py index 8f032fb1a96f..08889136eb6b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreatePortMirroring.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_CreatePortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py index 12f1cdfb838f..6aeeeea8ba7e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_CreateSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py index dfc7aed2067d..ba91d83763cc 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDhcp.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeleteDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py index 3b007bd5571f..3dcb00abc685 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsService.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeleteDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py index fe98145ada67..487c7f62ba3f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsZone.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeleteDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py index c504ce7f8d0f..1eddaa2924a1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeletePortMirroring.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeletePortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ip.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ip.py index b99ce950c427..d1fc1b384edd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ip.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_public_ip.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeletePublicIP.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeletePublicIP.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py index 5578bf59996c..b5550d6c55bc 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteSegment.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeleteSegment.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py index 216f8ebcb96f..fdb52a5b982e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteVMGroup.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_DeleteVMGroup.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py index 48177a474863..5aed5c91eb0c 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py index df673054ecb6..71f2f6b7a65a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDhcp.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py index cba7f6ed653b..3dc8728f572f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsService.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py index 9173437be595..23f911fda24f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsZone.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py index 7befac3786b5..e2d6480f08f7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetGateway.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetGateway.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py index 8d4e9d845925..f477310bcc8e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPortMirroring.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetPortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ip.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ip.py index 9460b6d290e9..a910a551369d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ip.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_public_ip.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPublicIP.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetPublicIP.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py index 1a678b54b9b6..11b7d10233b9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetSegment.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetSegment.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py index 9b5939496103..5454528c4481 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVirtualMachine.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetVirtualMachine.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py index 1b02d3ca50ac..0306dc7fdf83 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVMGroup.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_GetVMGroup.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py index 9620699c2878..2142db92dc51 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py index 17984c5933fd..642b21158822 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDhcp.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py index a1155ee1a665..1e3bd764e22f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py index 280bdb5d8b80..c795d2d0e24d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py index b6bc87bd1370..816016eb98e5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListGateways.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListGateways.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py index d1c04d288da3..30c6f5bed4eb 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPortMirroring.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListPortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py index 3f26144035f0..5d28674c154a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPublicIPs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListPublicIPs.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py index 804114346eac..74a5d56aea6a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py index dd3e8d642260..70fd25d66828 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListVirtualMachines.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListVirtualMachines.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py index f5d3add18b30..f0b81d96e85f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_ListVMGroups.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py index 9edcca03483c..aa9fd1a14756 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDhcp.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_UpdateDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py index 0ac6735c7fa2..bebd8f576e53 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsService.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_UpdateDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py index e32c74fe62ec..977bf164110f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsZone.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_UpdateDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py index 819593eb27e5..6e313967d866 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdatePortMirroring.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_UpdatePortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py index 722357f2eaca..c62890a51c1e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -45,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2024-09-01/examples/WorkloadNetworks_UpdateSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/conftest.py b/sdk/compute/azure-mgmt-avs/generated_tests/conftest.py index 9d3be274e2e7..ae827003aa99 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/conftest.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): avs_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations.py index e5b6975affd2..2c571994c707 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_addons_list(self, resource_group): response = self.client.addons.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_addons_get(self, resource_group): response = self.client.addons.get( resource_group_name=resource_group.name, private_cloud_name="str", addon_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_addons_begin_create_or_update(self, resource_group): response = self.client.addons.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -64,7 +64,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,12 +72,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_addons_begin_delete(self, resource_group): response = self.client.addons.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", addon_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations_async.py index 46e6b4c41235..5cf81db33e07 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_addons_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_addons_list(self, resource_group): response = self.client.addons.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_addons_get(self, resource_group): response = await self.client.addons.get( resource_group_name=resource_group.name, private_cloud_name="str", addon_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_addons_begin_create_or_update(self, resource_group): response = await ( await self.client.addons.begin_create_or_update( resource_group_name=resource_group.name, @@ -66,7 +66,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -75,13 +75,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_addons_begin_delete(self, resource_group): response = await ( await self.client.addons.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", addon_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations.py index e11295a1d64f..bb5c1eb867d1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_authorizations_list(self, resource_group): response = self.client.authorizations.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_authorizations_get(self, resource_group): response = self.client.authorizations.get( resource_group_name=resource_group.name, private_cloud_name="str", authorization_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_authorizations_begin_create_or_update(self, resource_group): response = self.client.authorizations.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -67,7 +67,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,12 +75,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_authorizations_begin_delete(self, resource_group): response = self.client.authorizations.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", authorization_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations_async.py index fc516d542af2..21b7edbac176 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_authorizations_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_authorizations_list(self, resource_group): response = self.client.authorizations.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_authorizations_get(self, resource_group): response = await self.client.authorizations.get( resource_group_name=resource_group.name, private_cloud_name="str", authorization_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_authorizations_begin_create_or_update(self, resource_group): response = await ( await self.client.authorizations.begin_create_or_update( resource_group_name=resource_group.name, @@ -69,7 +69,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,13 +78,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_authorizations_begin_delete(self, resource_group): response = await ( await self.client.authorizations.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", authorization_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations.py index c5dcdaf9d65a..b2952e03cb96 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_cloud_links_list(self, resource_group): response = self.client.cloud_links.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_cloud_links_get(self, resource_group): response = self.client.cloud_links.get( resource_group_name=resource_group.name, private_cloud_name="str", cloud_link_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_cloud_links_begin_create_or_update(self, resource_group): response = self.client.cloud_links.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -66,7 +66,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,12 +74,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_cloud_links_begin_delete(self, resource_group): response = self.client.cloud_links.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cloud_link_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations_async.py index 07a1e40a46ec..3b9d73508c30 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_cloud_links_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_cloud_links_list(self, resource_group): response = self.client.cloud_links.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_cloud_links_get(self, resource_group): response = await self.client.cloud_links.get( resource_group_name=resource_group.name, private_cloud_name="str", cloud_link_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_cloud_links_begin_create_or_update(self, resource_group): response = await ( await self.client.cloud_links.begin_create_or_update( resource_group_name=resource_group.name, @@ -68,7 +68,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -77,13 +77,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_cloud_links_begin_delete(self, resource_group): response = await ( await self.client.cloud_links.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cloud_link_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations.py index abb93cb7c907..bee98b6b92a5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_clusters_list(self, resource_group): response = self.client.clusters.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_clusters_get(self, resource_group): response = self.client.clusters.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_clusters_begin_create_or_update(self, resource_group): response = self.client.clusters.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -69,7 +69,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "vsanDatastoreName": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,7 +77,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_clusters_begin_update(self, resource_group): response = self.client.clusters.begin_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -87,7 +87,7 @@ def test_begin_update(self, resource_group): "hosts": ["str"], "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,12 +95,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_clusters_begin_delete(self, resource_group): response = self.client.clusters.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -108,12 +108,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_zones(self, resource_group): + def test_clusters_list_zones(self, resource_group): response = self.client.clusters.list_zones( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations_async.py index 21fd286c7a90..caa95b44e2a9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_clusters_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_clusters_list(self, resource_group): response = self.client.clusters.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_clusters_get(self, resource_group): response = await self.client.clusters.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_clusters_begin_create_or_update(self, resource_group): response = await ( await self.client.clusters.begin_create_or_update( resource_group_name=resource_group.name, @@ -71,7 +71,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "vsanDatastoreName": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +80,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_clusters_begin_update(self, resource_group): response = await ( await self.client.clusters.begin_update( resource_group_name=resource_group.name, @@ -91,7 +91,7 @@ async def test_begin_update(self, resource_group): "hosts": ["str"], "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -100,13 +100,13 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_clusters_begin_delete(self, resource_group): response = await ( await self.client.clusters.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -115,12 +115,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_zones(self, resource_group): + async def test_clusters_list_zones(self, resource_group): response = await self.client.clusters.list_zones( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations.py index e811f1f2bcc8..70b0346f9db7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_datastores_list(self, resource_group): response = self.client.datastores.list( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,13 +33,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_datastores_get(self, resource_group): response = self.client.datastores.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", datastore_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -47,7 +47,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_datastores_begin_create_or_update(self, resource_group): response = self.client.datastores.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -60,6 +60,7 @@ def test_begin_create_or_update(self, resource_group): "name": "str", "netAppVolume": {"id": "str"}, "provisioningState": "str", + "pureStorageVolume": {"sizeGb": 0, "storagePoolId": "str"}, "status": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -71,7 +72,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -79,13 +80,13 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_datastores_begin_delete(self, resource_group): response = self.client.datastores.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", datastore_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations_async.py index 85cb7f920e26..9e7a42c8be99 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_datastores_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_datastores_list(self, resource_group): response = self.client.datastores.list( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_datastores_get(self, resource_group): response = await self.client.datastores.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", datastore_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -48,7 +48,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_datastores_begin_create_or_update(self, resource_group): response = await ( await self.client.datastores.begin_create_or_update( resource_group_name=resource_group.name, @@ -62,6 +62,7 @@ async def test_begin_create_or_update(self, resource_group): "name": "str", "netAppVolume": {"id": "str"}, "provisioningState": "str", + "pureStorageVolume": {"sizeGb": 0, "storagePoolId": "str"}, "status": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -73,7 +74,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -82,14 +83,14 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_datastores_begin_delete(self, resource_group): response = await ( await self.client.datastores.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", datastore_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations.py index 08e5554a3b3a..1cf888baa708 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_global_reach_connections_list(self, resource_group): response = self.client.global_reach_connections.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_global_reach_connections_get(self, resource_group): response = self.client.global_reach_connections.get( resource_group_name=resource_group.name, private_cloud_name="str", global_reach_connection_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_global_reach_connections_begin_create_or_update(self, resource_group): response = self.client.global_reach_connections.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -69,7 +69,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,12 +77,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_global_reach_connections_begin_delete(self, resource_group): response = self.client.global_reach_connections.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", global_reach_connection_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations_async.py index e0e3422e8afe..aa6c0078ce50 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_global_reach_connections_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_global_reach_connections_list(self, resource_group): response = self.client.global_reach_connections.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_global_reach_connections_get(self, resource_group): response = await self.client.global_reach_connections.get( resource_group_name=resource_group.name, private_cloud_name="str", global_reach_connection_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_global_reach_connections_begin_create_or_update(self, resource_group): response = await ( await self.client.global_reach_connections.begin_create_or_update( resource_group_name=resource_group.name, @@ -71,7 +71,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,13 +80,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_global_reach_connections_begin_delete(self, resource_group): response = await ( await self.client.global_reach_connections.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", global_reach_connection_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations.py index c48991ad98cf..e9a5ef9b6c09 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_hcx_enterprise_sites_list(self, resource_group): response = self.client.hcx_enterprise_sites.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_hcx_enterprise_sites_get(self, resource_group): response = self.client.hcx_enterprise_sites.get( resource_group_name=resource_group.name, private_cloud_name="str", hcx_enterprise_site_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_hcx_enterprise_sites_create_or_update(self, resource_group): response = self.client.hcx_enterprise_sites.create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -66,7 +66,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -74,12 +74,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_hcx_enterprise_sites_delete(self, resource_group): response = self.client.hcx_enterprise_sites.delete( resource_group_name=resource_group.name, private_cloud_name="str", hcx_enterprise_site_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations_async.py index f11099ebd687..593a77ac387b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hcx_enterprise_sites_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_hcx_enterprise_sites_list(self, resource_group): response = self.client.hcx_enterprise_sites.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_hcx_enterprise_sites_get(self, resource_group): response = await self.client.hcx_enterprise_sites.get( resource_group_name=resource_group.name, private_cloud_name="str", hcx_enterprise_site_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_hcx_enterprise_sites_create_or_update(self, resource_group): response = await self.client.hcx_enterprise_sites.create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -67,7 +67,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -75,12 +75,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_hcx_enterprise_sites_delete(self, resource_group): response = await self.client.hcx_enterprise_sites.delete( resource_group_name=resource_group.name, private_cloud_name="str", hcx_enterprise_site_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hosts_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hosts_operations.py new file mode 100644 index 000000000000..bc2c6ae79ffd --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hosts_operations.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSHostsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_hosts_list(self, resource_group): + response = self.client.hosts.list( + resource_group_name=resource_group.name, + private_cloud_name="str", + cluster_name="str", + api_version="2024-09-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_hosts_get(self, resource_group): + response = self.client.hosts.get( + resource_group_name=resource_group.name, + private_cloud_name="str", + cluster_name="str", + host_id="str", + api_version="2024-09-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hosts_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hosts_operations_async.py new file mode 100644 index 000000000000..23afd0cb08d6 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_hosts_operations_async.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs.aio import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSHostsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_hosts_list(self, resource_group): + response = self.client.hosts.list( + resource_group_name=resource_group.name, + private_cloud_name="str", + cluster_name="str", + api_version="2024-09-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_hosts_get(self, resource_group): + response = await self.client.hosts.get( + resource_group_name=resource_group.name, + private_cloud_name="str", + cluster_name="str", + host_id="str", + api_version="2024-09-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations.py index 8ba7604d1107..a052a51932bc 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_private_cloud(self, resource_group): + def test_iscsi_paths_list_by_private_cloud(self, resource_group): response = self.client.iscsi_paths.list_by_private_cloud( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,11 +32,11 @@ def test_list_by_private_cloud(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_iscsi_paths_get(self, resource_group): response = self.client.iscsi_paths.get( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -44,7 +44,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_iscsi_paths_begin_create_or_update(self, resource_group): response = self.client.iscsi_paths.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -63,7 +63,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,11 +71,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_iscsi_paths_begin_delete(self, resource_group): response = self.client.iscsi_paths.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations_async.py index a2ea9a9a6a8d..a6b3f9435785 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_iscsi_paths_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_private_cloud(self, resource_group): + async def test_iscsi_paths_list_by_private_cloud(self, resource_group): response = self.client.iscsi_paths.list_by_private_cloud( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,11 +33,11 @@ async def test_list_by_private_cloud(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_iscsi_paths_get(self, resource_group): response = await self.client.iscsi_paths.get( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_iscsi_paths_begin_create_or_update(self, resource_group): response = await ( await self.client.iscsi_paths.begin_create_or_update( resource_group_name=resource_group.name, @@ -65,7 +65,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -74,12 +74,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_iscsi_paths_begin_delete(self, resource_group): response = await ( await self.client.iscsi_paths.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations.py index 34b49f6f711a..469295dabb20 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_quota_availability(self, resource_group): + def test_locations_check_quota_availability(self, resource_group): response = self.client.locations.check_quota_availability( location="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -31,10 +31,10 @@ def test_check_quota_availability(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_trial_availability(self, resource_group): + def test_locations_check_trial_availability(self, resource_group): response = self.client.locations.check_trial_availability( location="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations_async.py index c5978573754f..52c1d45e8ec2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_locations_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_quota_availability(self, resource_group): + async def test_locations_check_quota_availability(self, resource_group): response = await self.client.locations.check_quota_availability( location="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -32,10 +32,10 @@ async def test_check_quota_availability(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_trial_availability(self, resource_group): + async def test_locations_check_trial_availability(self, resource_group): response = await self.client.locations.check_trial_availability( location="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations.py index 4a255732b138..8381b9382a8d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations_async.py index ec1b1e60f14f..3f6c55580794 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations.py index d316a9516eca..d66996fa8de7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_placement_policies_list(self, resource_group): response = self.client.placement_policies.list( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,13 +33,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_placement_policies_get(self, resource_group): response = self.client.placement_policies.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", placement_policy_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -47,7 +47,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_placement_policies_begin_create_or_update(self, resource_group): response = self.client.placement_policies.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -67,7 +67,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,7 +75,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_placement_policies_begin_update(self, resource_group): response = self.client.placement_policies.begin_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -88,7 +88,7 @@ def test_begin_update(self, resource_group): "state": "str", "vmMembers": ["str"], }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -96,13 +96,13 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_placement_policies_begin_delete(self, resource_group): response = self.client.placement_policies.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", placement_policy_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations_async.py index 6cdc9ae862e2..aab5740e33d7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_placement_policies_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_placement_policies_list(self, resource_group): response = self.client.placement_policies.list( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_placement_policies_get(self, resource_group): response = await self.client.placement_policies.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", placement_policy_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -48,7 +48,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_placement_policies_begin_create_or_update(self, resource_group): response = await ( await self.client.placement_policies.begin_create_or_update( resource_group_name=resource_group.name, @@ -69,7 +69,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +78,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_placement_policies_begin_update(self, resource_group): response = await ( await self.client.placement_policies.begin_update( resource_group_name=resource_group.name, @@ -92,7 +92,7 @@ async def test_begin_update(self, resource_group): "state": "str", "vmMembers": ["str"], }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -101,14 +101,14 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_placement_policies_begin_delete(self, resource_group): response = await ( await self.client.placement_policies.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", placement_policy_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations.py index 234645f75cc4..76306619ddf1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_in_subscription(self, resource_group): + def test_private_clouds_list_in_subscription(self, resource_group): response = self.client.private_clouds.list_in_subscription( - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_in_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_private_clouds_list(self, resource_group): response = self.client.private_clouds.list( resource_group_name=resource_group.name, - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_private_clouds_get(self, resource_group): response = self.client.private_clouds.get( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_private_clouds_begin_create_or_update(self, resource_group): response = self.client.private_clouds.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -141,8 +141,9 @@ def test_begin_create_or_update(self, resource_group): "vcenterPassword": "str", "virtualNetworkId": "str", "vmotionNetwork": "str", + "zones": ["str"], }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -150,7 +151,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_private_clouds_begin_update(self, resource_group): response = self.client.private_clouds.begin_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -195,7 +196,7 @@ def test_begin_update(self, resource_group): "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "tags": {"str": "str"}, }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -203,11 +204,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_private_clouds_begin_delete(self, resource_group): response = self.client.private_clouds.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -215,11 +216,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_admin_credentials(self, resource_group): + def test_private_clouds_list_admin_credentials(self, resource_group): response = self.client.private_clouds.list_admin_credentials( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -227,11 +228,11 @@ def test_list_admin_credentials(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_rotate_nsxt_password(self, resource_group): + def test_private_clouds_begin_rotate_nsxt_password(self, resource_group): response = self.client.private_clouds.begin_rotate_nsxt_password( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -239,11 +240,11 @@ def test_begin_rotate_nsxt_password(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_rotate_vcenter_password(self, resource_group): + def test_private_clouds_begin_rotate_vcenter_password(self, resource_group): response = self.client.private_clouds.begin_rotate_vcenter_password( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations_async.py index 655497162b44..fcd6cd8f8a13 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_private_clouds_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_in_subscription(self, resource_group): + async def test_private_clouds_list_in_subscription(self, resource_group): response = self.client.private_clouds.list_in_subscription( - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_in_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_private_clouds_list(self, resource_group): response = self.client.private_clouds.list( resource_group_name=resource_group.name, - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_private_clouds_get(self, resource_group): response = await self.client.private_clouds.get( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_private_clouds_begin_create_or_update(self, resource_group): response = await ( await self.client.private_clouds.begin_create_or_update( resource_group_name=resource_group.name, @@ -143,8 +143,9 @@ async def test_begin_create_or_update(self, resource_group): "vcenterPassword": "str", "virtualNetworkId": "str", "vmotionNetwork": "str", + "zones": ["str"], }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -153,7 +154,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_private_clouds_begin_update(self, resource_group): response = await ( await self.client.private_clouds.begin_update( resource_group_name=resource_group.name, @@ -199,7 +200,7 @@ async def test_begin_update(self, resource_group): "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "tags": {"str": "str"}, }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -208,12 +209,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_private_clouds_begin_delete(self, resource_group): response = await ( await self.client.private_clouds.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -222,11 +223,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_admin_credentials(self, resource_group): + async def test_private_clouds_list_admin_credentials(self, resource_group): response = await self.client.private_clouds.list_admin_credentials( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -234,12 +235,12 @@ async def test_list_admin_credentials(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_rotate_nsxt_password(self, resource_group): + async def test_private_clouds_begin_rotate_nsxt_password(self, resource_group): response = await ( await self.client.private_clouds.begin_rotate_nsxt_password( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -248,12 +249,12 @@ async def test_begin_rotate_nsxt_password(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_rotate_vcenter_password(self, resource_group): + async def test_private_clouds_begin_rotate_vcenter_password(self, resource_group): response = await ( await self.client.private_clouds.begin_rotate_vcenter_password( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_provisioned_networks_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_provisioned_networks_operations.py new file mode 100644 index 000000000000..6b290d3e735f --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_provisioned_networks_operations.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSProvisionedNetworksOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provisioned_networks_list(self, resource_group): + response = self.client.provisioned_networks.list( + resource_group_name=resource_group.name, + private_cloud_name="str", + api_version="2024-09-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provisioned_networks_get(self, resource_group): + response = self.client.provisioned_networks.get( + resource_group_name=resource_group.name, + private_cloud_name="str", + provisioned_network_name="str", + api_version="2024-09-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_provisioned_networks_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_provisioned_networks_operations_async.py new file mode 100644 index 000000000000..969c6052924f --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_provisioned_networks_operations_async.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs.aio import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSProvisionedNetworksOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provisioned_networks_list(self, resource_group): + response = self.client.provisioned_networks.list( + resource_group_name=resource_group.name, + private_cloud_name="str", + api_version="2024-09-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provisioned_networks_get(self, resource_group): + response = await self.client.provisioned_networks.get( + resource_group_name=resource_group.name, + private_cloud_name="str", + provisioned_network_name="str", + api_version="2024-09-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_pure_storage_policies_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_pure_storage_policies_operations.py new file mode 100644 index 000000000000..7ab2ef910d60 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_pure_storage_policies_operations.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSPureStoragePoliciesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pure_storage_policies_list(self, resource_group): + response = self.client.pure_storage_policies.list( + resource_group_name=resource_group.name, + private_cloud_name="str", + api_version="2024-09-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pure_storage_policies_get(self, resource_group): + response = self.client.pure_storage_policies.get( + resource_group_name=resource_group.name, + private_cloud_name="str", + storage_policy_name="str", + api_version="2024-09-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pure_storage_policies_begin_create_or_update(self, resource_group): + response = self.client.pure_storage_policies.begin_create_or_update( + resource_group_name=resource_group.name, + private_cloud_name="str", + storage_policy_name="str", + resource={ + "id": "str", + "name": "str", + "provisioningState": "str", + "storagePolicyDefinition": "str", + "storagePoolId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-09-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pure_storage_policies_begin_delete(self, resource_group): + response = self.client.pure_storage_policies.begin_delete( + resource_group_name=resource_group.name, + private_cloud_name="str", + storage_policy_name="str", + api_version="2024-09-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_pure_storage_policies_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_pure_storage_policies_operations_async.py new file mode 100644 index 000000000000..6ecee0bae06b --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_pure_storage_policies_operations_async.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs.aio import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSPureStoragePoliciesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pure_storage_policies_list(self, resource_group): + response = self.client.pure_storage_policies.list( + resource_group_name=resource_group.name, + private_cloud_name="str", + api_version="2024-09-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pure_storage_policies_get(self, resource_group): + response = await self.client.pure_storage_policies.get( + resource_group_name=resource_group.name, + private_cloud_name="str", + storage_policy_name="str", + api_version="2024-09-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pure_storage_policies_begin_create_or_update(self, resource_group): + response = await ( + await self.client.pure_storage_policies.begin_create_or_update( + resource_group_name=resource_group.name, + private_cloud_name="str", + storage_policy_name="str", + resource={ + "id": "str", + "name": "str", + "provisioningState": "str", + "storagePolicyDefinition": "str", + "storagePoolId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-09-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_pure_storage_policies_begin_delete(self, resource_group): + response = await ( + await self.client.pure_storage_policies.begin_delete( + resource_group_name=resource_group.name, + private_cloud_name="str", + storage_policy_name="str", + api_version="2024-09-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations.py index 44df9f1bb13c..26d421d91800 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_script_cmdlets_list(self, resource_group): response = self.client.script_cmdlets.list( resource_group_name=resource_group.name, private_cloud_name="str", script_package_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,13 +33,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_script_cmdlets_get(self, resource_group): response = self.client.script_cmdlets.get( resource_group_name=resource_group.name, private_cloud_name="str", script_package_name="str", script_cmdlet_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations_async.py index f7255ac660e6..ecd0b40c3697 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_cmdlets_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_script_cmdlets_list(self, resource_group): response = self.client.script_cmdlets.list( resource_group_name=resource_group.name, private_cloud_name="str", script_package_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_script_cmdlets_get(self, resource_group): response = await self.client.script_cmdlets.get( resource_group_name=resource_group.name, private_cloud_name="str", script_package_name="str", script_cmdlet_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations.py index 0c54d3aa2ad6..07f161f55990 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_script_executions_list(self, resource_group): response = self.client.script_executions.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_script_executions_get(self, resource_group): response = self.client.script_executions.get( resource_group_name=resource_group.name, private_cloud_name="str", script_execution_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_script_executions_begin_create_or_update(self, resource_group): response = self.client.script_executions.begin_create_or_update( resource_group_name=resource_group.name, private_cloud_name="str", @@ -78,7 +78,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "warnings": ["str"], }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,12 +86,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_script_executions_begin_delete(self, resource_group): response = self.client.script_executions.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", script_execution_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,12 +99,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_execution_logs(self, resource_group): + def test_script_executions_get_execution_logs(self, resource_group): response = self.client.script_executions.get_execution_logs( resource_group_name=resource_group.name, private_cloud_name="str", script_execution_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations_async.py index a9f2eda194ad..8a10d0eac1ef 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_executions_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_script_executions_list(self, resource_group): response = self.client.script_executions.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_script_executions_get(self, resource_group): response = await self.client.script_executions.get( resource_group_name=resource_group.name, private_cloud_name="str", script_execution_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_script_executions_begin_create_or_update(self, resource_group): response = await ( await self.client.script_executions.begin_create_or_update( resource_group_name=resource_group.name, @@ -80,7 +80,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "warnings": ["str"], }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -89,13 +89,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_script_executions_begin_delete(self, resource_group): response = await ( await self.client.script_executions.begin_delete( resource_group_name=resource_group.name, private_cloud_name="str", script_execution_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -104,12 +104,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_execution_logs(self, resource_group): + async def test_script_executions_get_execution_logs(self, resource_group): response = await self.client.script_executions.get_execution_logs( resource_group_name=resource_group.name, private_cloud_name="str", script_execution_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations.py index 1bc37cf6770d..a44565f54a12 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_script_packages_list(self, resource_group): response = self.client.script_packages.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_script_packages_get(self, resource_group): response = self.client.script_packages.get( resource_group_name=resource_group.name, private_cloud_name="str", script_package_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations_async.py index 03ae907cde10..64b11f9ef6a6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_script_packages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_script_packages_list(self, resource_group): response = self.client.script_packages.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_script_packages_get(self, resource_group): response = await self.client.script_packages.get( resource_group_name=resource_group.name, private_cloud_name="str", script_package_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_skus_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_skus_operations.py new file mode 100644 index 000000000000..a5d78c49774d --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_skus_operations.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSSkusOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_skus_list(self, resource_group): + response = self.client.skus.list( + api_version="2024-09-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_skus_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_skus_operations_async.py new file mode 100644 index 000000000000..d18ea807c761 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_skus_operations_async.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.avs.aio import AVSClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAVSSkusOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AVSClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_skus_list(self, resource_group): + response = self.client.skus.list( + api_version="2024-09-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations.py index d556cdd8044c..f0e6dcb1c669 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_virtual_machines_list(self, resource_group): response = self.client.virtual_machines.list( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,13 +33,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_virtual_machines_get(self, resource_group): response = self.client.virtual_machines.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", virtual_machine_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -47,14 +47,14 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_restrict_movement(self, resource_group): + def test_virtual_machines_begin_restrict_movement(self, resource_group): response = self.client.virtual_machines.begin_restrict_movement( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", virtual_machine_id="str", restrict_movement={"restrictMovement": "str"}, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations_async.py index 9fe1a8a291d7..733eea91735b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_virtual_machines_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_virtual_machines_list(self, resource_group): response = self.client.virtual_machines.list( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_virtual_machines_get(self, resource_group): response = await self.client.virtual_machines.get( resource_group_name=resource_group.name, private_cloud_name="str", cluster_name="str", virtual_machine_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -48,7 +48,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_restrict_movement(self, resource_group): + async def test_virtual_machines_begin_restrict_movement(self, resource_group): response = await ( await self.client.virtual_machines.begin_restrict_movement( resource_group_name=resource_group.name, @@ -56,7 +56,7 @@ async def test_begin_restrict_movement(self, resource_group): cluster_name="str", virtual_machine_id="str", restrict_movement={"restrictMovement": "str"}, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations.py index f9c888f7152f..d124a2b446f4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_workload_networks_list(self, resource_group): response = self.client.workload_networks.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,11 +32,11 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_workload_networks_get(self, resource_group): response = self.client.workload_networks.get( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -44,11 +44,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_dhcp(self, resource_group): + def test_workload_networks_list_dhcp(self, resource_group): response = self.client.workload_networks.list_dhcp( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,12 +56,12 @@ def test_list_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_dhcp(self, resource_group): + def test_workload_networks_get_dhcp(self, resource_group): response = self.client.workload_networks.get_dhcp( resource_group_name=resource_group.name, dhcp_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_get_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_dhcp(self, resource_group): + def test_workload_networks_begin_create_dhcp(self, resource_group): response = self.client.workload_networks.begin_create_dhcp( resource_group_name=resource_group.name, private_cloud_name="str", @@ -88,7 +88,7 @@ def test_begin_create_dhcp(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -96,7 +96,7 @@ def test_begin_create_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_dhcp(self, resource_group): + def test_workload_networks_begin_update_dhcp(self, resource_group): response = self.client.workload_networks.begin_update_dhcp( resource_group_name=resource_group.name, private_cloud_name="str", @@ -115,7 +115,7 @@ def test_begin_update_dhcp(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -123,12 +123,12 @@ def test_begin_update_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_dhcp(self, resource_group): + def test_workload_networks_begin_delete_dhcp(self, resource_group): response = self.client.workload_networks.begin_delete_dhcp( resource_group_name=resource_group.name, private_cloud_name="str", dhcp_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -136,11 +136,11 @@ def test_begin_delete_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_dns_services(self, resource_group): + def test_workload_networks_list_dns_services(self, resource_group): response = self.client.workload_networks.list_dns_services( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -148,12 +148,12 @@ def test_list_dns_services(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_dns_service(self, resource_group): + def test_workload_networks_get_dns_service(self, resource_group): response = self.client.workload_networks.get_dns_service( resource_group_name=resource_group.name, private_cloud_name="str", dns_service_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -161,7 +161,7 @@ def test_get_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_dns_service(self, resource_group): + def test_workload_networks_begin_create_dns_service(self, resource_group): response = self.client.workload_networks.begin_create_dns_service( resource_group_name=resource_group.name, private_cloud_name="str", @@ -187,7 +187,7 @@ def test_begin_create_dns_service(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -195,7 +195,7 @@ def test_begin_create_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_dns_service(self, resource_group): + def test_workload_networks_begin_update_dns_service(self, resource_group): response = self.client.workload_networks.begin_update_dns_service( resource_group_name=resource_group.name, private_cloud_name="str", @@ -221,7 +221,7 @@ def test_begin_update_dns_service(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -229,12 +229,12 @@ def test_begin_update_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_dns_service(self, resource_group): + def test_workload_networks_begin_delete_dns_service(self, resource_group): response = self.client.workload_networks.begin_delete_dns_service( resource_group_name=resource_group.name, dns_service_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -242,11 +242,11 @@ def test_begin_delete_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_dns_zones(self, resource_group): + def test_workload_networks_list_dns_zones(self, resource_group): response = self.client.workload_networks.list_dns_zones( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -254,12 +254,12 @@ def test_list_dns_zones(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_dns_zone(self, resource_group): + def test_workload_networks_get_dns_zone(self, resource_group): response = self.client.workload_networks.get_dns_zone( resource_group_name=resource_group.name, private_cloud_name="str", dns_zone_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -267,7 +267,7 @@ def test_get_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_dns_zone(self, resource_group): + def test_workload_networks_begin_create_dns_zone(self, resource_group): response = self.client.workload_networks.begin_create_dns_zone( resource_group_name=resource_group.name, private_cloud_name="str", @@ -292,7 +292,7 @@ def test_begin_create_dns_zone(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -300,7 +300,7 @@ def test_begin_create_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_dns_zone(self, resource_group): + def test_workload_networks_begin_update_dns_zone(self, resource_group): response = self.client.workload_networks.begin_update_dns_zone( resource_group_name=resource_group.name, private_cloud_name="str", @@ -325,7 +325,7 @@ def test_begin_update_dns_zone(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -333,12 +333,12 @@ def test_begin_update_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_dns_zone(self, resource_group): + def test_workload_networks_begin_delete_dns_zone(self, resource_group): response = self.client.workload_networks.begin_delete_dns_zone( resource_group_name=resource_group.name, dns_zone_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -346,11 +346,11 @@ def test_begin_delete_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_gateways(self, resource_group): + def test_workload_networks_list_gateways(self, resource_group): response = self.client.workload_networks.list_gateways( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -358,12 +358,12 @@ def test_list_gateways(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_gateway(self, resource_group): + def test_workload_networks_get_gateway(self, resource_group): response = self.client.workload_networks.get_gateway( resource_group_name=resource_group.name, private_cloud_name="str", gateway_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -371,11 +371,11 @@ def test_get_gateway(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_port_mirroring(self, resource_group): + def test_workload_networks_list_port_mirroring(self, resource_group): response = self.client.workload_networks.list_port_mirroring( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -383,12 +383,12 @@ def test_list_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_port_mirroring(self, resource_group): + def test_workload_networks_get_port_mirroring(self, resource_group): response = self.client.workload_networks.get_port_mirroring( resource_group_name=resource_group.name, private_cloud_name="str", port_mirroring_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -396,7 +396,7 @@ def test_get_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_port_mirroring(self, resource_group): + def test_workload_networks_begin_create_port_mirroring(self, resource_group): response = self.client.workload_networks.begin_create_port_mirroring( resource_group_name=resource_group.name, private_cloud_name="str", @@ -421,7 +421,7 @@ def test_begin_create_port_mirroring(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -429,7 +429,7 @@ def test_begin_create_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_port_mirroring(self, resource_group): + def test_workload_networks_begin_update_port_mirroring(self, resource_group): response = self.client.workload_networks.begin_update_port_mirroring( resource_group_name=resource_group.name, private_cloud_name="str", @@ -454,7 +454,7 @@ def test_begin_update_port_mirroring(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -462,12 +462,12 @@ def test_begin_update_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_port_mirroring(self, resource_group): + def test_workload_networks_begin_delete_port_mirroring(self, resource_group): response = self.client.workload_networks.begin_delete_port_mirroring( resource_group_name=resource_group.name, port_mirroring_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -475,11 +475,11 @@ def test_begin_delete_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_public_ips(self, resource_group): + def test_workload_networks_list_public_ips(self, resource_group): response = self.client.workload_networks.list_public_ips( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -487,12 +487,12 @@ def test_list_public_ips(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_public_ip(self, resource_group): + def test_workload_networks_get_public_ip(self, resource_group): response = self.client.workload_networks.get_public_ip( resource_group_name=resource_group.name, private_cloud_name="str", public_ip_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -500,7 +500,7 @@ def test_get_public_ip(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_public_ip(self, resource_group): + def test_workload_networks_begin_create_public_ip(self, resource_group): response = self.client.workload_networks.begin_create_public_ip( resource_group_name=resource_group.name, private_cloud_name="str", @@ -522,7 +522,7 @@ def test_begin_create_public_ip(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -530,12 +530,12 @@ def test_begin_create_public_ip(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_public_ip(self, resource_group): + def test_workload_networks_begin_delete_public_ip(self, resource_group): response = self.client.workload_networks.begin_delete_public_ip( resource_group_name=resource_group.name, public_ip_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -543,11 +543,11 @@ def test_begin_delete_public_ip(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_segments(self, resource_group): + def test_workload_networks_list_segments(self, resource_group): response = self.client.workload_networks.list_segments( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -555,12 +555,12 @@ def test_list_segments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_segment(self, resource_group): + def test_workload_networks_get_segment(self, resource_group): response = self.client.workload_networks.get_segment( resource_group_name=resource_group.name, private_cloud_name="str", segment_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -568,7 +568,7 @@ def test_get_segment(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_segments(self, resource_group): + def test_workload_networks_begin_create_segments(self, resource_group): response = self.client.workload_networks.begin_create_segments( resource_group_name=resource_group.name, private_cloud_name="str", @@ -593,7 +593,7 @@ def test_begin_create_segments(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -601,7 +601,7 @@ def test_begin_create_segments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_segments(self, resource_group): + def test_workload_networks_begin_update_segments(self, resource_group): response = self.client.workload_networks.begin_update_segments( resource_group_name=resource_group.name, private_cloud_name="str", @@ -626,7 +626,7 @@ def test_begin_update_segments(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -634,12 +634,12 @@ def test_begin_update_segments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_segment(self, resource_group): + def test_workload_networks_begin_delete_segment(self, resource_group): response = self.client.workload_networks.begin_delete_segment( resource_group_name=resource_group.name, private_cloud_name="str", segment_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -647,11 +647,11 @@ def test_begin_delete_segment(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_virtual_machines(self, resource_group): + def test_workload_networks_list_virtual_machines(self, resource_group): response = self.client.workload_networks.list_virtual_machines( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -659,12 +659,12 @@ def test_list_virtual_machines(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_virtual_machine(self, resource_group): + def test_workload_networks_get_virtual_machine(self, resource_group): response = self.client.workload_networks.get_virtual_machine( resource_group_name=resource_group.name, private_cloud_name="str", virtual_machine_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -672,11 +672,11 @@ def test_get_virtual_machine(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_vm_groups(self, resource_group): + def test_workload_networks_list_vm_groups(self, resource_group): response = self.client.workload_networks.list_vm_groups( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -684,12 +684,12 @@ def test_list_vm_groups(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_vm_group(self, resource_group): + def test_workload_networks_get_vm_group(self, resource_group): response = self.client.workload_networks.get_vm_group( resource_group_name=resource_group.name, private_cloud_name="str", vm_group_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -697,7 +697,7 @@ def test_get_vm_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_vm_group(self, resource_group): + def test_workload_networks_begin_create_vm_group(self, resource_group): response = self.client.workload_networks.begin_create_vm_group( resource_group_name=resource_group.name, private_cloud_name="str", @@ -720,7 +720,7 @@ def test_begin_create_vm_group(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -728,7 +728,7 @@ def test_begin_create_vm_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_vm_group(self, resource_group): + def test_workload_networks_begin_update_vm_group(self, resource_group): response = self.client.workload_networks.begin_update_vm_group( resource_group_name=resource_group.name, private_cloud_name="str", @@ -751,7 +751,7 @@ def test_begin_update_vm_group(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -759,12 +759,12 @@ def test_begin_update_vm_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_vm_group(self, resource_group): + def test_workload_networks_begin_delete_vm_group(self, resource_group): response = self.client.workload_networks.begin_delete_vm_group( resource_group_name=resource_group.name, vm_group_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations_async.py b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations_async.py index 8674dfe08d9c..52ec47963564 100644 --- a/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations_async.py +++ b/sdk/compute/azure-mgmt-avs/generated_tests/test_avs_workload_networks_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_workload_networks_list(self, resource_group): response = self.client.workload_networks.list( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,11 +33,11 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_workload_networks_get(self, resource_group): response = await self.client.workload_networks.get( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -45,11 +45,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_dhcp(self, resource_group): + async def test_workload_networks_list_dhcp(self, resource_group): response = self.client.workload_networks.list_dhcp( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -57,12 +57,12 @@ async def test_list_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_dhcp(self, resource_group): + async def test_workload_networks_get_dhcp(self, resource_group): response = await self.client.workload_networks.get_dhcp( resource_group_name=resource_group.name, dhcp_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_get_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_dhcp(self, resource_group): + async def test_workload_networks_begin_create_dhcp(self, resource_group): response = await ( await self.client.workload_networks.begin_create_dhcp( resource_group_name=resource_group.name, @@ -90,7 +90,7 @@ async def test_begin_create_dhcp(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -99,7 +99,7 @@ async def test_begin_create_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_dhcp(self, resource_group): + async def test_workload_networks_begin_update_dhcp(self, resource_group): response = await ( await self.client.workload_networks.begin_update_dhcp( resource_group_name=resource_group.name, @@ -119,7 +119,7 @@ async def test_begin_update_dhcp(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -128,13 +128,13 @@ async def test_begin_update_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_dhcp(self, resource_group): + async def test_workload_networks_begin_delete_dhcp(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_dhcp( resource_group_name=resource_group.name, private_cloud_name="str", dhcp_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -143,11 +143,11 @@ async def test_begin_delete_dhcp(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_dns_services(self, resource_group): + async def test_workload_networks_list_dns_services(self, resource_group): response = self.client.workload_networks.list_dns_services( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -155,12 +155,12 @@ async def test_list_dns_services(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_dns_service(self, resource_group): + async def test_workload_networks_get_dns_service(self, resource_group): response = await self.client.workload_networks.get_dns_service( resource_group_name=resource_group.name, private_cloud_name="str", dns_service_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -168,7 +168,7 @@ async def test_get_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_dns_service(self, resource_group): + async def test_workload_networks_begin_create_dns_service(self, resource_group): response = await ( await self.client.workload_networks.begin_create_dns_service( resource_group_name=resource_group.name, @@ -195,7 +195,7 @@ async def test_begin_create_dns_service(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -204,7 +204,7 @@ async def test_begin_create_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_dns_service(self, resource_group): + async def test_workload_networks_begin_update_dns_service(self, resource_group): response = await ( await self.client.workload_networks.begin_update_dns_service( resource_group_name=resource_group.name, @@ -231,7 +231,7 @@ async def test_begin_update_dns_service(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -240,13 +240,13 @@ async def test_begin_update_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_dns_service(self, resource_group): + async def test_workload_networks_begin_delete_dns_service(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_dns_service( resource_group_name=resource_group.name, dns_service_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -255,11 +255,11 @@ async def test_begin_delete_dns_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_dns_zones(self, resource_group): + async def test_workload_networks_list_dns_zones(self, resource_group): response = self.client.workload_networks.list_dns_zones( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -267,12 +267,12 @@ async def test_list_dns_zones(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_dns_zone(self, resource_group): + async def test_workload_networks_get_dns_zone(self, resource_group): response = await self.client.workload_networks.get_dns_zone( resource_group_name=resource_group.name, private_cloud_name="str", dns_zone_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -280,7 +280,7 @@ async def test_get_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_dns_zone(self, resource_group): + async def test_workload_networks_begin_create_dns_zone(self, resource_group): response = await ( await self.client.workload_networks.begin_create_dns_zone( resource_group_name=resource_group.name, @@ -306,7 +306,7 @@ async def test_begin_create_dns_zone(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -315,7 +315,7 @@ async def test_begin_create_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_dns_zone(self, resource_group): + async def test_workload_networks_begin_update_dns_zone(self, resource_group): response = await ( await self.client.workload_networks.begin_update_dns_zone( resource_group_name=resource_group.name, @@ -341,7 +341,7 @@ async def test_begin_update_dns_zone(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -350,13 +350,13 @@ async def test_begin_update_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_dns_zone(self, resource_group): + async def test_workload_networks_begin_delete_dns_zone(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_dns_zone( resource_group_name=resource_group.name, dns_zone_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -365,11 +365,11 @@ async def test_begin_delete_dns_zone(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_gateways(self, resource_group): + async def test_workload_networks_list_gateways(self, resource_group): response = self.client.workload_networks.list_gateways( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -377,12 +377,12 @@ async def test_list_gateways(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_gateway(self, resource_group): + async def test_workload_networks_get_gateway(self, resource_group): response = await self.client.workload_networks.get_gateway( resource_group_name=resource_group.name, private_cloud_name="str", gateway_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -390,11 +390,11 @@ async def test_get_gateway(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_port_mirroring(self, resource_group): + async def test_workload_networks_list_port_mirroring(self, resource_group): response = self.client.workload_networks.list_port_mirroring( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -402,12 +402,12 @@ async def test_list_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_port_mirroring(self, resource_group): + async def test_workload_networks_get_port_mirroring(self, resource_group): response = await self.client.workload_networks.get_port_mirroring( resource_group_name=resource_group.name, private_cloud_name="str", port_mirroring_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -415,7 +415,7 @@ async def test_get_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_port_mirroring(self, resource_group): + async def test_workload_networks_begin_create_port_mirroring(self, resource_group): response = await ( await self.client.workload_networks.begin_create_port_mirroring( resource_group_name=resource_group.name, @@ -441,7 +441,7 @@ async def test_begin_create_port_mirroring(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -450,7 +450,7 @@ async def test_begin_create_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_port_mirroring(self, resource_group): + async def test_workload_networks_begin_update_port_mirroring(self, resource_group): response = await ( await self.client.workload_networks.begin_update_port_mirroring( resource_group_name=resource_group.name, @@ -476,7 +476,7 @@ async def test_begin_update_port_mirroring(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -485,13 +485,13 @@ async def test_begin_update_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_port_mirroring(self, resource_group): + async def test_workload_networks_begin_delete_port_mirroring(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_port_mirroring( resource_group_name=resource_group.name, port_mirroring_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -500,11 +500,11 @@ async def test_begin_delete_port_mirroring(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_public_ips(self, resource_group): + async def test_workload_networks_list_public_ips(self, resource_group): response = self.client.workload_networks.list_public_ips( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -512,12 +512,12 @@ async def test_list_public_ips(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_public_ip(self, resource_group): + async def test_workload_networks_get_public_ip(self, resource_group): response = await self.client.workload_networks.get_public_ip( resource_group_name=resource_group.name, private_cloud_name="str", public_ip_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -525,7 +525,7 @@ async def test_get_public_ip(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_public_ip(self, resource_group): + async def test_workload_networks_begin_create_public_ip(self, resource_group): response = await ( await self.client.workload_networks.begin_create_public_ip( resource_group_name=resource_group.name, @@ -548,7 +548,7 @@ async def test_begin_create_public_ip(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -557,13 +557,13 @@ async def test_begin_create_public_ip(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_public_ip(self, resource_group): + async def test_workload_networks_begin_delete_public_ip(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_public_ip( resource_group_name=resource_group.name, public_ip_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -572,11 +572,11 @@ async def test_begin_delete_public_ip(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_segments(self, resource_group): + async def test_workload_networks_list_segments(self, resource_group): response = self.client.workload_networks.list_segments( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -584,12 +584,12 @@ async def test_list_segments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_segment(self, resource_group): + async def test_workload_networks_get_segment(self, resource_group): response = await self.client.workload_networks.get_segment( resource_group_name=resource_group.name, private_cloud_name="str", segment_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -597,7 +597,7 @@ async def test_get_segment(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_segments(self, resource_group): + async def test_workload_networks_begin_create_segments(self, resource_group): response = await ( await self.client.workload_networks.begin_create_segments( resource_group_name=resource_group.name, @@ -623,7 +623,7 @@ async def test_begin_create_segments(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -632,7 +632,7 @@ async def test_begin_create_segments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_segments(self, resource_group): + async def test_workload_networks_begin_update_segments(self, resource_group): response = await ( await self.client.workload_networks.begin_update_segments( resource_group_name=resource_group.name, @@ -658,7 +658,7 @@ async def test_begin_update_segments(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -667,13 +667,13 @@ async def test_begin_update_segments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_segment(self, resource_group): + async def test_workload_networks_begin_delete_segment(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_segment( resource_group_name=resource_group.name, private_cloud_name="str", segment_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -682,11 +682,11 @@ async def test_begin_delete_segment(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_virtual_machines(self, resource_group): + async def test_workload_networks_list_virtual_machines(self, resource_group): response = self.client.workload_networks.list_virtual_machines( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -694,12 +694,12 @@ async def test_list_virtual_machines(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_virtual_machine(self, resource_group): + async def test_workload_networks_get_virtual_machine(self, resource_group): response = await self.client.workload_networks.get_virtual_machine( resource_group_name=resource_group.name, private_cloud_name="str", virtual_machine_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -707,11 +707,11 @@ async def test_get_virtual_machine(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_vm_groups(self, resource_group): + async def test_workload_networks_list_vm_groups(self, resource_group): response = self.client.workload_networks.list_vm_groups( resource_group_name=resource_group.name, private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -719,12 +719,12 @@ async def test_list_vm_groups(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_vm_group(self, resource_group): + async def test_workload_networks_get_vm_group(self, resource_group): response = await self.client.workload_networks.get_vm_group( resource_group_name=resource_group.name, private_cloud_name="str", vm_group_id="str", - api_version="2023-09-01", + api_version="2024-09-01", ) # please add some check logic here by yourself @@ -732,7 +732,7 @@ async def test_get_vm_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_vm_group(self, resource_group): + async def test_workload_networks_begin_create_vm_group(self, resource_group): response = await ( await self.client.workload_networks.begin_create_vm_group( resource_group_name=resource_group.name, @@ -756,7 +756,7 @@ async def test_begin_create_vm_group(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -765,7 +765,7 @@ async def test_begin_create_vm_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_vm_group(self, resource_group): + async def test_workload_networks_begin_update_vm_group(self, resource_group): response = await ( await self.client.workload_networks.begin_update_vm_group( resource_group_name=resource_group.name, @@ -789,7 +789,7 @@ async def test_begin_update_vm_group(self, resource_group): }, "type": "str", }, - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result @@ -798,13 +798,13 @@ async def test_begin_update_vm_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_vm_group(self, resource_group): + async def test_workload_networks_begin_delete_vm_group(self, resource_group): response = await ( await self.client.workload_networks.begin_delete_vm_group( resource_group_name=resource_group.name, vm_group_id="str", private_cloud_name="str", - api_version="2023-09-01", + api_version="2024-09-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/compute/azure-mgmt-avs/setup.py b/sdk/compute/azure-mgmt-avs/setup.py index d116439747c0..e2843ed679ab 100644 --- a/sdk/compute/azure-mgmt-avs/setup.py +++ b/sdk/compute/azure-mgmt-avs/setup.py @@ -53,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -77,7 +76,7 @@ "isodate>=0.6.1", "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", )