From 762a7994f37e88d2598a95b9cece14ed43e693c0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 23 Jan 2025 01:54:37 +0000 Subject: [PATCH] CodeGen from PR 32288 in Azure/azure-rest-api-specs Merge 98c897265013f5f0df5a48a0098d79ebc2c9e5c3 into 508a12f060dc46c5dcfabd0cd98a913b44b24e47 --- .../azure-mgmt-standbypool/_meta.json | 4 +- .../azure/mgmt/standbypool/__init__.py | 12 +- .../azure/mgmt/standbypool/_client.py | 5 +- .../azure/mgmt/standbypool/_configuration.py | 7 +- .../azure/mgmt/standbypool/_model_base.py | 39 +- .../azure/mgmt/standbypool/_serialization.py | 93 +--- .../azure/mgmt/standbypool/_version.py | 2 +- .../azure/mgmt/standbypool/aio/__init__.py | 12 +- .../azure/mgmt/standbypool/aio/_client.py | 5 +- .../mgmt/standbypool/aio/_configuration.py | 7 +- .../standbypool/aio/operations/__init__.py | 22 +- .../standbypool/aio/operations/_operations.py | 383 +++++++---------- .../azure/mgmt/standbypool/models/__init__.py | 93 ++-- .../azure/mgmt/standbypool/models/_models.py | 284 ++++++++---- .../mgmt/standbypool/operations/__init__.py | 22 +- .../standbypool/operations/_operations.py | 406 +++++++----------- .../generated_samples/operations_list.py | 2 +- ..._container_group_pool_runtime_views_get.py | 2 +- ...pool_runtime_views_list_by_standby_pool.py | 2 +- ..._container_group_pools_create_or_update.py | 7 +- .../standby_container_group_pools_delete.py | 2 +- .../standby_container_group_pools_get.py | 2 +- ...iner_group_pools_list_by_resource_group.py | 2 +- ...tainer_group_pools_list_by_subscription.py | 2 +- .../standby_container_group_pools_update.py | 7 +- ..._virtual_machine_pool_runtime_views_get.py | 2 +- ...pool_runtime_views_list_by_standby_pool.py | 2 +- ..._virtual_machine_pools_create_or_update.py | 7 +- .../standby_virtual_machine_pools_delete.py | 2 +- .../standby_virtual_machine_pools_get.py | 2 +- ...al_machine_pools_list_by_resource_group.py | 2 +- ...tual_machine_pools_list_by_subscription.py | 2 +- .../standby_virtual_machine_pools_update.py | 7 +- .../standby_virtual_machines_get.py | 2 +- ...y_standby_virtual_machine_pool_resource.py | 2 +- .../generated_tests/conftest.py | 2 +- ...tandby_container_group_pools_operations.py | 10 + ..._container_group_pools_operations_async.py | 10 + ...tandby_virtual_machine_pools_operations.py | 10 + ..._virtual_machine_pools_operations_async.py | 10 + ...standby_pool_mgmt_operations_async_test.py | 1 - .../test_standby_pool_mgmt_operations_test.py | 1 - ...ual_machine_pools_operations_async_test.py | 1 - ...y_virtual_machine_pools_operations_test.py | 1 - .../azure-mgmt-standbypool/tsp-location.yaml | 2 +- 45 files changed, 734 insertions(+), 768 deletions(-) diff --git a/sdk/standbypool/azure-mgmt-standbypool/_meta.json b/sdk/standbypool/azure-mgmt-standbypool/_meta.json index 3e4fe5c69a6f..2a6bc275fa07 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/_meta.json +++ b/sdk/standbypool/azure-mgmt-standbypool/_meta.json @@ -1,6 +1,6 @@ { - "commit": "e695076ad458a3eac3d6943f9e923544ff52b1e4", + "commit": "6363566e67134bbaaf34a212a7cd15382659ae54", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/standbypool/StandbyPool.Management", - "@azure-tools/typespec-python": "0.31.1" + "@azure-tools/typespec-python": "0.38.1" } \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py index a3ea11613bb0..74bce6678210 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import StandbyPoolMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import StandbyPoolMgmtClient # 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__ = [ "StandbyPoolMgmtClient", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py index 7aa263829c91..838d5a06be96 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py @@ -27,11 +27,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class StandbyPoolMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class StandbyPoolMgmtClient: """StandbyPoolMgmtClient. :ivar operations: Operations operations @@ -59,7 +58,7 @@ class StandbyPoolMgmtClient: # pylint: disable=client-accepts-api-version-keywo :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-03-01". + :keyword api_version: The API version to use for this operation. Default value is "2025-03-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 diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py index e8956f714462..8d17b6ced765 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for StandbyPoolMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -30,7 +29,7 @@ class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-a :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-03-01". + :keyword api_version: The API version to use for this operation. Default value is "2025-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -42,7 +41,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-03-01") + api_version: str = kwargs.pop("api_version", "2025-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py index 12ad7f29c71e..7f73b97b23ef 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_model_base.py @@ -1,10 +1,11 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -573,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -584,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -600,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -612,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -632,11 +633,11 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. + """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. :returns: A dict JSON compatible object @@ -733,7 +734,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An ) -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -753,7 +754,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): @@ -893,6 +894,22 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py index 01a226bd7f14..670738f0789c 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_serialization.py @@ -185,73 +185,7 @@ 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. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - 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.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -1442,7 +1375,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1453,7 +1386,7 @@ class Deserializer(object): 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, @@ -1684,17 +1617,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + 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() if v.get("constant") # pylint: disable=protected-access + 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 @@ -2048,7 +1985,7 @@ def deserialize_rfc(attr): 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) diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py index 0ec13ea52bbf..be71c81bd282 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py index 91b6ee862656..87a5f090533e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import StandbyPoolMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import StandbyPoolMgmtClient # 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__ = [ "StandbyPoolMgmtClient", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py index 68015b82e8d6..36c987258b90 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py @@ -27,11 +27,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class StandbyPoolMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class StandbyPoolMgmtClient: """StandbyPoolMgmtClient. :ivar operations: Operations operations @@ -59,7 +58,7 @@ class StandbyPoolMgmtClient: # pylint: disable=client-accepts-api-version-keywo :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-03-01". + :keyword api_version: The API version to use for this operation. Default value is "2025-03-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 diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py index 5125e06ebbb8..c81d9bafc16c 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for StandbyPoolMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -30,7 +29,7 @@ class StandbyPoolMgmtClientConfiguration: # pylint: disable=too-many-instance-a :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-03-01". + :keyword api_version: The API version to use for this operation. Default value is "2025-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -42,7 +41,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-03-01") + api_version: str = kwargs.pop("api_version", "2025-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py index 12acea673adc..71fe7806df8e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/__init__.py @@ -5,16 +5,22 @@ # Code generated by Microsoft (R) Python 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 ._operations import StandbyVirtualMachinePoolsOperations -from ._operations import StandbyVirtualMachinesOperations -from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations -from ._operations import StandbyContainerGroupPoolsOperations -from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import StandbyVirtualMachinePoolsOperations # type: ignore +from ._operations import StandbyVirtualMachinesOperations # type: ignore +from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations # 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__ = [ @@ -25,5 +31,5 @@ "StandbyContainerGroupPoolsOperations", "StandbyContainerGroupPoolRuntimeViewsOperations", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py index f8bd49760400..e54c1b937948 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/operations/_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. @@ -9,23 +9,10 @@ from io import IOBase import json 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, @@ -47,7 +34,8 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer from ..._validation import api_version_validation from ...operations._operations import ( build_operations_list_request, @@ -70,11 +58,12 @@ build_standby_virtual_machines_get_request, build_standby_virtual_machines_list_by_standby_virtual_machine_pool_resource_request, ) +from .._configuration import StandbyPoolMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -92,15 +81,14 @@ 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """List the operations for the provider. @@ -114,7 +102,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +165,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -197,23 +185,14 @@ class StandbyVirtualMachinePoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -230,7 +209,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +249,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -284,17 +263,7 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _create_or_update_initial( self, @@ -303,7 +272,7 @@ async def _create_or_update_initial( resource: Union[_models.StandbyVirtualMachinePoolResource, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -352,7 +321,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -455,17 +424,7 @@ async def begin_create_or_update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_create_or_update( self, @@ -544,21 +503,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _delete_initial( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -597,7 +547,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -614,16 +564,7 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_delete( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -769,17 +710,7 @@ async def update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def update( self, @@ -804,7 +735,7 @@ async def update( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -854,7 +785,7 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -869,8 +800,7 @@ async def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -890,7 +820,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +885,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -964,8 +894,7 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by subscription ID. @@ -980,7 +909,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyV cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,7 +973,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1064,24 +993,14 @@ class StandbyVirtualMachinesOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "standby_virtual_machine_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def get( self, @@ -1104,7 +1023,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachineResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1064,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1160,17 +1079,8 @@ async def get( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, - ) # pylint: disable=name-too-long + params_added_on={"2024-03-01-preview": ["base_url"]}, + ) def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-long self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> AsyncIterable["_models.StandbyVirtualMachineResource"]: @@ -1191,7 +1101,7 @@ def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-l cls: ClsType[List[_models.StandbyVirtualMachineResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1167,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1277,12 +1187,26 @@ class StandbyVirtualMachinePoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "runtime_view", + "accept", + ] + }, + ) async def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyVirtualMachinePoolRuntimeViewResource: @@ -1302,7 +1226,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1343,7 +1267,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1357,9 +1281,23 @@ async def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> AsyncIterable["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: + # pylint: disable=line-too-long """List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource. @@ -1378,7 +1316,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyVirtualMachinePoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1446,7 +1384,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1466,23 +1404,14 @@ class StandbyContainerGroupPoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def get( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -1499,7 +1428,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1539,7 +1468,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1553,17 +1482,7 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _create_or_update_initial( self, @@ -1572,7 +1491,7 @@ async def _create_or_update_initial( resource: Union[_models.StandbyContainerGroupPoolResource, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1621,7 +1540,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1724,17 +1643,7 @@ async def begin_create_or_update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_create_or_update( self, @@ -1813,21 +1722,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def _delete_initial( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1866,7 +1766,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1883,16 +1783,7 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def begin_delete( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -2038,17 +1929,7 @@ async def update( @distributed_trace_async @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) async def update( self, @@ -2073,7 +1954,7 @@ async def update( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2123,7 +2004,7 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2138,8 +2019,7 @@ async def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -2159,7 +2039,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2224,7 +2104,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2233,8 +2113,7 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by subscription ID. @@ -2249,7 +2128,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.StandbyC cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2313,7 +2192,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2333,12 +2212,26 @@ class StandbyContainerGroupPoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "runtime_view", + "accept", + ] + }, + ) async def get( self, resource_group_name: str, standby_container_group_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyContainerGroupPoolRuntimeViewResource: @@ -2358,7 +2251,7 @@ async def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2399,7 +2292,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2413,9 +2306,23 @@ async def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any ) -> AsyncIterable["_models.StandbyContainerGroupPoolRuntimeViewResource"]: + # pylint: disable=line-too-long """List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource. @@ -2434,7 +2341,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyContainerGroupPoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2502,7 +2409,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py index 5e5cac3af9c9..175b8fff102d 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/__init__.py @@ -5,47 +5,60 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import ContainerGroupInstanceCountSummary -from ._models import ContainerGroupProfile -from ._models import ContainerGroupProperties -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import Operation -from ._models import OperationDisplay -from ._models import PoolResourceStateCount -from ._models import ProxyResource -from ._models import Resource -from ._models import StandbyContainerGroupPoolElasticityProfile -from ._models import StandbyContainerGroupPoolResource -from ._models import StandbyContainerGroupPoolResourceProperties -from ._models import StandbyContainerGroupPoolResourceUpdate -from ._models import StandbyContainerGroupPoolResourceUpdateProperties -from ._models import StandbyContainerGroupPoolRuntimeViewResource -from ._models import StandbyContainerGroupPoolRuntimeViewResourceProperties -from ._models import StandbyVirtualMachinePoolElasticityProfile -from ._models import StandbyVirtualMachinePoolResource -from ._models import StandbyVirtualMachinePoolResourceProperties -from ._models import StandbyVirtualMachinePoolResourceUpdate -from ._models import StandbyVirtualMachinePoolResourceUpdateProperties -from ._models import StandbyVirtualMachinePoolRuntimeViewResource -from ._models import StandbyVirtualMachinePoolRuntimeViewResourceProperties -from ._models import StandbyVirtualMachineResource -from ._models import StandbyVirtualMachineResourceProperties -from ._models import Subnet -from ._models import SystemData -from ._models import TrackedResource -from ._models import VirtualMachineInstanceCountSummary +from typing import TYPE_CHECKING -from ._enums import ActionType -from ._enums import CreatedByType -from ._enums import Origin -from ._enums import ProvisioningState -from ._enums import RefillPolicy -from ._enums import VirtualMachineState +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + ContainerGroupInstanceCountSummary, + ContainerGroupProfile, + ContainerGroupProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Operation, + OperationDisplay, + PoolResourceStateCount, + ProxyResource, + Resource, + StandbyContainerGroupPoolDegradedPolicy, + StandbyContainerGroupPoolElasticityProfile, + StandbyContainerGroupPoolResource, + StandbyContainerGroupPoolResourceProperties, + StandbyContainerGroupPoolResourceUpdate, + StandbyContainerGroupPoolResourceUpdateProperties, + StandbyContainerGroupPoolRuntimeViewResource, + StandbyContainerGroupPoolRuntimeViewResourceProperties, + StandbyVirtualMachinePoolDegradedPolicy, + StandbyVirtualMachinePoolElasticityProfile, + StandbyVirtualMachinePoolResource, + StandbyVirtualMachinePoolResourceProperties, + StandbyVirtualMachinePoolResourceUpdate, + StandbyVirtualMachinePoolResourceUpdateProperties, + StandbyVirtualMachinePoolRuntimeViewResource, + StandbyVirtualMachinePoolRuntimeViewResourceProperties, + StandbyVirtualMachineResource, + StandbyVirtualMachineResourceProperties, + Subnet, + SystemData, + TrackedResource, + VirtualMachineInstanceCountSummary, +) + +from ._enums import ( # type: ignore + ActionType, + CreatedByType, + Origin, + ProvisioningState, + RefillPolicy, + VirtualMachineState, +) 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__ = [ @@ -60,6 +73,7 @@ "PoolResourceStateCount", "ProxyResource", "Resource", + "StandbyContainerGroupPoolDegradedPolicy", "StandbyContainerGroupPoolElasticityProfile", "StandbyContainerGroupPoolResource", "StandbyContainerGroupPoolResourceProperties", @@ -67,6 +81,7 @@ "StandbyContainerGroupPoolResourceUpdateProperties", "StandbyContainerGroupPoolRuntimeViewResource", "StandbyContainerGroupPoolRuntimeViewResourceProperties", + "StandbyVirtualMachinePoolDegradedPolicy", "StandbyVirtualMachinePoolElasticityProfile", "StandbyVirtualMachinePoolResource", "StandbyVirtualMachinePoolResourceProperties", @@ -87,5 +102,5 @@ "RefillPolicy", "VirtualMachineState", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py index d502d546afec..9c087cd9c2b5 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/models/_models.py @@ -1,11 +1,12 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -14,7 +15,6 @@ from .._model_base import rest_field if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -35,16 +35,16 @@ def __init__( self, *, instance_counts_by_state: List["_models.PoolResourceStateCount"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -69,16 +69,16 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin revision: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -104,16 +104,16 @@ def __init__( *, container_group_profile: "_models.ContainerGroupProfile", subnet_ids: Optional[List["_models.Subnet"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -181,16 +181,16 @@ def __init__( self, *, error: Optional["_models.ErrorDetail"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -223,13 +223,13 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + display: Optional["_models.OperationDisplay"] = rest_field() """Localized display information for this particular operation.""" origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType") + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \"Internal\"""" @@ -237,17 +237,17 @@ class Operation(_model_base.Model): def __init__( self, *, - action_type: Optional[Union[str, "_models.ActionType"]] = None, - ): ... + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -306,16 +306,16 @@ def __init__( *, state: str, count: int, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -369,6 +369,47 @@ class ProxyResource(Resource): """ +class StandbyContainerGroupPoolDegradedPolicy(_model_base.Model): + """Details of the degraded policy. + + + :ivar failure_percentage_to_enter_degraded: Specifies the failure percentage threshold to move + Standby Pool into degraded state. Required. + :vartype failure_percentage_to_enter_degraded: int + :ivar retry_percentage: Specifies StandbyPool retry percentage in degraded state. Required. + :vartype retry_percentage: int + :ivar retry_waiting_time_by_minutes: Specifies StandbyPool waiting time between two retries in + degraded state. Required. + :vartype retry_waiting_time_by_minutes: int + """ + + failure_percentage_to_enter_degraded: int = rest_field(name="failurePercentageToEnterDegraded") + """Specifies the failure percentage threshold to move Standby Pool into degraded state. Required.""" + retry_percentage: int = rest_field(name="retryPercentage") + """Specifies StandbyPool retry percentage in degraded state. Required.""" + retry_waiting_time_by_minutes: int = rest_field(name="retryWaitingTimeByMinutes") + """Specifies StandbyPool waiting time between two retries in degraded state. Required.""" + + @overload + def __init__( + self, + *, + failure_percentage_to_enter_degraded: int, + retry_percentage: int, + retry_waiting_time_by_minutes: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class StandbyContainerGroupPoolElasticityProfile(_model_base.Model): # pylint: disable=name-too-long """Specifies the elasticity profile of the standby container group pools. @@ -391,16 +432,16 @@ def __init__( *, max_ready_capacity: int, refill_policy: Optional[Union[str, "_models.RefillPolicy"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -439,16 +480,16 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -487,16 +528,16 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyContainerGroupPoolResourceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -510,6 +551,9 @@ class StandbyContainerGroupPoolResourceProperties(_model_base.Model): # pylint: Required. :vartype elasticity_profile: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolElasticityProfile + :ivar degraded_policy: Specifies the elasticity profile of the standby container group pools. + :vartype degraded_policy: + ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolDegradedPolicy :ivar container_group_properties: Specifies container group properties of standby container group pools. Required. :vartype container_group_properties: ~azure.mgmt.standbypool.models.ContainerGroupProperties @@ -520,6 +564,8 @@ class StandbyContainerGroupPoolResourceProperties(_model_base.Model): # pylint: elasticity_profile: "_models.StandbyContainerGroupPoolElasticityProfile" = rest_field(name="elasticityProfile") """Specifies elasticity profile of standby container group pools. Required.""" + degraded_policy: Optional["_models.StandbyContainerGroupPoolDegradedPolicy"] = rest_field(name="degradedPolicy") + """Specifies the elasticity profile of the standby container group pools.""" container_group_properties: "_models.ContainerGroupProperties" = rest_field(name="containerGroupProperties") """Specifies container group properties of standby container group pools. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -534,16 +580,17 @@ def __init__( *, elasticity_profile: "_models.StandbyContainerGroupPoolElasticityProfile", container_group_properties: "_models.ContainerGroupProperties", - ): ... + degraded_policy: Optional["_models.StandbyContainerGroupPoolDegradedPolicy"] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -568,16 +615,16 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyContainerGroupPoolResourceUpdateProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -587,6 +634,9 @@ class StandbyContainerGroupPoolResourceUpdateProperties(_model_base.Model): # p :ivar elasticity_profile: Specifies elasticity profile of standby container group pools. :vartype elasticity_profile: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolElasticityProfile + :ivar degraded_policy: Specifies the elasticity profile of the standby container group pools. + :vartype degraded_policy: + ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolDegradedPolicy :ivar container_group_properties: Specifies container group properties of standby container group pools. :vartype container_group_properties: ~azure.mgmt.standbypool.models.ContainerGroupProperties @@ -596,6 +646,8 @@ class StandbyContainerGroupPoolResourceUpdateProperties(_model_base.Model): # p name="elasticityProfile" ) """Specifies elasticity profile of standby container group pools.""" + degraded_policy: Optional["_models.StandbyContainerGroupPoolDegradedPolicy"] = rest_field(name="degradedPolicy") + """Specifies the elasticity profile of the standby container group pools.""" container_group_properties: Optional["_models.ContainerGroupProperties"] = rest_field( name="containerGroupProperties" ) @@ -606,17 +658,18 @@ def __init__( self, *, elasticity_profile: Optional["_models.StandbyContainerGroupPoolElasticityProfile"] = None, + degraded_policy: Optional["_models.StandbyContainerGroupPoolDegradedPolicy"] = None, container_group_properties: Optional["_models.ContainerGroupProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -650,16 +703,16 @@ def __init__( self, *, properties: Optional["_models.StandbyContainerGroupPoolRuntimeViewResourceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -690,6 +743,47 @@ class StandbyContainerGroupPoolRuntimeViewResourceProperties(_model_base.Model): \"Failed\", \"Canceled\", and \"Deleting\".""" +class StandbyVirtualMachinePoolDegradedPolicy(_model_base.Model): + """Details of the degraded policy. + + + :ivar failure_percentage_to_enter_degraded: Specifies the failure percentage threshold to move + Standby Pool into degraded state. Required. + :vartype failure_percentage_to_enter_degraded: int + :ivar retry_percentage: Specifies StandbyPool retry percentage in degraded state. Required. + :vartype retry_percentage: int + :ivar retry_waiting_time_by_minutes: Specifies StandbyPool waiting time between two retries in + degraded state. Required. + :vartype retry_waiting_time_by_minutes: int + """ + + failure_percentage_to_enter_degraded: int = rest_field(name="failurePercentageToEnterDegraded") + """Specifies the failure percentage threshold to move Standby Pool into degraded state. Required.""" + retry_percentage: int = rest_field(name="retryPercentage") + """Specifies StandbyPool retry percentage in degraded state. Required.""" + retry_waiting_time_by_minutes: int = rest_field(name="retryWaitingTimeByMinutes") + """Specifies StandbyPool waiting time between two retries in degraded state. Required.""" + + @overload + def __init__( + self, + *, + failure_percentage_to_enter_degraded: int, + retry_percentage: int, + retry_waiting_time_by_minutes: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class StandbyVirtualMachinePoolElasticityProfile(_model_base.Model): # pylint: disable=name-too-long """Details of the elasticity profile. @@ -714,16 +808,16 @@ def __init__( *, max_ready_capacity: int, min_ready_capacity: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -762,16 +856,16 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyVirtualMachinePoolResourceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -785,6 +879,9 @@ class StandbyVirtualMachinePoolResourceProperties(_model_base.Model): # pylint: pools. :vartype elasticity_profile: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolElasticityProfile + :ivar degraded_policy: Specifies the elasticity profile of the standby virtual machine pools. + :vartype degraded_policy: + ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolDegradedPolicy :ivar virtual_machine_state: Specifies the desired state of virtual machines in the pool. Required. Known values are: "Running" and "Deallocated". :vartype virtual_machine_state: str or ~azure.mgmt.standbypool.models.VirtualMachineState @@ -800,6 +897,8 @@ class StandbyVirtualMachinePoolResourceProperties(_model_base.Model): # pylint: name="elasticityProfile" ) """Specifies the elasticity profile of the standby virtual machine pools.""" + degraded_policy: Optional["_models.StandbyVirtualMachinePoolDegradedPolicy"] = rest_field(name="degradedPolicy") + """Specifies the elasticity profile of the standby virtual machine pools.""" virtual_machine_state: Union[str, "_models.VirtualMachineState"] = rest_field(name="virtualMachineState") """Specifies the desired state of virtual machines in the pool. Required. Known values are: \"Running\" and \"Deallocated\".""" @@ -818,17 +917,18 @@ def __init__( *, virtual_machine_state: Union[str, "_models.VirtualMachineState"], elasticity_profile: Optional["_models.StandbyVirtualMachinePoolElasticityProfile"] = None, + degraded_policy: Optional["_models.StandbyVirtualMachinePoolDegradedPolicy"] = None, attached_virtual_machine_scale_set_id: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -853,16 +953,16 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.StandbyVirtualMachinePoolResourceUpdateProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -873,6 +973,9 @@ class StandbyVirtualMachinePoolResourceUpdateProperties(_model_base.Model): # p pools. :vartype elasticity_profile: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolElasticityProfile + :ivar degraded_policy: Specifies the elasticity profile of the standby virtual machine pools. + :vartype degraded_policy: + ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolDegradedPolicy :ivar virtual_machine_state: Specifies the desired state of virtual machines in the pool. Known values are: "Running" and "Deallocated". :vartype virtual_machine_state: str or ~azure.mgmt.standbypool.models.VirtualMachineState @@ -885,6 +988,8 @@ class StandbyVirtualMachinePoolResourceUpdateProperties(_model_base.Model): # p name="elasticityProfile" ) """Specifies the elasticity profile of the standby virtual machine pools.""" + degraded_policy: Optional["_models.StandbyVirtualMachinePoolDegradedPolicy"] = rest_field(name="degradedPolicy") + """Specifies the elasticity profile of the standby virtual machine pools.""" virtual_machine_state: Optional[Union[str, "_models.VirtualMachineState"]] = rest_field(name="virtualMachineState") """Specifies the desired state of virtual machines in the pool. Known values are: \"Running\" and \"Deallocated\".""" @@ -897,18 +1002,19 @@ def __init__( self, *, elasticity_profile: Optional["_models.StandbyVirtualMachinePoolElasticityProfile"] = None, + degraded_policy: Optional["_models.StandbyVirtualMachinePoolDegradedPolicy"] = None, virtual_machine_state: Optional[Union[str, "_models.VirtualMachineState"]] = None, attached_virtual_machine_scale_set_id: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -942,16 +1048,16 @@ def __init__( self, *, properties: Optional["_models.StandbyVirtualMachinePoolRuntimeViewResourceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -962,11 +1068,8 @@ class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_model_base.Model): :ivar instance_count_summary: A list containing the counts of virtual machines in each possible - power state for each zone if enabled, as known by the StandbyPool resource provider. - If zones are not enabled on the attached VMSS, the list will contain a single entry with null - zone values. - Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through - portal) are not reflected here. + power state for each zone if enabled, as known by the StandbyPool resource provider. If zones + are not enabled on the attached VMSS, the list will contain a single entry without zone values. Note: any resources in the Running state may still be installing extensions / not fully provisioned. Required. :vartype instance_count_summary: @@ -980,13 +1083,9 @@ class StandbyVirtualMachinePoolRuntimeViewResourceProperties(_model_base.Model): name="instanceCountSummary", visibility=["read"] ) """A list containing the counts of virtual machines in each possible power state for each zone if - enabled, as known by the StandbyPool resource provider. - If zones are not enabled on the attached VMSS, the list will contain a single entry with null - zone values. - Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) - are not reflected here. - Note: any resources in the Running state may still be installing extensions / not fully - provisioned. Required.""" + enabled, as known by the StandbyPool resource provider. If zones are not enabled on the + attached VMSS, the list will contain a single entry without zone values. Note: any resources in + the Running state may still be installing extensions / not fully provisioned. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -1023,16 +1122,16 @@ def __init__( self, *, properties: Optional["_models.StandbyVirtualMachineResourceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1062,16 +1161,16 @@ def __init__( self, *, virtual_machine_resource_id: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1091,16 +1190,16 @@ def __init__( self, *, id: str, # pylint: disable=redefined-builtin - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1148,26 +1247,23 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) class VirtualMachineInstanceCountSummary(_model_base.Model): """Contains the counts of VMs in each power state in a given zone, fault domain, as known by the - StandbyPool resource provider. - Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) - are not reflected here. - Note: any resources in the Running state may still be installing extensions / not fully - provisioned. + StandbyPool resource provider. Note: any resources in the Running state may still be installing + extensions / not fully provisioned. :ivar zone: The zone that the provided counts are in. This is null if zones are not enabled on @@ -1190,14 +1286,14 @@ def __init__( *, instance_counts_by_state: List["_models.PoolResourceStateCount"], zone: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py index 12acea673adc..71fe7806df8e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/__init__.py @@ -5,16 +5,22 @@ # Code generated by Microsoft (R) Python 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 ._operations import StandbyVirtualMachinePoolsOperations -from ._operations import StandbyVirtualMachinesOperations -from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations -from ._operations import StandbyContainerGroupPoolsOperations -from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import StandbyVirtualMachinePoolsOperations # type: ignore +from ._operations import StandbyVirtualMachinesOperations # type: ignore +from ._operations import StandbyVirtualMachinePoolRuntimeViewsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolsOperations # type: ignore +from ._operations import StandbyContainerGroupPoolRuntimeViewsOperations # 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__ = [ @@ -25,5 +31,5 @@ "StandbyContainerGroupPoolsOperations", "StandbyContainerGroupPoolRuntimeViewsOperations", ] -__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/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py index 3fb867658d96..4a97de227ce7 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/operations/_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. @@ -9,9 +9,10 @@ from io import IOBase import json 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, @@ -32,14 +33,15 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Serializer +from .._configuration import StandbyPoolMgmtClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer from .._validation import api_version_validation if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,7 +54,7 @@ def build_operations_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", "2024-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +75,7 @@ def build_standby_virtual_machine_pools_get_request( # pylint: disable=name-too _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +106,7 @@ def build_standby_virtual_machine_pools_create_or_update_request( # pylint: dis _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +138,7 @@ def build_standby_virtual_machine_pools_delete_request( # pylint: disable=name- _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +169,7 @@ def build_standby_virtual_machine_pools_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +201,7 @@ def build_standby_virtual_machine_pools_list_by_resource_group_request( # pylin _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +228,7 @@ def build_standby_virtual_machine_pools_list_by_subscription_request( # pylint: _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +258,7 @@ def build_standby_virtual_machines_get_request( # pylint: disable=name-too-long _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -289,7 +291,7 @@ def build_standby_virtual_machines_list_by_standby_virtual_machine_pool_resource _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,7 +325,7 @@ def build_standby_virtual_machine_pool_runtime_views_get_request( # pylint: dis _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +356,7 @@ def build_standby_virtual_machine_pool_runtime_views_list_by_standby_pool_reques _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +386,7 @@ def build_standby_container_group_pools_get_request( # pylint: disable=name-too _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -415,7 +417,7 @@ def build_standby_container_group_pools_create_or_update_request( # pylint: dis _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -447,7 +449,7 @@ def build_standby_container_group_pools_delete_request( # pylint: disable=name- _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +480,7 @@ def build_standby_container_group_pools_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -510,7 +512,7 @@ def build_standby_container_group_pools_list_by_resource_group_request( # pylin _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -537,7 +539,7 @@ def build_standby_container_group_pools_list_by_subscription_request( # pylint: _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -567,7 +569,7 @@ def build_standby_container_group_pool_runtime_views_get_request( # pylint: dis _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -598,7 +600,7 @@ def build_standby_container_group_pool_runtime_views_list_by_standby_pool_reques _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-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -634,15 +636,14 @@ 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """List the operations for the provider. @@ -656,7 +657,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +720,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -739,23 +740,14 @@ class StandbyVirtualMachinePoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -772,7 +764,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +804,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -826,17 +818,7 @@ def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _create_or_update_initial( self, @@ -845,7 +827,7 @@ def _create_or_update_initial( resource: Union[_models.StandbyVirtualMachinePoolResource, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -894,7 +876,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -997,17 +979,7 @@ def begin_create_or_update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_create_or_update( self, @@ -1086,21 +1058,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _delete_initial( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1139,7 +1102,7 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1156,16 +1119,7 @@ def _delete_initial( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_delete( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any @@ -1311,17 +1265,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def update( self, @@ -1346,7 +1290,7 @@ def update( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1340,7 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1411,8 +1355,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -1432,7 +1375,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1440,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1506,8 +1449,7 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyVirtualMachinePoolResource"]: """List StandbyVirtualMachinePoolResource resources by subscription ID. @@ -1522,7 +1464,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyVirtua cls: ClsType[List[_models.StandbyVirtualMachinePoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1528,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1606,24 +1548,14 @@ class StandbyVirtualMachinesOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "standby_virtual_machine_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def get( self, @@ -1646,7 +1578,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachineResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1687,7 +1619,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1702,17 +1634,8 @@ def get( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_virtual_machine_pool_name", - "accept", - ] - }, - ) # pylint: disable=name-too-long + params_added_on={"2024-03-01-preview": ["base_url"]}, + ) def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-long self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> Iterable["_models.StandbyVirtualMachineResource"]: @@ -1733,7 +1656,7 @@ def list_by_standby_virtual_machine_pool_resource( # pylint: disable=name-too-l cls: ClsType[List[_models.StandbyVirtualMachineResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1799,7 +1722,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1819,12 +1742,26 @@ class StandbyVirtualMachinePoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "runtime_view", + "accept", + ] + }, + ) def get( self, resource_group_name: str, standby_virtual_machine_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyVirtualMachinePoolRuntimeViewResource: @@ -1844,7 +1781,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyVirtualMachinePoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1885,7 +1822,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1899,6 +1836,19 @@ def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_virtual_machine_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_virtual_machine_pool_name: str, **kwargs: Any ) -> Iterable["_models.StandbyVirtualMachinePoolRuntimeViewResource"]: @@ -1920,7 +1870,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyVirtualMachinePoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1988,7 +1938,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2008,23 +1958,14 @@ class StandbyContainerGroupPoolsOperations: 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: StandbyPoolMgmtClientConfiguration = 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 @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def get( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -2041,7 +1982,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2081,7 +2022,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2095,17 +2036,7 @@ def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _create_or_update_initial( self, @@ -2114,7 +2045,7 @@ def _create_or_update_initial( resource: Union[_models.StandbyContainerGroupPoolResource, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2163,7 +2094,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2266,17 +2197,7 @@ def begin_create_or_update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_create_or_update( self, @@ -2355,21 +2276,12 @@ def get_long_running_output(pipeline_response): ) @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def _delete_initial( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2408,7 +2320,7 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2425,16 +2337,7 @@ def _delete_initial( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def begin_delete( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any @@ -2580,17 +2483,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={ - "2023-12-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "standby_container_group_pool_name", - "content_type", - "accept", - ] - }, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def update( self, @@ -2615,7 +2508,7 @@ def update( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2665,7 +2558,7 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2680,8 +2573,7 @@ def update( @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -2701,7 +2593,7 @@ def list_by_resource_group( cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2766,7 +2658,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2775,8 +2667,7 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-12-01-preview", - params_added_on={"2023-12-01-preview": ["api_version", "subscription_id", "accept"]}, + params_added_on={"2024-03-01-preview": ["base_url"]}, ) def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyContainerGroupPoolResource"]: """List StandbyContainerGroupPoolResource resources by subscription ID. @@ -2791,7 +2682,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.StandbyContai cls: ClsType[List[_models.StandbyContainerGroupPoolResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2855,7 +2746,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2875,12 +2766,26 @@ class StandbyContainerGroupPoolRuntimeViewsOperations: # pylint: disable=name-t 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: StandbyPoolMgmtClientConfiguration = 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 + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "runtime_view", + "accept", + ] + }, + ) def get( self, resource_group_name: str, standby_container_group_pool_name: str, runtime_view: str, **kwargs: Any ) -> _models.StandbyContainerGroupPoolRuntimeViewResource: @@ -2900,7 +2805,7 @@ def get( :rtype: ~azure.mgmt.standbypool.models.StandbyContainerGroupPoolRuntimeViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2941,7 +2846,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2955,6 +2860,19 @@ def get( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2024-03-01-preview", + params_added_on={ + "2024-03-01-preview": [ + "base_url", + "api_version", + "subscription_id", + "resource_group_name", + "standby_container_group_pool_name", + "accept", + ] + }, + ) def list_by_standby_pool( self, resource_group_name: str, standby_container_group_pool_name: str, **kwargs: Any ) -> Iterable["_models.StandbyContainerGroupPoolRuntimeViewResource"]: @@ -2976,7 +2894,7 @@ def list_by_standby_pool( cls: ClsType[List[_models.StandbyContainerGroupPoolRuntimeViewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3044,7 +2962,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py index e8b1e7bff918..f839954cf55b 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/Operations_List.json +# x-ms-original-file: 2025-03-01/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py index e284d62f4506..40f52f7a7291 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py index 1cb6bd6d947f..9fd207ba8f31 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pool_runtime_views_list_by_standby_pool.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py index ac0b79d29e31..a4960b8c02b2 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_create_or_update.py @@ -47,6 +47,11 @@ def main(): } ], }, + "degradedPolicy": { + "failurePercentageToEnterDegraded": 30, + "retryPercentage": 15, + "retryWaitingTimeByMinutes": 30, + }, "elasticityProfile": {"maxReadyCapacity": 688, "refillPolicy": "always"}, }, "tags": {}, @@ -55,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py index 12d85df1b96c..7824aefdcfa8 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py index eb1bbc623596..8d3092a652ab 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py index c729a6a2e089..5ba3f0f9b3e3 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py index b875bcdcc447..9da3cee45276 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py index 37adaaef3a94..984f4746a9d3 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_container_group_pools_update.py @@ -46,6 +46,11 @@ def main(): } ], }, + "degradedPolicy": { + "failurePercentageToEnterDegraded": 30, + "retryPercentage": 15, + "retryWaitingTimeByMinutes": 30, + }, "elasticityProfile": {"maxReadyCapacity": 1743, "refillPolicy": "always"}, }, "tags": {}, @@ -54,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json +# x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Update.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py index 588cf79db1ea..5d589b5b18b4 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py index b330f5f93ee4..8ed5a3d01d81 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pool_runtime_views_list_by_standby_pool.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py index 9a0425b5cd9d..2bf0054b2786 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_create_or_update.py @@ -37,6 +37,11 @@ def main(): "location": "West US", "properties": { "attachedVirtualMachineScaleSetId": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", + "degradedPolicy": { + "failurePercentageToEnterDegraded": 30, + "retryPercentage": 15, + "retryWaitingTimeByMinutes": 30, + }, "elasticityProfile": {"maxReadyCapacity": 304, "minReadyCapacity": 300}, "virtualMachineState": "Running", }, @@ -46,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py index 8c97ad9fdce4..4a015df45a2c 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py index ed33e9f42073..60a51171b542 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py index b64b3b8a1ac4..6bd661c23086 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py index 5f481597af2c..065efd166993 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py index 3402366f8507..cdeed26c03ae 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machine_pools_update.py @@ -36,6 +36,11 @@ def main(): properties={ "properties": { "attachedVirtualMachineScaleSetId": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", + "degradedPolicy": { + "failurePercentageToEnterDegraded": 30, + "retryPercentage": 15, + "retryWaitingTimeByMinutes": 30, + }, "elasticityProfile": {"maxReadyCapacity": 304, "minReadyCapacity": 300}, "virtualMachineState": "Running", }, @@ -45,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Update.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py index 616164e0c3c5..5543ba6df820 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py index 6aad32a48ad3..8256d53b560d 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_samples/standby_virtual_machines_list_by_standby_virtual_machine_pool_resource.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json +# x-ms-original-file: 2025-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json if __name__ == "__main__": main() diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py index 80945e8ce12b..4c351c014dbf 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/conftest.py +++ b/sdk/standbypool/azure-mgmt-standbypool/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): standbypoolmgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py index b93e4cfda2f5..cb442e84e5bd 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations.py @@ -45,6 +45,11 @@ def test_standby_container_group_pools_begin_create_or_update(self, resource_gro "subnetIds": [{"id": "str"}], }, "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "provisioningState": "str", }, "systemData": { @@ -86,6 +91,11 @@ def test_standby_container_group_pools_update(self, resource_group): "containerGroupProfile": {"id": "str", "revision": 0}, "subnetIds": [{"id": "str"}], }, + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, }, "tags": {"str": "str"}, diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py index 2fac342bd87e..a43b3f368f49 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_container_group_pools_operations_async.py @@ -47,6 +47,11 @@ async def test_standby_container_group_pools_begin_create_or_update(self, resour "subnetIds": [{"id": "str"}], }, "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "provisioningState": "str", }, "systemData": { @@ -91,6 +96,11 @@ async def test_standby_container_group_pools_update(self, resource_group): "containerGroupProfile": {"id": "str", "revision": 0}, "subnetIds": [{"id": "str"}], }, + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "elasticityProfile": {"maxReadyCapacity": 0, "refillPolicy": "str"}, }, "tags": {"str": "str"}, diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py index 631bc6c80a84..cc3fd0a30875 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations.py @@ -42,6 +42,11 @@ def test_standby_virtual_machine_pools_begin_create_or_update(self, resource_gro "properties": { "virtualMachineState": "str", "attachedVirtualMachineScaleSetId": "str", + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, "provisioningState": "str", }, @@ -81,6 +86,11 @@ def test_standby_virtual_machine_pools_update(self, resource_group): properties={ "properties": { "attachedVirtualMachineScaleSetId": "str", + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, "virtualMachineState": "str", }, diff --git a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py index 7649f28bdb4b..6c5c528b5e2e 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py +++ b/sdk/standbypool/azure-mgmt-standbypool/generated_tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async.py @@ -44,6 +44,11 @@ async def test_standby_virtual_machine_pools_begin_create_or_update(self, resour "properties": { "virtualMachineState": "str", "attachedVirtualMachineScaleSetId": "str", + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, "provisioningState": "str", }, @@ -86,6 +91,11 @@ async def test_standby_virtual_machine_pools_update(self, resource_group): properties={ "properties": { "attachedVirtualMachineScaleSetId": "str", + "degradedPolicy": { + "failurePercentageToEnterDegraded": 0, + "retryPercentage": 0, + "retryWaitingTimeByMinutes": 0, + }, "elasticityProfile": {"maxReadyCapacity": 0, "minReadyCapacity": 0}, "virtualMachineState": "str", }, diff --git a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py index a1daf5b0e706..39e3c18194b2 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_async_test.py @@ -25,4 +25,3 @@ async def test_operations_list(self, resource_group): response = self.client.operations.list() result = [r async for r in response] assert result - diff --git a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py index 69788a00a400..98d944308665 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_operations_test.py @@ -24,4 +24,3 @@ def test_operations_list(self, resource_group): response = self.client.operations.list() result = [r for r in response] assert result - diff --git a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py index b2b3a1821d27..6e142f1bff2a 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_async_test.py @@ -27,4 +27,3 @@ async def test_standby_virtual_machine_pools_list_by_resource_group(self, resour ) result = [r async for r in response] assert result == [] - \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py index 85ea698d3c97..2bfec7afd334 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py +++ b/sdk/standbypool/azure-mgmt-standbypool/tests/test_standby_pool_mgmt_standby_virtual_machine_pools_operations_test.py @@ -26,4 +26,3 @@ def test_standby_virtual_machine_pools_list_by_resource_group(self, resource_gro ) result = [r for r in response] assert result == [] - \ No newline at end of file diff --git a/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml b/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml index 555c0f7f3a08..6230e7e1bfab 100644 --- a/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml +++ b/sdk/standbypool/azure-mgmt-standbypool/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/standbypool/StandbyPool.Management -commit: e695076ad458a3eac3d6943f9e923544ff52b1e4 +commit: 6363566e67134bbaaf34a212a7cd15382659ae54 repo: Azure/azure-rest-api-specs additionalDirectories: