diff --git a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md index 8b0407677894..98daefa52876 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md +++ b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md @@ -1,5 +1,27 @@ # Release History +## 36.0.0 (2025-05-13) + +### Features Added + + - Added operation group NamespacesOperations + - Model AgentPoolUpgradeSettings has a new parameter max_unavailable + - Model AgentPoolUpgradeSettings has a new parameter undrainable_node_behavior + - Model AutoScaleProfile has a new parameter size + - Model ManagedClusterAPIServerAccessProfile has a new parameter enable_vnet_integration + - Model ManagedClusterAPIServerAccessProfile has a new parameter subnet_id + - Model ManualScaleProfile has a new parameter size + +### Breaking Changes + + - Model AutoScaleProfile no longer has parameter os_disk_size_gb + - Model AutoScaleProfile no longer has parameter os_disk_type + - Model AutoScaleProfile no longer has parameter sizes + - Model ManagedCluster no longer has parameter enable_pod_security_policy + - Model ManualScaleProfile no longer has parameter os_disk_size_gb + - Model ManualScaleProfile no longer has parameter os_disk_type + - Model ManualScaleProfile no longer has parameter sizes + ## 35.0.0 (2025-04-14) ### Features Added diff --git a/sdk/containerservice/azure-mgmt-containerservice/README.md b/sdk/containerservice/azure-mgmt-containerservice/README.md index a178a86c0b7a..7fb3f35472de 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/README.md +++ b/sdk/containerservice/azure-mgmt-containerservice/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Container Service Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package diff --git a/sdk/containerservice/azure-mgmt-containerservice/_meta.json b/sdk/containerservice/azure-mgmt-containerservice/_meta.json index a301dbbb0754..d857d50b2083 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_meta.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_meta.json @@ -1,12 +1,12 @@ { - "commit": "d18ba009da04dd6afc04402c39f87e032051fe9b", + "commit": "38b47ee814c79556681f4f56f667b7fb039236c8", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.27.4", + "@autorest/python@6.34.1", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md", "package-2024-05": "2024-07-10 04:37:35 +0800 794e29ee5f8eca63ce0ddf007c60da7df37baaad stable/2024-05-01/managedClusters.json", "package-preview-2024-04": "2024-08-27 19:55:39 -0700 4bc9b37173bd5fe0ed19f21edfb8a195e89caaf6 preview/2024-04-02-preview/managedClusters.json", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py index d86c67067d20..823947dc7506 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py @@ -9,17 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin from ._configuration import ContainerServiceClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -27,7 +29,7 @@ class _SDKClient(object): def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." + """This is a fake class to support current implementation of MultiApiClientMixin." Will be removed in final version of multiapi azure-core based client """ pass @@ -56,17 +58,18 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2025-02-01' + DEFAULT_API_VERSION = '2025-03-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'container_service': '2025-01-02-preview', + 'container_service': '2025-02-02-preview', 'container_services': '2017-07-01', - 'load_balancers': '2025-01-02-preview', - 'managed_cluster_snapshots': '2025-01-02-preview', + 'load_balancers': '2025-02-02-preview', + 'managed_cluster_snapshots': '2025-02-02-preview', + 'namespaces': '2025-02-02-preview', 'open_shift_managed_clusters': '2019-09-30-preview', - 'operation_status_result': '2025-01-02-preview', + 'operation_status_result': '2025-02-02-preview', }}, _PROFILE_TAG + " latest" ) @@ -76,13 +79,18 @@ def __init__( credential: "TokenCredential", subscription_id: str, api_version: Optional[str]=None, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): if api_version: kwargs.setdefault('api_version', api_version) - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ContainerServiceClientConfiguration(credential, subscription_id, credential_scopes=credential_scopes, **kwargs) _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -101,7 +109,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) super(ContainerServiceClient, self).__init__( api_version=api_version, profile=profile @@ -119,8 +127,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-09-30-preview: :mod:`v2019_09_30_preview.models` * 2020-03-01: :mod:`v2020_03_01.models` * 2020-11-01: :mod:`v2020_11_01.models` - * 2025-01-02-preview: :mod:`v2025_01_02_preview.models` - * 2025-02-01: :mod:`v2025_02_01.models` + * 2025-02-02-preview: :mod:`v2025_02_02_preview.models` + * 2025-03-01: :mod:`v2025_03_01.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -134,11 +142,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-11-01': from .v2020_11_01 import models return models - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview import models + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview import models return models - elif api_version == '2025-02-01': - from .v2025_02_01 import models + elif api_version == '2025-03-01': + from .v2025_03_01 import models return models raise ValueError("API version {} is not available".format(api_version)) @@ -148,18 +156,18 @@ def agent_pools(self): * 2020-03-01: :class:`AgentPoolsOperations` * 2020-11-01: :class:`AgentPoolsOperations` - * 2025-01-02-preview: :class:`AgentPoolsOperations` - * 2025-02-01: :class:`AgentPoolsOperations` + * 2025-02-02-preview: :class:`AgentPoolsOperations` + * 2025-03-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2020-03-01': from .v2020_03_01.operations import AgentPoolsOperations as OperationClass elif api_version == '2020-11-01': from .v2020_11_01.operations import AgentPoolsOperations as OperationClass - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import AgentPoolsOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import AgentPoolsOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) self._config.api_version = api_version @@ -169,11 +177,11 @@ def agent_pools(self): def container_service(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`ContainerServiceOperations` + * 2025-02-02-preview: :class:`ContainerServiceOperations` """ api_version = self._get_api_version('container_service') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import ContainerServiceOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import ContainerServiceOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'container_service'".format(api_version)) self._config.api_version = api_version @@ -197,11 +205,11 @@ def container_services(self): def load_balancers(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`LoadBalancersOperations` + * 2025-02-02-preview: :class:`LoadBalancersOperations` """ api_version = self._get_api_version('load_balancers') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import LoadBalancersOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import LoadBalancersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancers'".format(api_version)) self._config.api_version = api_version @@ -211,14 +219,14 @@ def load_balancers(self): def machines(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`MachinesOperations` - * 2025-02-01: :class:`MachinesOperations` + * 2025-02-02-preview: :class:`MachinesOperations` + * 2025-03-01: :class:`MachinesOperations` """ api_version = self._get_api_version('machines') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import MachinesOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import MachinesOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import MachinesOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import MachinesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'machines'".format(api_version)) self._config.api_version = api_version @@ -228,14 +236,14 @@ def machines(self): def maintenance_configurations(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`MaintenanceConfigurationsOperations` - * 2025-02-01: :class:`MaintenanceConfigurationsOperations` + * 2025-02-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2025-03-01: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import MaintenanceConfigurationsOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) self._config.api_version = api_version @@ -245,11 +253,11 @@ def maintenance_configurations(self): def managed_cluster_snapshots(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2025-02-02-preview: :class:`ManagedClusterSnapshotsOperations` """ api_version = self._get_api_version('managed_cluster_snapshots') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_cluster_snapshots'".format(api_version)) self._config.api_version = api_version @@ -261,23 +269,37 @@ def managed_clusters(self): * 2020-03-01: :class:`ManagedClustersOperations` * 2020-11-01: :class:`ManagedClustersOperations` - * 2025-01-02-preview: :class:`ManagedClustersOperations` - * 2025-02-01: :class:`ManagedClustersOperations` + * 2025-02-02-preview: :class:`ManagedClustersOperations` + * 2025-03-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2020-03-01': from .v2020_03_01.operations import ManagedClustersOperations as OperationClass elif api_version == '2020-11-01': from .v2020_11_01.operations import ManagedClustersOperations as OperationClass - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import ManagedClustersOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import ManagedClustersOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property + def namespaces(self): + """Instance depends on the API version: + + * 2025-02-02-preview: :class:`NamespacesOperations` + """ + api_version = self._get_api_version('namespaces') + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import NamespacesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property def open_shift_managed_clusters(self): """Instance depends on the API version: @@ -296,11 +318,11 @@ def open_shift_managed_clusters(self): def operation_status_result(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`OperationStatusResultOperations` + * 2025-02-02-preview: :class:`OperationStatusResultOperations` """ api_version = self._get_api_version('operation_status_result') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import OperationStatusResultOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import OperationStatusResultOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'operation_status_result'".format(api_version)) self._config.api_version = api_version @@ -312,18 +334,18 @@ def operations(self): * 2020-03-01: :class:`Operations` * 2020-11-01: :class:`Operations` - * 2025-01-02-preview: :class:`Operations` - * 2025-02-01: :class:`Operations` + * 2025-02-02-preview: :class:`Operations` + * 2025-03-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2020-03-01': from .v2020_03_01.operations import Operations as OperationClass elif api_version == '2020-11-01': from .v2020_11_01.operations import Operations as OperationClass - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import Operations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import Operations as OperationClass + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import Operations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version @@ -334,16 +356,16 @@ def private_endpoint_connections(self): """Instance depends on the API version: * 2020-11-01: :class:`PrivateEndpointConnectionsOperations` - * 2025-01-02-preview: :class:`PrivateEndpointConnectionsOperations` - * 2025-02-01: :class:`PrivateEndpointConnectionsOperations` + * 2025-02-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2025-03-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-11-01': from .v2020_11_01.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) self._config.api_version = api_version @@ -354,16 +376,16 @@ def private_link_resources(self): """Instance depends on the API version: * 2020-11-01: :class:`PrivateLinkResourcesOperations` - * 2025-01-02-preview: :class:`PrivateLinkResourcesOperations` - * 2025-02-01: :class:`PrivateLinkResourcesOperations` + * 2025-02-02-preview: :class:`PrivateLinkResourcesOperations` + * 2025-03-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-11-01': from .v2020_11_01.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) self._config.api_version = api_version @@ -374,16 +396,16 @@ def resolve_private_link_service_id(self): """Instance depends on the API version: * 2020-11-01: :class:`ResolvePrivateLinkServiceIdOperations` - * 2025-01-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` - * 2025-02-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2025-02-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2025-03-01: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-11-01': from .v2020_11_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass - elif api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resolve_private_link_service_id'".format(api_version)) self._config.api_version = api_version @@ -393,14 +415,14 @@ def resolve_private_link_service_id(self): def snapshots(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`SnapshotsOperations` - * 2025-02-01: :class:`SnapshotsOperations` + * 2025-02-02-preview: :class:`SnapshotsOperations` + * 2025-03-01: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import SnapshotsOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import SnapshotsOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import SnapshotsOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) self._config.api_version = api_version @@ -410,14 +432,14 @@ def snapshots(self): def trusted_access_role_bindings(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`TrustedAccessRoleBindingsOperations` - * 2025-02-01: :class:`TrustedAccessRoleBindingsOperations` + * 2025-02-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2025-03-01: :class:`TrustedAccessRoleBindingsOperations` """ api_version = self._get_api_version('trusted_access_role_bindings') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import TrustedAccessRoleBindingsOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import TrustedAccessRoleBindingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_role_bindings'".format(api_version)) self._config.api_version = api_version @@ -427,14 +449,14 @@ def trusted_access_role_bindings(self): def trusted_access_roles(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`TrustedAccessRolesOperations` - * 2025-02-01: :class:`TrustedAccessRolesOperations` + * 2025-02-02-preview: :class:`TrustedAccessRolesOperations` + * 2025-03-01: :class:`TrustedAccessRolesOperations` """ api_version = self._get_api_version('trusted_access_roles') - if api_version == '2025-01-02-preview': - from .v2025_01_02_preview.operations import TrustedAccessRolesOperations as OperationClass - elif api_version == '2025-02-01': - from .v2025_02_01.operations import TrustedAccessRolesOperations as OperationClass + if api_version == '2025-02-02-preview': + from .v2025_02_02_preview.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2025-03-01': + from .v2025_03_01.operations import TrustedAccessRolesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_roles'".format(api_version)) self._config.api_version = api_version diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py new file mode 100644 index 000000000000..593333085322 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py new file mode 100644 index 000000000000..05bcd7d403ae --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py @@ -0,0 +1,2025 @@ +# coding=utf-8 + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py index ce330953651e..c89f5e6483e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py index 1b5ef26083f5..ac63ec740159 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py @@ -9,16 +9,18 @@ # regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration if TYPE_CHECKING: @@ -27,7 +29,7 @@ class _SDKClient(object): def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." + """This is a fake class to support current implementation of MultiApiClientMixin." Will be removed in final version of multiapi azure-core based client """ pass @@ -56,17 +58,18 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2025-02-01' + DEFAULT_API_VERSION = '2025-03-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'container_service': '2025-01-02-preview', + 'container_service': '2025-02-02-preview', 'container_services': '2017-07-01', - 'load_balancers': '2025-01-02-preview', - 'managed_cluster_snapshots': '2025-01-02-preview', + 'load_balancers': '2025-02-02-preview', + 'managed_cluster_snapshots': '2025-02-02-preview', + 'namespaces': '2025-02-02-preview', 'open_shift_managed_clusters': '2019-09-30-preview', - 'operation_status_result': '2025-01-02-preview', + 'operation_status_result': '2025-02-02-preview', }}, _PROFILE_TAG + " latest" ) @@ -76,13 +79,18 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, api_version: Optional[str] = None, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: if api_version: kwargs.setdefault('api_version', api_version) - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ContainerServiceClientConfiguration(credential, subscription_id, credential_scopes=credential_scopes, **kwargs) _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -101,7 +109,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) super(ContainerServiceClient, self).__init__( api_version=api_version, profile=profile @@ -119,8 +127,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-09-30-preview: :mod:`v2019_09_30_preview.models` * 2020-03-01: :mod:`v2020_03_01.models` * 2020-11-01: :mod:`v2020_11_01.models` - * 2025-01-02-preview: :mod:`v2025_01_02_preview.models` - * 2025-02-01: :mod:`v2025_02_01.models` + * 2025-02-02-preview: :mod:`v2025_02_02_preview.models` + * 2025-03-01: :mod:`v2025_03_01.models` """ if api_version == '2017-07-01': from ..v2017_07_01 import models @@ -134,11 +142,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-11-01': from ..v2020_11_01 import models return models - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview import models + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview import models return models - elif api_version == '2025-02-01': - from ..v2025_02_01 import models + elif api_version == '2025-03-01': + from ..v2025_03_01 import models return models raise ValueError("API version {} is not available".format(api_version)) @@ -148,18 +156,18 @@ def agent_pools(self): * 2020-03-01: :class:`AgentPoolsOperations` * 2020-11-01: :class:`AgentPoolsOperations` - * 2025-01-02-preview: :class:`AgentPoolsOperations` - * 2025-02-01: :class:`AgentPoolsOperations` + * 2025-02-02-preview: :class:`AgentPoolsOperations` + * 2025-03-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2020-03-01': from ..v2020_03_01.aio.operations import AgentPoolsOperations as OperationClass elif api_version == '2020-11-01': from ..v2020_11_01.aio.operations import AgentPoolsOperations as OperationClass - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import AgentPoolsOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) self._config.api_version = api_version @@ -169,11 +177,11 @@ def agent_pools(self): def container_service(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`ContainerServiceOperations` + * 2025-02-02-preview: :class:`ContainerServiceOperations` """ api_version = self._get_api_version('container_service') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import ContainerServiceOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import ContainerServiceOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'container_service'".format(api_version)) self._config.api_version = api_version @@ -197,11 +205,11 @@ def container_services(self): def load_balancers(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`LoadBalancersOperations` + * 2025-02-02-preview: :class:`LoadBalancersOperations` """ api_version = self._get_api_version('load_balancers') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import LoadBalancersOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import LoadBalancersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancers'".format(api_version)) self._config.api_version = api_version @@ -211,14 +219,14 @@ def load_balancers(self): def machines(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`MachinesOperations` - * 2025-02-01: :class:`MachinesOperations` + * 2025-02-02-preview: :class:`MachinesOperations` + * 2025-03-01: :class:`MachinesOperations` """ api_version = self._get_api_version('machines') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import MachinesOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import MachinesOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import MachinesOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import MachinesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'machines'".format(api_version)) self._config.api_version = api_version @@ -228,14 +236,14 @@ def machines(self): def maintenance_configurations(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`MaintenanceConfigurationsOperations` - * 2025-02-01: :class:`MaintenanceConfigurationsOperations` + * 2025-02-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2025-03-01: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) self._config.api_version = api_version @@ -245,11 +253,11 @@ def maintenance_configurations(self): def managed_cluster_snapshots(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2025-02-02-preview: :class:`ManagedClusterSnapshotsOperations` """ api_version = self._get_api_version('managed_cluster_snapshots') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_cluster_snapshots'".format(api_version)) self._config.api_version = api_version @@ -261,23 +269,37 @@ def managed_clusters(self): * 2020-03-01: :class:`ManagedClustersOperations` * 2020-11-01: :class:`ManagedClustersOperations` - * 2025-01-02-preview: :class:`ManagedClustersOperations` - * 2025-02-01: :class:`ManagedClustersOperations` + * 2025-02-02-preview: :class:`ManagedClustersOperations` + * 2025-03-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2020-03-01': from ..v2020_03_01.aio.operations import ManagedClustersOperations as OperationClass elif api_version == '2020-11-01': from ..v2020_11_01.aio.operations import ManagedClustersOperations as OperationClass - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import ManagedClustersOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property + def namespaces(self): + """Instance depends on the API version: + + * 2025-02-02-preview: :class:`NamespacesOperations` + """ + api_version = self._get_api_version('namespaces') + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import NamespacesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property def open_shift_managed_clusters(self): """Instance depends on the API version: @@ -296,11 +318,11 @@ def open_shift_managed_clusters(self): def operation_status_result(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`OperationStatusResultOperations` + * 2025-02-02-preview: :class:`OperationStatusResultOperations` """ api_version = self._get_api_version('operation_status_result') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import OperationStatusResultOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import OperationStatusResultOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'operation_status_result'".format(api_version)) self._config.api_version = api_version @@ -312,18 +334,18 @@ def operations(self): * 2020-03-01: :class:`Operations` * 2020-11-01: :class:`Operations` - * 2025-01-02-preview: :class:`Operations` - * 2025-02-01: :class:`Operations` + * 2025-02-02-preview: :class:`Operations` + * 2025-03-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2020-03-01': from ..v2020_03_01.aio.operations import Operations as OperationClass elif api_version == '2020-11-01': from ..v2020_11_01.aio.operations import Operations as OperationClass - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import Operations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import Operations as OperationClass + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import Operations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version @@ -334,16 +356,16 @@ def private_endpoint_connections(self): """Instance depends on the API version: * 2020-11-01: :class:`PrivateEndpointConnectionsOperations` - * 2025-01-02-preview: :class:`PrivateEndpointConnectionsOperations` - * 2025-02-01: :class:`PrivateEndpointConnectionsOperations` + * 2025-02-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2025-03-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-11-01': from ..v2020_11_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) self._config.api_version = api_version @@ -354,16 +376,16 @@ def private_link_resources(self): """Instance depends on the API version: * 2020-11-01: :class:`PrivateLinkResourcesOperations` - * 2025-01-02-preview: :class:`PrivateLinkResourcesOperations` - * 2025-02-01: :class:`PrivateLinkResourcesOperations` + * 2025-02-02-preview: :class:`PrivateLinkResourcesOperations` + * 2025-03-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-11-01': from ..v2020_11_01.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) self._config.api_version = api_version @@ -374,16 +396,16 @@ def resolve_private_link_service_id(self): """Instance depends on the API version: * 2020-11-01: :class:`ResolvePrivateLinkServiceIdOperations` - * 2025-01-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` - * 2025-02-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2025-02-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2025-03-01: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-11-01': from ..v2020_11_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass - elif api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resolve_private_link_service_id'".format(api_version)) self._config.api_version = api_version @@ -393,14 +415,14 @@ def resolve_private_link_service_id(self): def snapshots(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`SnapshotsOperations` - * 2025-02-01: :class:`SnapshotsOperations` + * 2025-02-02-preview: :class:`SnapshotsOperations` + * 2025-03-01: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import SnapshotsOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import SnapshotsOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) self._config.api_version = api_version @@ -410,14 +432,14 @@ def snapshots(self): def trusted_access_role_bindings(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`TrustedAccessRoleBindingsOperations` - * 2025-02-01: :class:`TrustedAccessRoleBindingsOperations` + * 2025-02-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2025-03-01: :class:`TrustedAccessRoleBindingsOperations` """ api_version = self._get_api_version('trusted_access_role_bindings') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_role_bindings'".format(api_version)) self._config.api_version = api_version @@ -427,14 +449,14 @@ def trusted_access_role_bindings(self): def trusted_access_roles(self): """Instance depends on the API version: - * 2025-01-02-preview: :class:`TrustedAccessRolesOperations` - * 2025-02-01: :class:`TrustedAccessRolesOperations` + * 2025-02-02-preview: :class:`TrustedAccessRolesOperations` + * 2025-03-01: :class:`TrustedAccessRolesOperations` """ api_version = self._get_api_version('trusted_access_roles') - if api_version == '2025-01-02-preview': - from ..v2025_01_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass - elif api_version == '2025-02-01': - from ..v2025_02_01.aio.operations import TrustedAccessRolesOperations as OperationClass + if api_version == '2025-02-02-preview': + from ..v2025_02_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2025-03-01': + from ..v2025_03_01.aio.operations import TrustedAccessRolesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_roles'".format(api_version)) self._config.api_version = api_version diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py index cc759c732d2e..9e9bf4fdb112 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py @@ -6,5 +6,5 @@ # -------------------------------------------------------------------------- from .v2017_07_01.models import * from .v2019_09_30_preview.models import * -from .v2025_01_02_preview.models import * -from .v2025_02_01.models import * +from .v2025_02_02_preview.models import * +from .v2025_03_01.models import * diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py index abe0ccded765..1663c90d2b5e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models -from .._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import ContainerServicesOperations if TYPE_CHECKING: @@ -35,7 +37,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2017-07-01". Note that overriding this default value may result in unsupported behavior. @@ -45,15 +47,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -72,7 +76,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json index 706b819a5e06..6a9cb36052c9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "host_value": "\"https://management.azure.com\"", + "host_value": null, "parameterized_host_template": null, "azure_arm": true, "has_public_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -57,7 +57,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -80,7 +80,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_utils/serialization.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_utils/serialization.py index a94487cbf17a..f5187701d7be 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_utils/serialization.py @@ -1,27 +1,10 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -47,9 +30,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -60,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -184,73 +165,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) -> None: - 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"(? ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -478,8 +393,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -625,7 +540,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -735,8 +650,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -780,8 +695,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -804,8 +719,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -834,8 +749,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -854,9 +769,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -1191,7 +1106,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1217,7 +1132,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1250,7 +1165,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1428,7 +1343,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1487,7 +1402,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1501,7 +1416,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1716,7 +1631,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1798,7 +1713,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1844,7 +1759,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1935,7 +1850,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1948,7 +1863,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1963,7 +1878,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1981,7 +1896,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1994,7 +1909,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2012,7 +1927,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2028,7 +1943,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2043,14 +1958,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2066,7 +1981,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2104,7 +2019,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_version.py index 6ba690f28963..470657edc1cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py index ce9a301baaf8..b86de7f9c150 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from ..._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration from .operations import ContainerServicesOperations @@ -35,7 +37,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2017-07-01". Note that overriding this default value may result in unsupported behavior. @@ -45,15 +47,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -72,7 +76,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py index d269db5ae401..64adf0766084 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._container_services_operations import ( build_create_or_update_request, build_delete_request, @@ -38,11 +40,8 @@ build_list_by_resource_group_request, build_list_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +60,10 @@ class ContainerServicesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py index a583cc6f63e7..81db26825c6b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py @@ -8,7 +8,7 @@ from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -56,9 +56,9 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw :paramtype tags: dict[str, str] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.location = location self.tags = tags @@ -190,7 +190,7 @@ def __init__( ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile """ super().__init__(location=location, tags=tags, **kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.orchestrator_profile = orchestrator_profile self.custom_profile = custom_profile self.service_principal_profile = service_principal_profile @@ -385,7 +385,7 @@ def __init__( self.vm_size = vm_size self.os_disk_size_gb = os_disk_size_gb self.dns_prefix = dns_prefix - self.fqdn = None + self.fqdn: Optional[str] = None self.ports = ports self.storage_profile = storage_profile self.vnet_subnet_id = vnet_subnet_id @@ -507,7 +507,7 @@ def __init__(self, *, value: Optional[List["_models.ContainerService"]] = None, """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ContainerServiceMasterProfile(_serialization.Model): @@ -679,7 +679,7 @@ def __init__( self.vnet_subnet_id = vnet_subnet_id self.first_consecutive_static_ip = first_consecutive_static_ip self.storage_profile = storage_profile - self.fqdn = None + self.fqdn: Optional[str] = None class ContainerServiceOrchestratorProfile(_serialization.Model): @@ -864,7 +864,7 @@ def __init__(self, *, enabled: bool, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.enabled = enabled - self.storage_uri = None + self.storage_uri: Optional[str] = None class ContainerServiceWindowsProfile(_serialization.Model): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py index f351d1533a3f..743f2a883985 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +52,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -83,7 +82,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "containerServiceName": _SERIALIZER.url("container_service_name", container_service_name, "str"), @@ -116,7 +115,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "containerServiceName": _SERIALIZER.url("container_service_name", container_service_name, "str"), @@ -144,7 +143,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "containerServiceName": _SERIALIZER.url("container_service_name", container_service_name, "str"), @@ -170,7 +169,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -201,10 +200,10 @@ class ContainerServicesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py index 17e40e6186bb..fe28f1672189 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models -from .._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import OpenShiftManagedClustersOperations if TYPE_CHECKING: @@ -35,7 +37,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2019-09-30-preview". Note that overriding this default value may result in unsupported behavior. @@ -45,15 +47,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -72,7 +76,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json index 708d610b1542..a9caf54db721 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "host_value": "\"https://management.azure.com\"", + "host_value": null, "parameterized_host_template": null, "azure_arm": true, "has_public_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -57,7 +57,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -80,7 +80,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_utils/serialization.py new file mode 100644 index 000000000000..f5187701d7be --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_utils/serialization.py @@ -0,0 +1,2032 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_version.py index 6ba690f28963..470657edc1cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py index 5f64ade5a381..22cd82c62326 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from ..._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations @@ -35,7 +37,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2019-09-30-preview". Note that overriding this default value may result in unsupported behavior. @@ -45,15 +47,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -72,7 +76,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py index 0200a7639635..b43ab78d63e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._open_shift_managed_clusters_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +42,8 @@ build_list_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,15 +62,14 @@ class OpenShiftManagedClustersOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster"]: - # pylint: disable=line-too-long """Gets a list of OpenShift managed clusters in the specified subscription. Gets a list of OpenShift managed clusters in the specified subscription. The operation returns @@ -154,7 +153,6 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.OpenShiftManagedCluster"]: - # pylint: disable=line-too-long """Lists OpenShift managed clusters in the specified subscription and resource group. Lists OpenShift managed clusters in the specified subscription and resource group. The @@ -373,7 +371,6 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OpenShiftManagedCluster]: - # pylint: disable=line-too-long """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -407,7 +404,6 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OpenShiftManagedCluster]: - # pylint: disable=line-too-long """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -438,7 +434,6 @@ async def begin_create_or_update( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.OpenShiftManagedCluster]: - # pylint: disable=line-too-long """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -585,7 +580,6 @@ async def begin_update_tags( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OpenShiftManagedCluster]: - # pylint: disable=line-too-long """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @@ -617,7 +611,6 @@ async def begin_update_tags( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OpenShiftManagedCluster]: - # pylint: disable=line-too-long """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @@ -647,7 +640,6 @@ async def begin_update_tags( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.OpenShiftManagedCluster]: - # pylint: disable=line-too-long """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py index a23f034c22b1..6a3c9978b6fa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py @@ -8,7 +8,7 @@ from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -148,9 +148,9 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw :paramtype tags: dict[str, str] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.location = location self.tags = tags @@ -287,11 +287,11 @@ def __init__( """ super().__init__(location=location, tags=tags, **kwargs) self.plan = plan - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.open_shift_version = open_shift_version - self.cluster_version = None - self.public_hostname = None - self.fqdn = None + self.cluster_version: Optional[str] = None + self.public_hostname: Optional[str] = None + self.fqdn: Optional[str] = None self.network_profile = network_profile self.router_profiles = router_profiles self.master_pool_profile = master_pool_profile @@ -567,7 +567,7 @@ def __init__(self, *, value: Optional[List["_models.OpenShiftManagedCluster"]] = """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class OpenShiftManagedClusterMasterPoolProfile(_serialization.Model): @@ -713,8 +713,8 @@ def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.name = name - self.public_subdomain = None - self.fqdn = None + self.public_subdomain: Optional[str] = None + self.fqdn: Optional[str] = None class PurchasePlan(_serialization.Model): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py index 2b3529f7c673..2f3d5565f49a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +52,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -80,7 +79,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -108,7 +107,7 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -140,7 +139,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -174,7 +173,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -207,7 +206,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -239,10 +238,10 @@ class OpenShiftManagedClustersOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py index 151221184a48..63ee2fddb18b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models -from .._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations if TYPE_CHECKING: @@ -39,7 +41,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2020-03-01". Note that overriding this default value may result in unsupported behavior. @@ -49,15 +51,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -76,7 +80,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json index e2e6ea4cf948..6596e620b13b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "host_value": "\"https://management.azure.com\"", + "host_value": null, "parameterized_host_template": null, "azure_arm": true, "has_public_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -57,7 +57,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -80,7 +80,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_utils/serialization.py new file mode 100644 index 000000000000..f5187701d7be --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_utils/serialization.py @@ -0,0 +1,2032 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_version.py index 6ba690f28963..470657edc1cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py index 29931905ca18..f64d1d182b5f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from ..._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations @@ -40,7 +42,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2020-03-01". Note that overriding this default value may result in unsupported behavior. @@ -50,15 +52,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -77,7 +81,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py index 25df337596b9..1a5001b1ba64 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._agent_pools_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +41,8 @@ build_get_upgrade_profile_request, build_list_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +61,10 @@ class AgentPoolsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py index 83bfcc14b669..d0049a22b8b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._managed_clusters_operations import ( build_create_or_update_request, build_delete_request, @@ -48,11 +50,8 @@ build_rotate_cluster_certificates_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,10 +70,10 @@ class ManagedClustersOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py index 727c420a3714..58dfd4dfc010 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -49,10 +48,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py index 2e39bacca470..6260cbdf075c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py @@ -9,7 +9,7 @@ from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -44,9 +44,9 @@ class SubResource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None class AgentPool(SubResource): @@ -333,7 +333,7 @@ def __init__( # pylint: disable=too-many-locals self.type_properties_type = type_properties_type self.mode = mode self.orchestrator_version = orchestrator_version - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip self.scale_set_priority = scale_set_priority @@ -388,9 +388,9 @@ def __init__( list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.agent_pool_versions = agent_pool_versions @@ -460,7 +460,7 @@ def __init__(self, *, value: Optional[List["_models.AgentPool"]] = None, **kwarg """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AgentPoolUpgradeProfile(_serialization.Model): @@ -522,9 +522,9 @@ def __init__( list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.kubernetes_version = kubernetes_version self.os_type = os_type self.upgrades = upgrades @@ -738,12 +738,12 @@ def __init__( """ super().__init__(**kwargs) self.identity = identity - self.provisioning_state = None - self.max_agent_pools = None + self.provisioning_state: Optional[str] = None + self.max_agent_pools: Optional[int] = None self.kubernetes_version = kubernetes_version self.dns_prefix = dns_prefix - self.fqdn = None - self.private_fqdn = None + self.fqdn: Optional[str] = None + self.private_fqdn: Optional[str] = None self.agent_pool_profiles = agent_pool_profiles self.linux_profile = linux_profile self.windows_profile = windows_profile @@ -1043,7 +1043,7 @@ def __init__( self.vnet_subnet_id = vnet_subnet_id self.first_consecutive_static_ip = first_consecutive_static_ip self.storage_profile = storage_profile - self.fqdn = None + self.fqdn: Optional[str] = None class ContainerServiceNetworkProfile(_serialization.Model): @@ -1251,7 +1251,7 @@ def __init__(self, *, enabled: bool, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.enabled = enabled - self.storage_uri = None + self.storage_uri: Optional[str] = None class CredentialResult(_serialization.Model): @@ -1278,8 +1278,8 @@ class CredentialResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[bytes] = None class CredentialResults(_serialization.Model): @@ -1302,7 +1302,7 @@ class CredentialResults(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.kubeconfigs = None + self.kubeconfigs: Optional[List["_models.CredentialResult"]] = None class Resource(_serialization.Model): @@ -1347,9 +1347,9 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw :paramtype tags: dict[str, str] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.location = location self.tags = tags @@ -1588,12 +1588,12 @@ def __init__( # pylint: disable=too-many-locals **kwargs ) self.identity = identity - self.provisioning_state = None - self.max_agent_pools = None + self.provisioning_state: Optional[str] = None + self.max_agent_pools: Optional[int] = None self.kubernetes_version = kubernetes_version self.dns_prefix = dns_prefix - self.fqdn = None - self.private_fqdn = None + self.fqdn: Optional[str] = None + self.private_fqdn: Optional[str] = None self.agent_pool_profiles = agent_pool_profiles self.linux_profile = linux_profile self.windows_profile = windows_profile @@ -1609,9 +1609,9 @@ def __init__( # pylint: disable=too-many-locals self.disk_encryption_set_id = disk_encryption_set_id self.identity_profile = identity_profile self.sku = sku - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.location = location self.tags = tags @@ -1773,7 +1773,7 @@ def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, ** super().__init__(**kwargs) self.enabled = enabled self.config = config - self.identity = None + self.identity: Optional["_models.ManagedClusterAddonProfileIdentity"] = None class UserAssignedIdentity(_serialization.Model): @@ -2096,7 +2096,7 @@ def __init__( self.type = type self.mode = mode self.orchestrator_version = orchestrator_version - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip self.scale_set_priority = scale_set_priority @@ -2470,8 +2470,8 @@ def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] :paramtype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.ResourceIdentityType """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type @@ -2502,7 +2502,7 @@ def __init__(self, *, value: Optional[List["_models.ManagedCluster"]] = None, ** """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedClusterLoadBalancerProfile(_serialization.Model): @@ -2961,9 +2961,9 @@ def __init__( list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.control_plane_profile = control_plane_profile self.agent_pool_profiles = agent_pool_profiles @@ -3044,7 +3044,7 @@ class OperationListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.OperationValue"]] = None class OperationValue(_serialization.Model): @@ -3087,12 +3087,12 @@ class OperationValue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None + self.origin: Optional[str] = None + self.name: Optional[str] = None + self.operation: Optional[str] = None + self.resource: Optional[str] = None + self.description: Optional[str] = None + self.provider: Optional[str] = None class ResourceReference(_serialization.Model): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py index 3698431ab361..6e47ff0a2503 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,7 +55,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -94,7 +93,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -134,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -175,7 +174,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -214,7 +213,7 @@ def build_get_upgrade_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -253,7 +252,7 @@ def build_get_available_agent_pool_versions_request( # pylint: disable=name-too _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -292,10 +291,10 @@ class AgentPoolsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py index ca47a48e1190..4b3e7458a515 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +79,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -111,7 +109,7 @@ def build_get_upgrade_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -149,7 +147,7 @@ def build_get_access_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -188,7 +186,7 @@ def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-lo _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -226,7 +224,7 @@ def build_list_cluster_user_credentials_request( # pylint: disable=name-too-lon _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -264,7 +262,7 @@ def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=n _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -300,7 +298,7 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -339,7 +337,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -380,7 +378,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -420,7 +418,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -459,7 +457,7 @@ def build_reset_service_principal_profile_request( # pylint: disable=name-too-l _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -500,7 +498,7 @@ def build_reset_aad_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -540,7 +538,7 @@ def build_rotate_cluster_certificates_request( # pylint: disable=name-too-long _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -579,10 +577,10 @@ class ManagedClustersOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py index 8fc2b689bb82..d02fc1ba119c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -71,10 +69,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py index 33be7380e08f..9d36b7875021 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models -from .._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import ( AgentPoolsOperations, ManagedClustersOperations, @@ -55,7 +57,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2020-11-01". Note that overriding this default value may result in unsupported behavior. @@ -65,15 +67,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -92,7 +96,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json index 918246224fff..163208013f92 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "host_value": "\"https://management.azure.com\"", + "host_value": null, "parameterized_host_template": null, "azure_arm": true, "has_public_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -57,7 +57,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -80,7 +80,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_utils/serialization.py new file mode 100644 index 000000000000..f5187701d7be --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_utils/serialization.py @@ -0,0 +1,2032 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_version.py index 6ba690f28963..470657edc1cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py index d8c18546cb6c..e4a6913549ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from ..._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration from .operations import ( AgentPoolsOperations, @@ -56,7 +58,7 @@ class ContainerServiceClient: :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2020-11-01". Note that overriding this default value may result in unsupported behavior. @@ -66,15 +68,17 @@ class ContainerServiceClient: """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -93,7 +97,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py index e4e9adde5516..b35aafcf0e1b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._agent_pools_operations import ( build_create_or_update_request, build_delete_request, @@ -40,11 +42,8 @@ build_list_request, build_upgrade_node_image_version_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,10 +62,10 @@ class AgentPoolsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py index 8aaad01321f3..8f50cd58b996 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._managed_clusters_operations import ( build_create_or_update_request, build_delete_request, @@ -50,11 +52,8 @@ build_stop_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,10 +72,10 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py index 1151b1593f82..368faf6e0cf4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -49,10 +48,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py index 0ed81edcf391..edcf199d4c43 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,17 +29,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_endpoint_connections_operations import ( build_delete_request, build_get_request, build_list_request, build_update_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +56,10 @@ class PrivateEndpointConnectionsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py index 64e4c5a1d869..7d8aa563d8b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py @@ -5,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_link_resources_operations import build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -47,10 +46,10 @@ class PrivateLinkResourcesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py index 7cb3d31b3eed..7a08b903c6bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._resolve_private_link_service_id_operations import build_post_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,10 +47,10 @@ class ResolvePrivateLinkServiceIdOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py index 2d19266751d8..33274f4b5107 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,7 +9,7 @@ from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -44,9 +44,9 @@ class SubResource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None class AgentPool(SubResource): @@ -390,10 +390,10 @@ def __init__( # pylint: disable=too-many-locals self.type_properties_type = type_properties_type self.mode = mode self.orchestrator_version = orchestrator_version - self.node_image_version = None + self.node_image_version: Optional[str] = None self.upgrade_settings = upgrade_settings - self.provisioning_state = None - self.power_state = None + self.provisioning_state: Optional[str] = None + self.power_state: Optional["_models.PowerState"] = None self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip self.scale_set_priority = scale_set_priority @@ -451,9 +451,9 @@ def __init__( list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.agent_pool_versions = agent_pool_versions @@ -523,7 +523,7 @@ def __init__(self, *, value: Optional[List["_models.AgentPool"]] = None, **kwarg """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AgentPoolUpgradeProfile(_serialization.Model): @@ -593,9 +593,9 @@ def __init__( :paramtype latest_node_image_version: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.kubernetes_version = kubernetes_version self.os_type = os_type self.upgrades = upgrades @@ -792,7 +792,7 @@ class Components1Q1Og48SchemasManagedclusterAllof1(_serialization.Model): # pyl :vartype disk_encryption_set_id: str :ivar identity_profile: Identities associated with the cluster. :vartype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] """ _validation = { @@ -925,17 +925,17 @@ def __init__( # pylint: disable=too-many-locals :paramtype disk_encryption_set_id: str :keyword identity_profile: Identities associated with the cluster. :paramtype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] """ super().__init__(**kwargs) self.identity = identity - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None + self.provisioning_state: Optional[str] = None + self.power_state: Optional["_models.PowerState"] = None + self.max_agent_pools: Optional[int] = None self.kubernetes_version = kubernetes_version self.dns_prefix = dns_prefix - self.fqdn = None - self.private_fqdn = None + self.fqdn: Optional[str] = None + self.private_fqdn: Optional[str] = None self.agent_pool_profiles = agent_pool_profiles self.linux_profile = linux_profile self.windows_profile = windows_profile @@ -980,8 +980,8 @@ class Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidenti def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None + self.principal_id: Optional[str] = None + self.client_id: Optional[str] = None class UserAssignedIdentity(_serialization.Model): @@ -1268,7 +1268,7 @@ def __init__( self.vnet_subnet_id = vnet_subnet_id self.first_consecutive_static_ip = first_consecutive_static_ip self.storage_profile = storage_profile - self.fqdn = None + self.fqdn: Optional[str] = None class ContainerServiceNetworkProfile(_serialization.Model): @@ -1476,7 +1476,7 @@ def __init__(self, *, enabled: bool, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.enabled = enabled - self.storage_uri = None + self.storage_uri: Optional[str] = None class CredentialResult(_serialization.Model): @@ -1503,8 +1503,8 @@ class CredentialResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[bytes] = None class CredentialResults(_serialization.Model): @@ -1527,7 +1527,7 @@ class CredentialResults(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.kubeconfigs = None + self.kubeconfigs: Optional[List["_models.CredentialResult"]] = None class KubeletConfig(_serialization.Model): @@ -1703,9 +1703,9 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw :paramtype tags: dict[str, str] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.location = location self.tags = tags @@ -1780,7 +1780,7 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype disk_encryption_set_id: str :ivar identity_profile: Identities associated with the cluster. :vartype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] :ivar id: Resource Id. :vartype id: str :ivar name: Resource name. @@ -1938,7 +1938,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype disk_encryption_set_id: str :keyword identity_profile: Identities associated with the cluster. :paramtype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] :keyword location: Resource location. Required. :paramtype location: str :keyword tags: Resource tags. @@ -1971,13 +1971,13 @@ def __init__( # pylint: disable=too-many-locals **kwargs ) self.identity = identity - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None + self.provisioning_state: Optional[str] = None + self.power_state: Optional["_models.PowerState"] = None + self.max_agent_pools: Optional[int] = None self.kubernetes_version = kubernetes_version self.dns_prefix = dns_prefix - self.fqdn = None - self.private_fqdn = None + self.fqdn: Optional[str] = None + self.private_fqdn: Optional[str] = None self.agent_pool_profiles = agent_pool_profiles self.linux_profile = linux_profile self.windows_profile = windows_profile @@ -1995,9 +1995,9 @@ def __init__( # pylint: disable=too-many-locals self.disk_encryption_set_id = disk_encryption_set_id self.identity_profile = identity_profile self.sku = sku - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.location = location self.tags = tags @@ -2166,7 +2166,7 @@ def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, ** super().__init__(**kwargs) self.enabled = enabled self.config = config - self.identity = None + self.identity: Optional["_models.ManagedClusterAddonProfileIdentity"] = None class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): @@ -2507,10 +2507,10 @@ def __init__( # pylint: disable=too-many-locals self.type = type self.mode = mode self.orchestrator_version = orchestrator_version - self.node_image_version = None + self.node_image_version: Optional[str] = None self.upgrade_settings = upgrade_settings - self.provisioning_state = None - self.power_state = None + self.provisioning_state: Optional[str] = None + self.power_state: Optional["_models.PowerState"] = None self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip self.scale_set_priority = scale_set_priority @@ -2962,9 +2962,9 @@ class ManagedClusterIdentity(_serialization.Model): :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :vartype user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -3004,13 +3004,13 @@ def __init__( :keyword user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type self.user_assigned_identities = user_assigned_identities @@ -3042,7 +3042,7 @@ def __init__(self, *, value: Optional[List["_models.ManagedCluster"]] = None, ** """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedClusterLoadBalancerProfile(_serialization.Model): @@ -3254,8 +3254,8 @@ def __init__(self, *, name: str, namespace: str, identity: "_models.UserAssigned self.name = name self.namespace = namespace self.identity = identity - self.provisioning_state = None - self.provisioning_info = None + self.provisioning_state: Optional[Union[str, "_models.ManagedClusterPodIdentityProvisioningState"]] = None + self.provisioning_info: Optional["_models.ManagedClusterPodIdentityProvisioningInfo"] = None class ManagedClusterPodIdentityException(_serialization.Model): @@ -3699,9 +3699,9 @@ def __init__( list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.control_plane_profile = control_plane_profile self.agent_pool_profiles = agent_pool_profiles @@ -3797,7 +3797,7 @@ class OperationListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.OperationValue"]] = None class OperationValue(_serialization.Model): @@ -3840,12 +3840,12 @@ class OperationValue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None + self.origin: Optional[str] = None + self.name: Optional[str] = None + self.operation: Optional[str] = None + self.resource: Optional[str] = None + self.description: Optional[str] = None + self.provider: Optional[str] = None class PowerState(_serialization.Model): @@ -3948,10 +3948,10 @@ def __init__( ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkServiceConnectionState """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = None self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state @@ -4038,7 +4038,7 @@ def __init__( self.type = type self.group_id = group_id self.required_members = required_members - self.private_link_service_id = None + self.private_link_service_id: Optional[str] = None class PrivateLinkResourcesListResult(_serialization.Model): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py index f87f48d89033..fac849dadc78 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +55,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -95,7 +93,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -135,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -176,7 +174,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -215,7 +213,7 @@ def build_get_upgrade_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -254,7 +252,7 @@ def build_get_available_agent_pool_versions_request( # pylint: disable=name-too _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -292,7 +290,7 @@ def build_upgrade_node_image_version_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -332,10 +330,10 @@ class AgentPoolsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py index 19739f538453..5491b2ddd07f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +79,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -111,7 +109,7 @@ def build_get_upgrade_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -149,7 +147,7 @@ def build_get_access_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -188,7 +186,7 @@ def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-lo _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -226,7 +224,7 @@ def build_list_cluster_user_credentials_request( # pylint: disable=name-too-lon _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -264,7 +262,7 @@ def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=n _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -300,7 +298,7 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -339,7 +337,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -380,7 +378,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -420,7 +418,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -459,7 +457,7 @@ def build_reset_service_principal_profile_request( # pylint: disable=name-too-l _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -500,7 +498,7 @@ def build_reset_aad_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -540,7 +538,7 @@ def build_rotate_cluster_certificates_request( # pylint: disable=name-too-long _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -578,7 +576,7 @@ def build_stop_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -616,7 +614,7 @@ def build_start_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -655,10 +653,10 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py index 6e567f206029..41601f48a808 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -71,10 +69,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py index 6e2fa712b9ca..9911f0d1abe3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,12 +30,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +53,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -96,7 +95,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -142,7 +141,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -189,7 +188,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -231,10 +230,10 @@ class PrivateEndpointConnectionsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py index 1ff92698cdba..9ac9dd828e28 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +48,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -88,10 +87,10 @@ class PrivateLinkResourcesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py index d1e7357143ee..5fb12d9dc570 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +50,7 @@ def build_post_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str", min_length=1), @@ -92,10 +91,10 @@ class ResolvePrivateLinkServiceIdOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/__init__.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/__init__.py index 999067d049ca..d350b13a02bc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/__init__.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._container_service_client import ContainerServiceClient # type: ignore +from ._container_service_client_test import ContainerServiceClientTest # type: ignore from ._version import VERSION __version__ = VERSION @@ -25,7 +25,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ContainerServiceClient", + "ContainerServiceClientTest", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_configuration.py similarity index 91% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_configuration.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_configuration.py index 825722cbfdf1..bef69e4dd26e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_configuration.py @@ -17,8 +17,8 @@ from azure.core.credentials import TokenCredential -class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for ContainerServiceClient. +class ContainerServiceClientTestConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for ContainerServiceClientTest. Note that all parameters used to create this instance are saved as instance attributes. @@ -27,13 +27,13 @@ class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-01-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-01-02-preview") + api_version: str = kwargs.pop("api_version", "2025-02-02-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_container_service_client_test.py similarity index 75% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_container_service_client.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_container_service_client_test.py index a70162fc5311..d8b849e2e16d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_container_service_client_test.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import ContainerServiceClientConfiguration +from ._configuration import ContainerServiceClientTestConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import ( AgentPoolsOperations, ContainerServiceOperations, @@ -26,6 +28,7 @@ MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, + NamespacesOperations, OperationStatusResultOperations, Operations, PrivateEndpointConnectionsOperations, @@ -40,60 +43,63 @@ from azure.core.credentials import TokenCredential -class ContainerServiceClient: # pylint: disable=too-many-instance-attributes +class ContainerServiceClientTest: # pylint: disable=too-many-instance-attributes """The Container Service Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerservice.v2025_01_02_preview.operations.Operations + :vartype operations: azure.mgmt.containerservice.v2025_02_02_preview.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: - azure.mgmt.containerservice.v2025_01_02_preview.operations.ManagedClustersOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.ManagedClustersOperations :ivar container_service: ContainerServiceOperations operations :vartype container_service: - azure.mgmt.containerservice.v2025_01_02_preview.operations.ContainerServiceOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.ContainerServiceOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations :vartype maintenance_configurations: - azure.mgmt.containerservice.v2025_01_02_preview.operations.MaintenanceConfigurationsOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.MaintenanceConfigurationsOperations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: + azure.mgmt.containerservice.v2025_02_02_preview.operations.NamespacesOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: - azure.mgmt.containerservice.v2025_01_02_preview.operations.AgentPoolsOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.AgentPoolsOperations :ivar machines: MachinesOperations operations :vartype machines: - azure.mgmt.containerservice.v2025_01_02_preview.operations.MachinesOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.MachinesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - azure.mgmt.containerservice.v2025_01_02_preview.operations.PrivateEndpointConnectionsOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: - azure.mgmt.containerservice.v2025_01_02_preview.operations.PrivateLinkResourcesOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations :vartype resolve_private_link_service_id: - azure.mgmt.containerservice.v2025_01_02_preview.operations.ResolvePrivateLinkServiceIdOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.ResolvePrivateLinkServiceIdOperations :ivar operation_status_result: OperationStatusResultOperations operations :vartype operation_status_result: - azure.mgmt.containerservice.v2025_01_02_preview.operations.OperationStatusResultOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.OperationStatusResultOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: - azure.mgmt.containerservice.v2025_01_02_preview.operations.SnapshotsOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.SnapshotsOperations :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations :vartype managed_cluster_snapshots: - azure.mgmt.containerservice.v2025_01_02_preview.operations.ManagedClusterSnapshotsOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.ManagedClusterSnapshotsOperations :ivar trusted_access_roles: TrustedAccessRolesOperations operations :vartype trusted_access_roles: - azure.mgmt.containerservice.v2025_01_02_preview.operations.TrustedAccessRolesOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.TrustedAccessRolesOperations :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations :vartype trusted_access_role_bindings: - azure.mgmt.containerservice.v2025_01_02_preview.operations.TrustedAccessRoleBindingsOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.TrustedAccessRoleBindingsOperations :ivar load_balancers: LoadBalancersOperations operations :vartype load_balancers: - azure.mgmt.containerservice.v2025_01_02_preview.operations.LoadBalancersOperations + azure.mgmt.containerservice.v2025_02_02_preview.operations.LoadBalancersOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2025-01-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". 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 @@ -101,15 +107,17 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: - self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ContainerServiceClientTestConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -128,56 +136,59 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.container_service = ContainerServiceOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" + ) + self.namespaces = NamespacesOperations( + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.machines = MachinesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.operation_status_result = OperationStatusResultOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.trusted_access_roles = TrustedAccessRolesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.load_balancers = LoadBalancersOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_metadata.json similarity index 80% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_metadata.json rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_metadata.json index 6da120276bd4..64af360faade 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2025-01-02-preview", - "total_api_version_list": ["2025-01-02-preview"], + "chosen_version": "2025-02-02-preview", + "total_api_version_list": ["2025-02-02-preview"], "client": { - "name": "ContainerServiceClient", - "filename": "_container_service_client", + "name": "ContainerServiceClientTest", + "filename": "_container_service_client_test", "description": "The Container Service Client.", - "host_value": "\"https://management.azure.com\"", + "host_value": null, "parameterized_host_template": null, "azure_arm": true, "has_public_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientTestConfiguration\"], \"._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientTestConfiguration\"], \".._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -57,7 +57,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -80,7 +80,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -109,6 +109,7 @@ "managed_clusters": "ManagedClustersOperations", "container_service": "ContainerServiceOperations", "maintenance_configurations": "MaintenanceConfigurationsOperations", + "namespaces": "NamespacesOperations", "agent_pools": "AgentPoolsOperations", "machines": "MachinesOperations", "private_endpoint_connections": "PrivateEndpointConnectionsOperations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_patch.py similarity index 61% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_patch.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_utils/serialization.py new file mode 100644 index 000000000000..f5187701d7be --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_utils/serialization.py @@ -0,0 +1,2032 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_version.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_version.py index 6ba690f28963..470657edc1cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/__init__.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/__init__.py index a55668168f09..e1bceabc21d9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/__init__.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._container_service_client import ContainerServiceClient # type: ignore +from ._container_service_client_test import ContainerServiceClientTest # type: ignore try: from ._patch import __all__ as _patch_all @@ -22,7 +22,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ContainerServiceClient", + "ContainerServiceClientTest", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_configuration.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_configuration.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_configuration.py index a4f6bf2c43f8..641a60cd2cca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_configuration.py @@ -17,8 +17,8 @@ from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for ContainerServiceClient. +class ContainerServiceClientTestConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for ContainerServiceClientTest. Note that all parameters used to create this instance are saved as instance attributes. @@ -27,13 +27,13 @@ class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-01-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-01-02-preview") + api_version: str = kwargs.pop("api_version", "2025-02-02-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_container_service_client_test.py similarity index 75% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_container_service_client.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_container_service_client_test.py index e66b555fccc3..be8b2bf693cf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_container_service_client_test.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientTestConfiguration from .operations import ( AgentPoolsOperations, ContainerServiceOperations, @@ -26,6 +28,7 @@ MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, + NamespacesOperations, OperationStatusResultOperations, Operations, PrivateEndpointConnectionsOperations, @@ -40,60 +43,63 @@ from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClient: # pylint: disable=too-many-instance-attributes +class ContainerServiceClientTest: # pylint: disable=too-many-instance-attributes """The Container Service Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.Operations + :vartype operations: azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.ManagedClustersOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.ManagedClustersOperations :ivar container_service: ContainerServiceOperations operations :vartype container_service: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.ContainerServiceOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.ContainerServiceOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations :vartype maintenance_configurations: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.MaintenanceConfigurationsOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.MaintenanceConfigurationsOperations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.NamespacesOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.AgentPoolsOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.AgentPoolsOperations :ivar machines: MachinesOperations operations :vartype machines: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.MachinesOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.MachinesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.PrivateEndpointConnectionsOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.PrivateLinkResourcesOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations :vartype resolve_private_link_service_id: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.ResolvePrivateLinkServiceIdOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.ResolvePrivateLinkServiceIdOperations :ivar operation_status_result: OperationStatusResultOperations operations :vartype operation_status_result: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.OperationStatusResultOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.OperationStatusResultOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.SnapshotsOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.SnapshotsOperations :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations :vartype managed_cluster_snapshots: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.ManagedClusterSnapshotsOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.ManagedClusterSnapshotsOperations :ivar trusted_access_roles: TrustedAccessRolesOperations operations :vartype trusted_access_roles: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.TrustedAccessRolesOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.TrustedAccessRolesOperations :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations :vartype trusted_access_role_bindings: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.TrustedAccessRoleBindingsOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.TrustedAccessRoleBindingsOperations :ivar load_balancers: LoadBalancersOperations operations :vartype load_balancers: - azure.mgmt.containerservice.v2025_01_02_preview.aio.operations.LoadBalancersOperations + azure.mgmt.containerservice.v2025_02_02_preview.aio.operations.LoadBalancersOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2025-01-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". 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 @@ -101,15 +107,17 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: - self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ContainerServiceClientTestConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -128,56 +136,61 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.container_service = ContainerServiceOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" + ) + self.namespaces = NamespacesOperations( + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.machines = MachinesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.operation_status_result = OperationStatusResultOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.trusted_access_roles = TrustedAccessRolesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) self.load_balancers = LoadBalancersOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-01-02-preview" + self._client, self._config, self._serialize, self._deserialize, "2025-02-02-preview" ) def _send_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_patch.py similarity index 61% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_patch.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/__init__.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/__init__.py index 786209b6598f..f8fd4f978b64 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/__init__.py @@ -16,6 +16,7 @@ from ._managed_clusters_operations import ManagedClustersOperations # type: ignore from ._container_service_operations import ContainerServiceOperations # type: ignore from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations # type: ignore +from ._namespaces_operations import NamespacesOperations # type: ignore from ._agent_pools_operations import AgentPoolsOperations # type: ignore from ._machines_operations import MachinesOperations # type: ignore from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore @@ -37,6 +38,7 @@ "ManagedClustersOperations", "ContainerServiceOperations", "MaintenanceConfigurationsOperations", + "NamespacesOperations", "AgentPoolsOperations", "MachinesOperations", "PrivateEndpointConnectionsOperations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_agent_pools_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_agent_pools_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_agent_pools_operations.py index fb3b00646655..0d7c0201c501 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_agent_pools_operations.py @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._agent_pools_operations import ( build_abort_latest_operation_request, build_create_or_update_request, @@ -43,11 +45,8 @@ build_list_request, build_upgrade_node_image_version_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +57,7 @@ class AgentPoolsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`agent_pools` attribute. """ @@ -66,10 +65,12 @@ class AgentPoolsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _abort_latest_operation_initial( @@ -87,7 +88,7 @@ async def _abort_latest_operation_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -157,7 +158,7 @@ async def begin_abort_latest_operation( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -211,14 +212,14 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A :type resource_name: str :return: An iterator like instance of either AgentPool or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) @@ -300,7 +301,7 @@ async def get( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPool or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -315,7 +316,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) @@ -370,7 +371,7 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -447,7 +448,7 @@ async def begin_create_or_update( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :param parameters: The agent pool to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -460,7 +461,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -502,7 +503,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -530,7 +531,7 @@ async def begin_create_or_update( :type agent_pool_name: str :param parameters: The agent pool to create or update. Is either a AgentPool type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. @@ -541,14 +542,14 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) @@ -617,7 +618,7 @@ async def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -696,7 +697,7 @@ async def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -753,7 +754,7 @@ async def get_upgrade_profile( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPoolUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -768,7 +769,7 @@ async def get_upgrade_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) @@ -821,7 +822,7 @@ async def _delete_machines_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -899,7 +900,7 @@ async def begin_delete_machines( :type agent_pool_name: str :param machines: A list of machines from the agent pool to be deleted. Required. :type machines: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolDeleteMachinesParameter + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolDeleteMachinesParameter :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -963,7 +964,7 @@ async def begin_delete_machines( :param machines: A list of machines from the agent pool to be deleted. Is either a AgentPoolDeleteMachinesParameter type or a IO[bytes] type. Required. :type machines: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolDeleteMachinesParameter or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolDeleteMachinesParameter or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -973,7 +974,7 @@ async def begin_delete_machines( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1031,7 +1032,7 @@ async def get_available_agent_pool_versions( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: AgentPoolAvailableVersions or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolAvailableVersions + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1046,7 +1047,7 @@ async def get_available_agent_pool_versions( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) @@ -1093,7 +1094,7 @@ async def _upgrade_node_image_version_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1157,14 +1158,14 @@ async def begin_upgrade_node_image_version( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_container_service_operations.py similarity index 85% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_container_service_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_container_service_operations.py index f6cb7055c804..c597a44ef724 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_container_service_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_container_service_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._container_service_operations import build_list_node_image_versions_request +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +41,7 @@ class ContainerServiceOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`container_service` attribute. """ @@ -49,15 +49,16 @@ class ContainerServiceOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_node_image_versions(self, location: str, **kwargs: Any) -> AsyncIterable["_models.NodeImageVersion"]: - # pylint: disable=line-too-long """Gets a list of supported NodeImage versions in the specified subscription. Only returns the latest version of each node image. For example there may be an @@ -68,14 +69,14 @@ def list_node_image_versions(self, location: str, **kwargs: Any) -> AsyncIterabl :type location: str :return: An iterator like instance of either NodeImageVersion or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeImageVersion] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.NodeImageVersionsListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_load_balancers_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_load_balancers_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_load_balancers_operations.py index 2938fcfc28f6..cf432b26c2b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_load_balancers_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_load_balancers_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._load_balancers_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class LoadBalancersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`load_balancers` attribute. """ @@ -60,10 +59,12 @@ class LoadBalancersOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -81,14 +82,14 @@ def list_by_managed_cluster( :type resource_name: str :return: An iterator like instance of either LoadBalancer or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) @@ -170,7 +171,7 @@ async def get( :param load_balancer_name: The name of the load balancer. Required. :type load_balancer_name: str :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -185,7 +186,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) @@ -241,12 +242,12 @@ async def create_or_update( :param load_balancer_name: The name of the load balancer. Required. :type load_balancer_name: str :param parameters: The load balancer to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ @@ -278,7 +279,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ @@ -304,10 +305,10 @@ async def create_or_update( :type load_balancer_name: str :param parameters: The load balancer to create or update. Is either a LoadBalancer type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer or IO[bytes] :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -322,7 +323,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) @@ -382,7 +383,7 @@ async def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -448,7 +449,7 @@ async def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_machines_operations.py similarity index 89% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_machines_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_machines_operations.py index 228c3dfb7ac9..645cca312818 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_machines_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._machines_operations import build_get_request, build_list_request +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +41,7 @@ class MachinesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`machines` attribute. """ @@ -50,10 +49,12 @@ class MachinesOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -73,14 +74,14 @@ def list( :type agent_pool_name: str :return: An iterator like instance of either Machine or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.Machine] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Machine] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) @@ -165,7 +166,7 @@ async def get( :param machine_name: host name of the machine. Required. :type machine_name: str :return: Machine or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Machine + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -180,7 +181,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.Machine] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_maintenance_configurations_operations.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_maintenance_configurations_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_maintenance_configurations_operations.py index cccd68131c96..dc02b55adfe7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,17 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._maintenance_configurations_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ class MaintenanceConfigurationsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`maintenance_configurations` attribute. """ @@ -56,17 +56,18 @@ class MaintenanceConfigurationsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.MaintenanceConfiguration"]: - # pylint: disable=line-too-long """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -79,14 +80,14 @@ def list_by_managed_cluster( :return: An iterator like instance of either MaintenanceConfiguration or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) @@ -168,7 +169,7 @@ async def get( :param config_name: The name of the maintenance configuration. Required. :type config_name: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -183,7 +184,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) @@ -240,12 +241,12 @@ async def create_or_update( :type config_name: str :param parameters: The maintenance configuration to create or update. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -277,7 +278,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -304,9 +305,9 @@ async def create_or_update( :param parameters: The maintenance configuration to create or update. Is either a MaintenanceConfiguration type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -321,7 +322,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) @@ -395,7 +396,7 @@ async def delete(self, resource_group_name: str, resource_name: str, config_name _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index ad3debca7d52..d0a358deca9c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +29,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._managed_cluster_snapshots_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +38,8 @@ build_list_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +50,7 @@ class ManagedClusterSnapshotsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`managed_cluster_snapshots` attribute. """ @@ -58,15 +58,16 @@ class ManagedClusterSnapshotsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"]: - # pylint: disable=line-too-long """Gets a list of managed cluster snapshots in the specified subscription. Gets a list of managed cluster snapshots in the specified subscription. @@ -74,14 +75,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] :return: An iterator like instance of either ManagedClusterSnapshot or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) @@ -149,7 +150,6 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedClusterSnapshot"]: - # pylint: disable=line-too-long """Lists managed cluster snapshots in the specified subscription and resource group. Lists managed cluster snapshots in the specified subscription and resource group. @@ -160,14 +160,14 @@ def list_by_resource_group( :return: An iterator like instance of either ManagedClusterSnapshot or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) @@ -244,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -259,7 +259,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) @@ -312,12 +312,12 @@ async def create_or_update( :type resource_name: str :param parameters: The managed cluster snapshot to create or update. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -346,7 +346,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -370,9 +370,9 @@ async def create_or_update( :param parameters: The managed cluster snapshot to create or update. Is either a ManagedClusterSnapshot type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot or IO[bytes] :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -387,7 +387,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) @@ -452,12 +452,12 @@ async def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -487,7 +487,7 @@ async def update_tags( Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -510,10 +510,10 @@ async def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or IO[bytes] :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -528,7 +528,7 @@ async def update_tags( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) @@ -599,7 +599,7 @@ async def delete(self, resource_group_name: str, resource_name: str, **kwargs: A _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_managed_clusters_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_managed_clusters_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_managed_clusters_operations.py index 995d01bea6ab..e982feb0107b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._managed_clusters_operations import ( build_abort_latest_operation_request, build_create_or_update_request, @@ -65,11 +67,8 @@ build_stop_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +79,7 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`managed_clusters` attribute. """ @@ -88,10 +87,12 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async @@ -104,7 +105,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :param location: The name of the Azure region. Required. :type location: str :return: KubernetesVersionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesVersionListResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -119,7 +120,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) @@ -158,14 +159,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) @@ -242,14 +243,14 @@ def list_by_resource_group( :type resource_group_name: str :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) @@ -328,7 +329,7 @@ async def get_upgrade_profile( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedClusterUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -343,7 +344,7 @@ async def get_upgrade_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) @@ -394,7 +395,7 @@ async def get_access_profile( :param role_name: The name of the role for managed cluster accessProfile resource. Required. :type role_name: str :return: ManagedClusterAccessProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAccessProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -409,7 +410,7 @@ async def get_access_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) @@ -458,7 +459,7 @@ async def list_cluster_admin_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -473,7 +474,7 @@ async def list_cluster_admin_credentials( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) @@ -530,9 +531,9 @@ async def list_cluster_user_credentials( 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. Known values are: "azure", "exec", and "exec". Default value is None. - :type format: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Format + :type format: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Format :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -547,7 +548,7 @@ async def list_cluster_user_credentials( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) @@ -597,7 +598,7 @@ async def list_cluster_monitoring_user_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -612,7 +613,7 @@ async def list_cluster_monitoring_user_credentials( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) @@ -657,7 +658,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedCluster or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -672,7 +673,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) @@ -725,7 +726,7 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -798,7 +799,7 @@ async def begin_create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The managed cluster to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -811,7 +812,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -850,7 +851,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -875,7 +876,7 @@ async def begin_create_or_update( :type resource_name: str :param parameters: The managed cluster to create or update. Is either a ManagedCluster type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. @@ -886,14 +887,14 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) @@ -960,7 +961,7 @@ async def _update_tags_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1031,7 +1032,7 @@ async def begin_update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -1041,7 +1042,7 @@ async def begin_update_tags( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1076,7 +1077,7 @@ async def begin_update_tags( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1100,7 +1101,7 @@ async def begin_update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. @@ -1108,14 +1109,14 @@ async def begin_update_tags( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) @@ -1181,7 +1182,7 @@ async def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1256,7 +1257,7 @@ async def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1315,7 +1316,7 @@ async def _reset_service_principal_profile_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1389,7 +1390,7 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterServicePrincipalProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1447,7 +1448,7 @@ async def begin_reset_service_principal_profile( :param parameters: The service principal profile to set on the managed cluster. Is either a ManagedClusterServicePrincipalProfile type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterServicePrincipalProfile or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -1457,7 +1458,7 @@ async def begin_reset_service_principal_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1519,7 +1520,7 @@ async def _reset_aad_profile_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1595,7 +1596,7 @@ async def begin_reset_aad_profile( :type resource_name: str :param parameters: The AAD profile to set on the Managed Cluster. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAADProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAADProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1657,7 +1658,7 @@ async def begin_reset_aad_profile( :param parameters: The AAD profile to set on the Managed Cluster. Is either a ManagedClusterAADProfile type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAADProfile or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAADProfile or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1666,7 +1667,7 @@ async def begin_reset_aad_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1724,7 +1725,7 @@ async def _abort_latest_operation_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1791,7 +1792,7 @@ async def begin_abort_latest_operation( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1846,7 +1847,7 @@ async def _rotate_cluster_certificates_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1909,7 +1910,7 @@ async def begin_rotate_cluster_certificates( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1964,7 +1965,7 @@ async def _rotate_service_account_signing_keys_initial( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2026,7 +2027,7 @@ async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2079,7 +2080,7 @@ async def _stop_initial(self, resource_group_name: str, resource_name: str, **kw _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2143,7 +2144,7 @@ async def begin_stop(self, resource_group_name: str, resource_name: str, **kwarg _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2196,7 +2197,7 @@ async def _start_initial(self, resource_group_name: str, resource_name: str, **k _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2257,7 +2258,7 @@ async def begin_start(self, resource_group_name: str, resource_name: str, **kwar _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2316,7 +2317,7 @@ async def _run_command_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2392,14 +2393,14 @@ async def begin_run_command( :type resource_name: str :param request_payload: The run command request. Required. :type request_payload: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandRequest + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2432,7 +2433,7 @@ async def begin_run_command( :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2458,18 +2459,18 @@ async def begin_run_command( :param request_payload: The run command request. Is either a RunCommandRequest type or a IO[bytes] type. Required. :type request_payload: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandRequest or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) @@ -2532,7 +2533,7 @@ async def get_command_result( :param command_id: Id of the command. Required. :type command_id: str :return: RunCommandResult or None or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult or None + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2547,7 +2548,7 @@ async def get_command_result( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) @@ -2590,7 +2591,6 @@ async def get_command_result( def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpoint"]: - # pylint: disable=line-too-long """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. @@ -2605,14 +2605,14 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.OutboundEnvironmentEndpoint] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.OutboundEnvironmentEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) @@ -2691,7 +2691,7 @@ async def get_guardrails_versions( :param version: Safeguards version. Required. :type version: str :return: GuardrailsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersion + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2706,7 +2706,7 @@ async def get_guardrails_versions( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) @@ -2742,7 +2742,6 @@ async def get_guardrails_versions( def list_guardrails_versions( self, location: str, **kwargs: Any ) -> AsyncIterable["_models.GuardrailsAvailableVersion"]: - # pylint: disable=line-too-long """Gets a list of supported Guardrails versions in the specified subscription and location. Contains list of Guardrails version along with its support info and whether it is a default @@ -2753,14 +2752,14 @@ def list_guardrails_versions( :return: An iterator like instance of either GuardrailsAvailableVersion or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersion] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) @@ -2838,7 +2837,7 @@ async def get_safeguards_versions( :param version: Safeguards version. Required. :type version: str :return: SafeguardsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersion + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2853,7 +2852,7 @@ async def get_safeguards_versions( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) @@ -2889,7 +2888,6 @@ async def get_safeguards_versions( def list_safeguards_versions( self, location: str, **kwargs: Any ) -> AsyncIterable["_models.SafeguardsAvailableVersion"]: - # pylint: disable=line-too-long """Gets a list of supported Safeguards versions in the specified subscription and location. Contains list of Safeguards version along with its support info and whether it is a default @@ -2900,14 +2898,14 @@ def list_safeguards_versions( :return: An iterator like instance of either SafeguardsAvailableVersion or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersion] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) @@ -2974,7 +2972,6 @@ async def get_next(next_link=None): @distributed_trace def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIterable["_models.MeshRevisionProfile"]: - # pylint: disable=line-too-long """Lists mesh revision profiles for all meshes in the specified location. Contains extra metadata on each revision, including supported revisions, cluster compatibility @@ -2984,14 +2981,14 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter :type location: str :return: An iterator like instance of either MeshRevisionProfile or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfile] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) @@ -3068,7 +3065,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :param mode: The mode of the mesh. Required. :type mode: str :return: MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3083,7 +3080,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) @@ -3119,7 +3116,6 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An def list_mesh_upgrade_profiles( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.MeshUpgradeProfile"]: - # pylint: disable=line-too-long """Lists available upgrades for all service meshes in a specific cluster. Lists available upgrades for all service meshes in a specific cluster. @@ -3131,14 +3127,14 @@ def list_mesh_upgrade_profiles( :type resource_name: str :return: An iterator like instance of either MeshUpgradeProfile or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfile] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) @@ -3220,7 +3216,7 @@ async def get_mesh_upgrade_profile( :param mode: The mode of the mesh. Required. :type mode: str :return: MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3235,7 +3231,7 @@ async def get_mesh_upgrade_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) @@ -3287,7 +3283,7 @@ async def _rebalance_load_balancers_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -3362,7 +3358,7 @@ async def begin_rebalance_load_balancers( :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RebalanceLoadBalancersRequestBody + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RebalanceLoadBalancersRequestBody :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3422,7 +3418,7 @@ async def begin_rebalance_load_balancers( balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RebalanceLoadBalancersRequestBody or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RebalanceLoadBalancersRequestBody or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -3432,7 +3428,7 @@ async def begin_rebalance_load_balancers( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_namespaces_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_namespaces_operations.py new file mode 100644 index 000000000000..2267ba960d19 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_namespaces_operations.py @@ -0,0 +1,776 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer +from ...operations._namespaces_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, + build_list_credential_request, + build_update_request, +) +from .._configuration import ContainerServiceClientTestConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class NamespacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s + :attr:`namespaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientTestConfiguration = ( + 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") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Namespace"]: + """Gets a list of managed namespaces in the specified managed cluster. + + Gets a list of managed namespaces in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of either Namespace or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NamespaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> _models.Namespace: + """Gets the specified namespace of a managed cluster. + + Gets the specified namespace of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Namespace") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: _models.Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Creates or updates a namespace in the specified managed cluster. + + Creates or updates a namespace in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Creates or updates a namespace in the specified managed cluster. + + Creates or updates a namespace in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Creates or updates a namespace in the specified managed cluster. + + Creates or updates a namespace in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: The namespace to create or update. Is either a Namespace type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Namespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Namespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a namespace. + + Deletes a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Namespace: + """Updates tags on a namespace. + + Updates tags on a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Namespace: + """Updates tags on a namespace. + + Updates tags on a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Namespace: + """Updates tags on a namespace. + + Updates tags on a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Is either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or + IO[bytes] + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_credential( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of a namespace. + + Lists the credentials of a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_credential_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_operation_status_result_operations.py similarity index 90% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_operation_status_result_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_operation_status_result_operations.py index 3e66dd7e438a..81f1a3141e3c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_operation_status_result_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,16 +28,14 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operation_status_result_operations import ( build_get_by_agent_pool_request, build_get_request, build_list_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +46,7 @@ class OperationStatusResultOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`operation_status_result` attribute. """ @@ -54,17 +54,18 @@ class OperationStatusResultOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OperationStatusResult"]: - # pylint: disable=line-too-long """Gets a list of operations in the specified managedCluster. Gets a list of operations in the specified managedCluster. @@ -77,14 +78,14 @@ def list( :return: An iterator like instance of either OperationStatusResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) @@ -166,7 +167,7 @@ async def get( :param operation_id: The ID of an ongoing async operation. Required. :type operation_id: str :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -181,7 +182,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -232,7 +233,7 @@ async def get_by_agent_pool( :param operation_id: The ID of an ongoing async operation. Required. :type operation_id: str :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -247,7 +248,7 @@ async def get_by_agent_pool( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_operations.py similarity index 85% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_operations.py index febc3e629c5d..12ea4e17ebee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`operations` attribute. """ @@ -49,10 +48,12 @@ 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -63,14 +64,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: :return: An iterator like instance of either OperationValue or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationValue] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationValue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_patch.py similarity index 61% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_patch.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_private_endpoint_connections_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_private_endpoint_connections_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_private_endpoint_connections_operations.py index 7732afc90b5d..568e4221c9d5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,17 +29,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_endpoint_connections_operations import ( build_delete_request, build_get_request, build_list_request, build_update_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +48,7 @@ class PrivateEndpointConnectionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`private_endpoint_connections` attribute. """ @@ -57,10 +56,12 @@ class PrivateEndpointConnectionsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async @@ -79,7 +80,7 @@ async def list( :type resource_name: str :return: PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnectionListResult + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -94,7 +95,7 @@ async def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) @@ -143,7 +144,7 @@ async def get( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -158,7 +159,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -215,12 +216,12 @@ async def update( :type private_endpoint_connection_name: str :param parameters: The updated private endpoint connection. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -252,7 +253,7 @@ async def update( Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -279,9 +280,9 @@ async def update( :param parameters: The updated private endpoint connection. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection or IO[bytes] :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -296,7 +297,7 @@ async def update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -356,7 +357,7 @@ async def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -417,7 +418,7 @@ async def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_private_link_resources_operations.py similarity index 82% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_private_link_resources_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_private_link_resources_operations.py index b4569e0a5f7c..9e0c3be94cfa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_private_link_resources_operations.py @@ -5,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_link_resources_operations import build_list_request +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +38,7 @@ class PrivateLinkResourcesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`private_link_resources` attribute. """ @@ -47,10 +46,12 @@ class PrivateLinkResourcesOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async @@ -68,7 +69,7 @@ async def list( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResourcesListResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -83,7 +84,7 @@ async def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py similarity index 86% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 406d7d7aaabb..6a99e49c5110 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._resolve_private_link_service_id_operations import build_post_request +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +39,7 @@ class ResolvePrivateLinkServiceIdOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`resolve_private_link_service_id` attribute. """ @@ -48,10 +47,12 @@ class ResolvePrivateLinkServiceIdOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload @@ -74,12 +75,12 @@ async def post( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -108,7 +109,7 @@ async def post( Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -131,10 +132,10 @@ async def post( :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Is either a PrivateLinkResource type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource or IO[bytes] :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -149,7 +150,7 @@ async def post( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_snapshots_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_snapshots_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_snapshots_operations.py index cf382be6a390..9c0fd6b47d6d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_snapshots_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._snapshots_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +37,8 @@ build_list_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ class SnapshotsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`snapshots` attribute. """ @@ -58,10 +57,12 @@ class SnapshotsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -72,14 +73,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: :return: An iterator like instance of either Snapshot or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) @@ -154,14 +155,14 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy :type resource_group_name: str :return: An iterator like instance of either Snapshot or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) @@ -238,7 +239,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -253,7 +254,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -305,12 +306,12 @@ async def create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -339,7 +340,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -362,9 +363,9 @@ async def create_or_update( :type resource_name: str :param parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -379,7 +380,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -443,12 +444,12 @@ async def update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -477,7 +478,7 @@ async def update_tags( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -500,10 +501,10 @@ async def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -518,7 +519,7 @@ async def update_tags( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -589,7 +590,7 @@ async def delete(self, resource_group_name: str, resource_name: str, **kwargs: A _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 9ca53c5d5f93..b2c8383d16a9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,17 +33,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._trusted_access_role_bindings_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +52,7 @@ class TrustedAccessRoleBindingsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`trusted_access_role_bindings` attribute. """ @@ -60,17 +60,18 @@ class TrustedAccessRoleBindingsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.TrustedAccessRoleBinding"]: - # pylint: disable=line-too-long """List trusted access role bindings. List trusted access role bindings. @@ -83,14 +84,14 @@ def list( :return: An iterator like instance of either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) @@ -172,7 +173,7 @@ async def get( :param trusted_access_role_binding_name: The name of trusted access role binding. Required. :type trusted_access_role_binding_name: str :return: TrustedAccessRoleBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -187,7 +188,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) @@ -240,7 +241,7 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -302,7 +303,6 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: - # pylint: disable=line-too-long """Create or update a trusted access role binding. Create or update a trusted access role binding. @@ -316,14 +316,14 @@ async def begin_create_or_update( :type trusted_access_role_binding_name: str :param trusted_access_role_binding: A trusted access role binding. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -338,7 +338,6 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: - # pylint: disable=line-too-long """Create or update a trusted access role binding. Create or update a trusted access role binding. @@ -358,7 +357,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -371,7 +370,6 @@ async def begin_create_or_update( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: - # pylint: disable=line-too-long """Create or update a trusted access role binding. Create or update a trusted access role binding. @@ -386,18 +384,18 @@ async def begin_create_or_update( :param trusted_access_role_binding: A trusted access role binding. Is either a TrustedAccessRoleBinding type or a IO[bytes] type. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding or IO[bytes] :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) @@ -458,7 +456,7 @@ async def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -524,7 +522,7 @@ async def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_trusted_access_roles_operations.py similarity index 85% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_trusted_access_roles_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_trusted_access_roles_operations.py index 2bf2774b3ee3..edfadaacd801 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._trusted_access_roles_operations import build_list_request +from .._configuration import ContainerServiceClientTestConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +41,7 @@ class TrustedAccessRolesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.aio.ContainerServiceClientTest`'s :attr:`trusted_access_roles` attribute. """ @@ -49,15 +49,16 @@ class TrustedAccessRolesOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAccessRole"]: - # pylint: disable=line-too-long """List supported trusted access roles. List supported trusted access roles. @@ -66,14 +67,14 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc :type location: str :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRole] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRole] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/__init__.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/__init__.py index 522f648c7fc5..b27115129ed5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/__init__.py @@ -166,6 +166,10 @@ MeshUpgradeProfile, MeshUpgradeProfileList, MeshUpgradeProfileProperties, + Namespace, + NamespaceListResult, + NamespaceProperties, + NetworkPolicies, NetworkProfileForSnapshot, NodeImageVersion, NodeImageVersionsListResult, @@ -187,6 +191,7 @@ RebalanceLoadBalancersRequestBody, RelativeMonthlySchedule, Resource, + ResourceQuota, ResourceReference, RunCommandRequest, RunCommandResult, @@ -219,8 +224,10 @@ WindowsGmsaProfile, ) -from ._container_service_client_enums import ( # type: ignore +from ._container_service_client_test_enums import ( # type: ignore AddonAutoscaling, + AdoptionPolicy, + AdvancedNetworkPolicies, AgentPoolMode, AgentPoolSSHAccess, AgentPoolType, @@ -230,6 +237,7 @@ Code, ConnectionStatus, CreatedByType, + DeletePolicy, DriverType, Expander, ExtendedLocationTypes, @@ -249,6 +257,7 @@ ManagedClusterSKUName, ManagedClusterSKUTier, Mode, + NamespaceProvisioningState, NetworkDataplane, NetworkMode, NetworkPlugin, @@ -264,6 +273,7 @@ OutboundType, PodIPAllocationMode, PodLinkLocalAccess, + PolicyRule, PrivateEndpointConnectionProvisioningState, Protocol, PublicNetworkAccess, @@ -276,6 +286,7 @@ SeccompDefault, ServiceMeshMode, SnapshotType, + TransitEncryption, TrustedAccessRoleBindingProvisioningState, Type, UndrainableNodeBehavior, @@ -440,6 +451,10 @@ "MeshUpgradeProfile", "MeshUpgradeProfileList", "MeshUpgradeProfileProperties", + "Namespace", + "NamespaceListResult", + "NamespaceProperties", + "NetworkPolicies", "NetworkProfileForSnapshot", "NodeImageVersion", "NodeImageVersionsListResult", @@ -461,6 +476,7 @@ "RebalanceLoadBalancersRequestBody", "RelativeMonthlySchedule", "Resource", + "ResourceQuota", "ResourceReference", "RunCommandRequest", "RunCommandResult", @@ -492,6 +508,8 @@ "WeeklySchedule", "WindowsGmsaProfile", "AddonAutoscaling", + "AdoptionPolicy", + "AdvancedNetworkPolicies", "AgentPoolMode", "AgentPoolSSHAccess", "AgentPoolType", @@ -501,6 +519,7 @@ "Code", "ConnectionStatus", "CreatedByType", + "DeletePolicy", "DriverType", "Expander", "ExtendedLocationTypes", @@ -520,6 +539,7 @@ "ManagedClusterSKUName", "ManagedClusterSKUTier", "Mode", + "NamespaceProvisioningState", "NetworkDataplane", "NetworkMode", "NetworkPlugin", @@ -535,6 +555,7 @@ "OutboundType", "PodIPAllocationMode", "PodLinkLocalAccess", + "PolicyRule", "PrivateEndpointConnectionProvisioningState", "Protocol", "PublicNetworkAccess", @@ -547,6 +568,7 @@ "SeccompDefault", "ServiceMeshMode", "SnapshotType", + "TransitEncryption", "TrustedAccessRoleBindingProvisioningState", "Type", "UndrainableNodeBehavior", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_container_service_client_test_enums.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_container_service_client_enums.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_container_service_client_test_enums.py index 5eb58d78d105..d1a019a7f919 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_container_service_client_test_enums.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -20,6 +21,35 @@ class AddonAutoscaling(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Feature to autoscale AKS-managed add-ons is disabled.""" +class AdoptionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Action if Kubernetes namespace with same name already exists.""" + + NEVER = "Never" + """If the namespace already exists in Kubernetes, attempts to create that same namespace in ARM + will fail.""" + IF_IDENTICAL = "IfIdentical" + """Take over the existing namespace to be managed by ARM, if there is no difference.""" + ALWAYS = "Always" + """Always take over the existing namespace to be managed by ARM, some fields might be overwritten.""" + + +class AdvancedNetworkPolicies(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This allows users to configure Layer 7 network policies (FQDN, HTTP, Kafka). Policies + themselves must be configured via the Cilium Network Policy resources, see + https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on + cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set + to true. + """ + + L7 = "L7" + """Enable Layer7 network policies (FQDN, HTTP/S, Kafka). This option is a superset of the FQDN + option.""" + FQDN = "FQDN" + """Enable FQDN based network policies""" + NONE = "None" + """Disable Layer 7 network policies (FQDN, HTTP/S, Kafka)""" + + class AgentPoolMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: @@ -115,6 +145,16 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KEY = "Key" +class DeletePolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delete options of a namespace.""" + + KEEP = "Keep" + """Only delete the ARM resource, keep the Kubernetes namespace. Also delete the ManagedByARM + label.""" + DELETE = "Delete" + """Delete both the ARM resource and the Kubernetes namespace together.""" + + class DriverType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specify the type of GPU driver to install when creating Windows agent pools. If not provided, AKS selects the driver based on system compatibility. This cannot be changed once the AgentPool @@ -338,6 +378,17 @@ class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IPVS proxy mode. Must be using Kubernetes version >= 1.22.""" +class NamespaceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of the namespace.""" + + UPDATING = "Updating" + DELETING = "Deleting" + CREATING = "Creating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + + class NetworkDataplane(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Network dataplane used in the Kubernetes cluster.""" @@ -580,6 +631,17 @@ class PodLinkLocalAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Pods with hostNetwork=false cannot access Azure Instance Metadata Service (IMDS).""" +class PolicyRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum representing different network policy rules.""" + + DENY_ALL = "DenyAll" + """Deny all network traffic.""" + ALLOW_ALL = "AllowAll" + """Allow all network traffic.""" + ALLOW_SAME_NAMESPACE = "AllowSameNamespace" + """Allow traffic within the same namespace.""" + + class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current provisioning state.""" @@ -712,6 +774,15 @@ class SnapshotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The snapshot is a snapshot of a managed cluster.""" +class TransitEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This can be enabled only on Cilium-based clusters. If not specified, the default value is None.""" + + WIRE_GUARD = "WireGuard" + """Enable WireGuard encryption for cluster traffic""" + NONE = "None" + """Disable WireGuard encryption for cluster traffic""" + + class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current provisioning state of trusted access role binding.""" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_models_py3.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_models_py3.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_models_py3.py index b0186764338f..93f23637ed55 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_models_py3.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,13 +7,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping import datetime from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models +JSON = MutableMapping[str, Any] class AbsoluteMonthlySchedule(_serialization.Model): @@ -62,10 +64,10 @@ class AdvancedNetworking(_serialization.Model): :ivar observability: Observability profile to enable advanced network metrics and flow logs with historical contexts. :vartype observability: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AdvancedNetworkingObservability - :ivar security: Security profile to enable security features on cilium based cluster. + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworkingObservability + :ivar security: Security profile to enable security features on cilium-based cluster. :vartype security: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AdvancedNetworkingSecurity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworkingSecurity """ _attribute_map = { @@ -91,10 +93,10 @@ def __init__( :keyword observability: Observability profile to enable advanced network metrics and flow logs with historical contexts. :paramtype observability: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AdvancedNetworkingObservability - :keyword security: Security profile to enable security features on cilium based cluster. + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworkingObservability + :keyword security: Security profile to enable security features on cilium-based cluster. :paramtype security: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AdvancedNetworkingSecurity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworkingSecurity """ super().__init__(**kwargs) self.enabled = enabled @@ -126,25 +128,58 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: class AdvancedNetworkingSecurity(_serialization.Model): - """Security profile to enable security features on cilium based cluster. + """Security profile to enable security features on cilium-based cluster. - :ivar enabled: This feature allows user to configure network policy based on DNS (FQDN) names. - It can be enabled only on cilium based clusters. If not specified, the default is false. + :ivar enabled: Configure Advanced Networking Security features on Cilium clusters. See + individual fields for their default values. :vartype enabled: bool + :ivar advanced_network_policies: This allows users to configure Layer 7 network policies (FQDN, + HTTP, Kafka). Policies themselves must be configured via the Cilium Network Policy resources, + see https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on + cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set + to true. Known values are: "L7", "FQDN", and "None". + :vartype advanced_network_policies: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworkPolicies + :ivar transit_encryption: This can be enabled only on Cilium-based clusters. If not specified, + the default value is None. Known values are: "WireGuard" and "None". + :vartype transit_encryption: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TransitEncryption """ _attribute_map = { "enabled": {"key": "enabled", "type": "bool"}, + "advanced_network_policies": {"key": "advancedNetworkPolicies", "type": "str"}, + "transit_encryption": {"key": "transitEncryption", "type": "str"}, } - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + enabled: Optional[bool] = None, + advanced_network_policies: Optional[Union[str, "_models.AdvancedNetworkPolicies"]] = None, + transit_encryption: Optional[Union[str, "_models.TransitEncryption"]] = None, + **kwargs: Any + ) -> None: """ - :keyword enabled: This feature allows user to configure network policy based on DNS (FQDN) - names. It can be enabled only on cilium based clusters. If not specified, the default is false. + :keyword enabled: Configure Advanced Networking Security features on Cilium clusters. See + individual fields for their default values. :paramtype enabled: bool + :keyword advanced_network_policies: This allows users to configure Layer 7 network policies + (FQDN, HTTP, Kafka). Policies themselves must be configured via the Cilium Network Policy + resources, see https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled + only on cilium-based clusters. If not specified, the default value is FQDN if security.enabled + is set to true. Known values are: "L7", "FQDN", and "None". + :paramtype advanced_network_policies: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworkPolicies + :keyword transit_encryption: This can be enabled only on Cilium-based clusters. If not + specified, the default value is None. Known values are: "WireGuard" and "None". + :paramtype transit_encryption: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TransitEncryption """ super().__init__(**kwargs) self.enabled = enabled + self.advanced_network_policies = advanced_network_policies + self.transit_encryption = transit_encryption class SubResource(_serialization.Model): @@ -176,9 +211,9 @@ class SubResource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None class AgentPool(SubResource): @@ -216,15 +251,15 @@ class AgentPool(SubResource): `_. Known values are: "Managed" and "Ephemeral". :vartype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSDiskType :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :vartype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletDiskType :ivar workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer", "WasmWasi", and "KataMshvVmIsolation". :vartype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WorkloadRuntime :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -233,27 +268,27 @@ class AgentPool(SubResource): :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype vnet_subnet_id: str :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype pod_subnet_id: str :ivar pod_ip_allocation_mode: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values are: "DynamicIndividual" and "StaticBlock". :vartype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodIPAllocationMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodIPAllocationMode :ivar max_pods: The maximum number of pods that can run on a node. :vartype max_pods: int :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :ivar max_count: The maximum number of nodes for auto-scaling. :vartype max_count: int :ivar min_count: The minimum number of nodes for auto-scaling. @@ -263,16 +298,16 @@ class AgentPool(SubResource): :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :vartype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleDownMode :ivar type_properties_type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". :vartype type_properties_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolType :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", and "Gateway". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolMode :ivar orchestrator_version: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created @@ -291,14 +326,14 @@ class AgentPool(SubResource): :vartype node_image_version: str :ivar upgrade_settings: Settings for upgrading the agentpool. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :vartype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :vartype availability_zones: list[str] @@ -315,16 +350,16 @@ class AgentPool(SubResource): stores. Defaults to false. :vartype enable_custom_ca_trust: bool :ivar node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :vartype node_public_ip_prefix_id: str :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :vartype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetPriority :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :vartype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetEvictionPolicy :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -346,9 +381,9 @@ class AgentPool(SubResource): :ivar proximity_placement_group_id: The ID for Proximity Placement Group. :vartype proximity_placement_group_id: str :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletConfig + :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletConfig :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LinuxOSConfig + :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LinuxOSConfig :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -362,45 +397,45 @@ class AgentPool(SubResource): :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :vartype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GPUInstanceProfile :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :vartype capacity_reservation_group_id: str :ivar host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :vartype host_group_id: str :ivar windows_profile: The Windows agent pool's specific profile. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolWindowsProfile :ivar network_profile: Network-related settings of an agent pool. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolNetworkProfile :ivar security_profile: The security settings of an agent pool. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSecurityProfile :ivar gpu_profile: The GPU settings of an agent pool. :vartype gpu_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGPUProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGPUProfile :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolArtifactStreamingProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolArtifactStreamingProfile :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. :vartype virtual_machines_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachinesProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachinesProfile :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. :vartype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachineNodes] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachineNodes] :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. :vartype gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGatewayProfile :ivar status: Contains read-only information about the Agent Pool. - :vartype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolStatus + :vartype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolStatus """ _validation = { @@ -558,15 +593,15 @@ def __init__( # pylint: disable=too-many-locals `_. Known values are: "Managed" and "Ephemeral". :paramtype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSDiskType :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :paramtype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletDiskType :keyword workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer", "WasmWasi", and "KataMshvVmIsolation". :paramtype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WorkloadRuntime :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -575,27 +610,27 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype vnet_subnet_id: str :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype pod_subnet_id: str :keyword pod_ip_allocation_mode: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values are: "DynamicIndividual" and "StaticBlock". :paramtype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodIPAllocationMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodIPAllocationMode :keyword max_pods: The maximum number of pods that can run on a node. :paramtype max_pods: int :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :keyword max_count: The maximum number of nodes for auto-scaling. :paramtype max_count: int :keyword min_count: The minimum number of nodes for auto-scaling. @@ -605,16 +640,16 @@ def __init__( # pylint: disable=too-many-locals :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :paramtype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleDownMode :keyword type_properties_type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". :paramtype type_properties_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolType :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", and "Gateway". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolMode :keyword orchestrator_version: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created @@ -627,12 +662,12 @@ def __init__( # pylint: disable=too-many-locals :paramtype orchestrator_version: str :keyword upgrade_settings: Settings for upgrading the agentpool. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeSettings :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :paramtype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :paramtype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :keyword availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :paramtype availability_zones: list[str] @@ -640,7 +675,7 @@ def __init__( # pylint: disable=too-many-locals their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node - `_. # pylint: disable=line-too-long + `_. The default is false. :paramtype enable_node_public_ip: bool :keyword enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that @@ -649,16 +684,16 @@ def __init__( # pylint: disable=too-many-locals stores. Defaults to false. :paramtype enable_custom_ca_trust: bool :keyword node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :paramtype node_public_ip_prefix_id: str :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :paramtype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetPriority :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :paramtype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetEvictionPolicy :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -681,10 +716,10 @@ def __init__( # pylint: disable=too-many-locals :paramtype proximity_placement_group_id: str :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. :paramtype kubelet_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletConfig :keyword linux_os_config: The OS configuration of Linux agent nodes. :paramtype linux_os_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LinuxOSConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LinuxOSConfig :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -699,48 +734,48 @@ def __init__( # pylint: disable=too-many-locals profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :paramtype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GPUInstanceProfile :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :paramtype capacity_reservation_group_id: str :keyword host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :paramtype host_group_id: str :keyword windows_profile: The Windows agent pool's specific profile. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolWindowsProfile :keyword network_profile: Network-related settings of an agent pool. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolNetworkProfile :keyword security_profile: The security settings of an agent pool. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSecurityProfile :keyword gpu_profile: The GPU settings of an agent pool. :paramtype gpu_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGPUProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGPUProfile :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolArtifactStreamingProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolArtifactStreamingProfile :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. :paramtype virtual_machines_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachinesProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachinesProfile :keyword virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. :paramtype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachineNodes] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachineNodes] :keyword gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. :paramtype gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGatewayProfile :keyword status: Contains read-only information about the Agent Pool. - :paramtype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolStatus + :paramtype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolStatus """ super().__init__(**kwargs) - self.e_tag = None + self.e_tag: Optional[str] = None self.count = count self.vm_size = vm_size self.os_disk_size_gb = os_disk_size_gb @@ -761,10 +796,10 @@ def __init__( # pylint: disable=too-many-locals self.type_properties_type = type_properties_type self.mode = mode self.orchestrator_version = orchestrator_version - self.current_orchestrator_version = None - self.node_image_version = None + self.current_orchestrator_version: Optional[str] = None + self.node_image_version: Optional[str] = None self.upgrade_settings = upgrade_settings - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.power_state = power_state self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip @@ -835,7 +870,7 @@ class AgentPoolAvailableVersions(_serialization.Model): :vartype type: str :ivar agent_pool_versions: List of versions available for agent pool. :vartype agent_pool_versions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ _validation = { @@ -863,12 +898,12 @@ def __init__( """ :keyword agent_pool_versions: List of versions available for agent pool. :paramtype agent_pool_versions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.agent_pool_versions = agent_pool_versions @@ -985,7 +1020,7 @@ class AgentPoolGPUProfile(_serialization.Model): once the AgentPool has been created. This cannot be set on Linux AgentPools. For Linux AgentPools, the driver is selected based on system compatibility. Known values are: "GRID" and "CUDA". - :vartype driver_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.DriverType + :vartype driver_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.DriverType """ _attribute_map = { @@ -1013,7 +1048,7 @@ def __init__( AgentPools, the driver is selected based on system compatibility. Known values are: "GRID" and "CUDA". :paramtype driver_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.DriverType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.DriverType """ super().__init__(**kwargs) self.install_gpu_driver = install_gpu_driver @@ -1026,7 +1061,7 @@ class AgentPoolListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of agent pools. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -1043,11 +1078,11 @@ class AgentPoolListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.AgentPool"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of agent pools. - :paramtype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + :paramtype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AgentPoolNetworkProfile(_serialization.Model): @@ -1055,11 +1090,11 @@ class AgentPoolNetworkProfile(_serialization.Model): :ivar node_public_ip_tags: IPTags of instance-level public IPs. :vartype node_public_ip_tags: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.IPTag] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.IPTag] :ivar allowed_host_ports: The port ranges that are allowed to access. The specified ranges are allowed to overlap. :vartype allowed_host_ports: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PortRange] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PortRange] :ivar application_security_groups: The IDs of the application security groups which agent pool will associate when created. :vartype application_security_groups: list[str] @@ -1082,11 +1117,11 @@ def __init__( """ :keyword node_public_ip_tags: IPTags of instance-level public IPs. :paramtype node_public_ip_tags: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.IPTag] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.IPTag] :keyword allowed_host_ports: The port ranges that are allowed to access. The specified ranges are allowed to overlap. :paramtype allowed_host_ports: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PortRange] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PortRange] :keyword application_security_groups: The IDs of the application security groups which agent pool will associate when created. :paramtype application_security_groups: list[str] @@ -1103,7 +1138,7 @@ class AgentPoolSecurityProfile(_serialization.Model): :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and "Disabled". :vartype ssh_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSSHAccess + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSSHAccess :ivar enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. @@ -1132,7 +1167,7 @@ def __init__( :keyword ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and "Disabled". :paramtype ssh_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSSHAccess + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSSHAccess :keyword enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. @@ -1156,7 +1191,7 @@ class AgentPoolStatus(_serialization.Model): :ivar provisioning_error: Preserves the detailed info of failure. If there was no error, this field is omitted. :vartype provisioning_error: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.CloudErrorBody + ~azure.mgmt.containerservice.v2025_02_02_preview.models.CloudErrorBody """ _validation = { @@ -1170,7 +1205,7 @@ class AgentPoolStatus(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_error = None + self.provisioning_error: Optional["_models.CloudErrorBody"] = None class AgentPoolUpgradeProfile(_serialization.Model): @@ -1190,13 +1225,13 @@ class AgentPoolUpgradeProfile(_serialization.Model): :vartype kubernetes_version: str :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :ivar upgrades: List of orchestrator types and versions available for upgrade. :vartype upgrades: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] :ivar components_by_releases: List of components grouped by kubernetes major.minor version. :vartype components_by_releases: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ComponentsByRelease] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ComponentsByRelease] :ivar latest_node_image_version: The latest AKS supported node image version. :vartype latest_node_image_version: str """ @@ -1235,20 +1270,20 @@ def __init__( :paramtype kubernetes_version: str :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :keyword upgrades: List of orchestrator types and versions available for upgrade. :paramtype upgrades: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] :keyword components_by_releases: List of components grouped by kubernetes major.minor version. :paramtype components_by_releases: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ComponentsByRelease] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ComponentsByRelease] :keyword latest_node_image_version: The latest AKS supported node image version. :paramtype latest_node_image_version: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.kubernetes_version = kubernetes_version self.os_type = os_type self.upgrades = upgrades @@ -1332,7 +1367,7 @@ class AgentPoolUpgradeSettings(_serialization.Model): still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" and "Schedule". :vartype undrainable_node_behavior: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UndrainableNodeBehavior + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UndrainableNodeBehavior """ _validation = { @@ -1395,7 +1430,7 @@ def __init__( is still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" and "Schedule". :paramtype undrainable_node_behavior: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UndrainableNodeBehavior + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UndrainableNodeBehavior """ super().__init__(**kwargs) self.max_surge = max_surge @@ -1433,76 +1468,42 @@ def __init__(self, *, disable_outbound_nat: Optional[bool] = None, **kwargs: Any class AutoScaleProfile(_serialization.Model): """Specifications on auto-scaling. - :ivar sizes: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', - 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is - unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. - :vartype sizes: list[str] + :ivar size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + 'Standard_E16s_v3' or 'Standard_D16s_v5'. + :vartype size: str :ivar min_count: The minimum number of nodes of the specified sizes. :vartype min_count: int :ivar max_count: The maximum number of nodes of the specified sizes. :vartype max_count: int - :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine - in the master/agent pool. If you specify 0, it will apply the default osDisk size according to - the vmSize specified. - :vartype os_disk_size_gb: int - :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Known values are: - "Managed" and "Ephemeral". - :vartype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType """ - _validation = { - "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, - } - _attribute_map = { - "sizes": {"key": "sizes", "type": "[str]"}, + "size": {"key": "size", "type": "str"}, "min_count": {"key": "minCount", "type": "int"}, "max_count": {"key": "maxCount", "type": "int"}, - "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, - "os_disk_type": {"key": "osDiskType", "type": "str"}, } def __init__( self, *, - sizes: Optional[List[str]] = None, + size: Optional[str] = None, min_count: Optional[int] = None, max_count: Optional[int] = None, - os_disk_size_gb: Optional[int] = None, - os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, **kwargs: Any ) -> None: """ - :keyword sizes: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', - 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is - unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. - :paramtype sizes: list[str] + :keyword size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + 'Standard_E16s_v3' or 'Standard_D16s_v5'. + :paramtype size: str :keyword min_count: The minimum number of nodes of the specified sizes. :paramtype min_count: int :keyword max_count: The maximum number of nodes of the specified sizes. :paramtype max_count: int - :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :paramtype os_disk_size_gb: int - :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Known values are: - "Managed" and "Ephemeral". - :paramtype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType """ super().__init__(**kwargs) - self.sizes = sizes + self.size = size self.min_count = min_count self.max_count = max_count - self.os_disk_size_gb = os_disk_size_gb - self.os_disk_type = os_disk_type class AzureKeyVaultKms(_serialization.Model): @@ -1511,7 +1512,7 @@ class AzureKeyVaultKms(_serialization.Model): :ivar enabled: Whether to enable Azure Key Vault key management service. The default is false. :vartype enabled: bool :ivar key_id: Identifier of Azure Key Vault key. See `key identifier format - `_ # pylint: disable=line-too-long + `_ for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. @@ -1521,7 +1522,7 @@ class AzureKeyVaultKms(_serialization.Model): ``Private`` means the key vault disables public access and enables private link. The default value is ``Public``. Known values are: "Public" and "Private". :vartype key_vault_network_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KeyVaultNetworkAccessTypes + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KeyVaultNetworkAccessTypes :ivar key_vault_resource_id: Resource ID of key vault. When keyVaultNetworkAccess is ``Private``\\ , this field is required and must be a valid resource ID. When keyVaultNetworkAccess is ``Public``\\ , leave the field empty. @@ -1549,7 +1550,7 @@ def __init__( false. :paramtype enabled: bool :keyword key_id: Identifier of Azure Key Vault key. See `key identifier format - `_ # pylint: disable=line-too-long + `_ for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. @@ -1559,7 +1560,7 @@ def __init__( networks. ``Private`` means the key vault disables public access and enables private link. The default value is ``Public``. Known values are: "Public" and "Private". :paramtype key_vault_network_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KeyVaultNetworkAccessTypes + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KeyVaultNetworkAccessTypes :keyword key_vault_resource_id: Resource ID of key vault. When keyVaultNetworkAccess is ``Private``\\ , this field is required and must be a valid resource ID. When keyVaultNetworkAccess is ``Public``\\ , leave the field empty. @@ -1585,7 +1586,7 @@ class CloudErrorBody(_serialization.Model): error. :vartype target: str :ivar details: A list of additional details about the error. - :vartype details: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.CloudErrorBody] + :vartype details: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.CloudErrorBody] """ _attribute_map = { @@ -1616,7 +1617,7 @@ def __init__( :paramtype target: str :keyword details: A list of additional details about the error. :paramtype details: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.CloudErrorBody] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.CloudErrorBody] """ super().__init__(**kwargs) self.code = code @@ -1630,7 +1631,7 @@ class ClusterUpgradeSettings(_serialization.Model): :ivar override_settings: Settings for overrides. :vartype override_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UpgradeOverrideSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UpgradeOverrideSettings """ _attribute_map = { @@ -1641,7 +1642,7 @@ def __init__(self, *, override_settings: Optional["_models.UpgradeOverrideSettin """ :keyword override_settings: Settings for overrides. :paramtype override_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UpgradeOverrideSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UpgradeOverrideSettings """ super().__init__(**kwargs) self.override_settings = override_settings @@ -1682,7 +1683,7 @@ class Component(_serialization.Model): :vartype version: str :ivar has_breaking_changes: If upgraded component version contains breaking changes from the current version. To see a detailed description of what the breaking changes are, visit - https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. # pylint: disable=line-too-long + https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. :vartype has_breaking_changes: bool """ @@ -1707,7 +1708,7 @@ def __init__( :paramtype version: str :keyword has_breaking_changes: If upgraded component version contains breaking changes from the current version. To see a detailed description of what the breaking changes are, visit - https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. # pylint: disable=line-too-long + https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. :paramtype has_breaking_changes: bool """ super().__init__(**kwargs) @@ -1722,7 +1723,7 @@ class ComponentsByRelease(_serialization.Model): :ivar kubernetes_version: The Kubernetes version (major.minor). :vartype kubernetes_version: str :ivar components: components of current or upgraded Kubernetes version in the cluster. - :vartype components: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.Component] + :vartype components: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Component] """ _attribute_map = { @@ -1741,7 +1742,7 @@ def __init__( :keyword kubernetes_version: The Kubernetes version (major.minor). :paramtype kubernetes_version: str :keyword components: components of current or upgraded Kubernetes version in the cluster. - :paramtype components: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.Component] + :paramtype components: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Component] """ super().__init__(**kwargs) self.kubernetes_version = kubernetes_version @@ -1757,7 +1758,7 @@ class ContainerServiceLinuxProfile(_serialization.Model): :vartype admin_username: str :ivar ssh: The SSH configuration for Linux-based VMs running on Azure. Required. :vartype ssh: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceSshConfiguration + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceSshConfiguration """ _validation = { @@ -1776,7 +1777,7 @@ def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConf :paramtype admin_username: str :keyword ssh: The SSH configuration for Linux-based VMs running on Azure. Required. :paramtype ssh: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceSshConfiguration + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceSshConfiguration """ super().__init__(**kwargs) self.admin_username = admin_username @@ -1789,23 +1790,23 @@ class ContainerServiceNetworkProfile(_serialization.Model): :ivar network_plugin: Network plugin used for building the Kubernetes network. Known values are: "azure", "kubenet", and "none". :vartype network_plugin: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPlugin + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPlugin :ivar network_plugin_mode: Network plugin mode used for building the Kubernetes network. "overlay" :vartype network_plugin_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPluginMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPluginMode :ivar network_policy: Network policy used for building the Kubernetes network. Known values are: "none", "calico", "azure", and "cilium". :vartype network_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPolicy :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Known values are: "transparent" and "bridge". :vartype network_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkMode :ivar network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: "azure" and "cilium". :vartype network_dataplane: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkDataplane + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkDataplane :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. :vartype pod_cidr: str :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must @@ -1819,22 +1820,22 @@ class ContainerServiceNetworkProfile(_serialization.Model): `_. Known values are: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". :vartype outbound_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OutboundType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OutboundType :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Known values are: "standard" and "basic". :vartype load_balancer_sku: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancerSku + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancerSku :ivar load_balancer_profile: Profile of the cluster load balancer. :vartype load_balancer_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfile :ivar nat_gateway_profile: Profile of the cluster NAT gateway. :vartype nat_gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterNATGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterNATGatewayProfile :ivar static_egress_gateway_profile: The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. :vartype static_egress_gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStaticEgressGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStaticEgressGatewayProfile :ivar pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. :vartype pod_cidrs: list[str] @@ -1846,23 +1847,23 @@ class ContainerServiceNetworkProfile(_serialization.Model): single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. :vartype ip_families: list[str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IPFamily] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IPFamily] :ivar pod_link_local_access: Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for pods with hostNetwork=false. if not specified, the default is 'IMDS'. Known values are: "IMDS" and "None". :vartype pod_link_local_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodLinkLocalAccess + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodLinkLocalAccess :ivar kube_proxy_config: Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. See https://v\\ :code:``.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where :code:`` is represented by a :code:``-\\ :code:`` string. Kubernetes version 1.23 would be '1-23'. :vartype kube_proxy_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig :ivar advanced_networking: Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. :vartype advanced_networking: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AdvancedNetworking + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworking """ _validation = { @@ -1926,23 +1927,23 @@ def __init__( :keyword network_plugin: Network plugin used for building the Kubernetes network. Known values are: "azure", "kubenet", and "none". :paramtype network_plugin: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPlugin + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPlugin :keyword network_plugin_mode: Network plugin mode used for building the Kubernetes network. "overlay" :paramtype network_plugin_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPluginMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPluginMode :keyword network_policy: Network policy used for building the Kubernetes network. Known values are: "none", "calico", "azure", and "cilium". :paramtype network_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPolicy :keyword network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Known values are: "transparent" and "bridge". :paramtype network_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkMode :keyword network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: "azure" and "cilium". :paramtype network_dataplane: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkDataplane + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkDataplane :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. :paramtype pod_cidr: str :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It @@ -1956,22 +1957,22 @@ def __init__( `_. Known values are: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". :paramtype outbound_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OutboundType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OutboundType :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Known values are: "standard" and "basic". :paramtype load_balancer_sku: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancerSku + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancerSku :keyword load_balancer_profile: Profile of the cluster load balancer. :paramtype load_balancer_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfile :keyword nat_gateway_profile: Profile of the cluster NAT gateway. :paramtype nat_gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterNATGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterNATGatewayProfile :keyword static_egress_gateway_profile: The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. :paramtype static_egress_gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStaticEgressGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStaticEgressGatewayProfile :keyword pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. :paramtype pod_cidrs: list[str] @@ -1983,23 +1984,23 @@ def __init__( For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. :paramtype ip_families: list[str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IPFamily] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IPFamily] :keyword pod_link_local_access: Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for pods with hostNetwork=false. if not specified, the default is 'IMDS'. Known values are: "IMDS" and "None". :paramtype pod_link_local_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodLinkLocalAccess + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodLinkLocalAccess :keyword kube_proxy_config: Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. See https://v\\ :code:``.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where :code:`` is represented by a :code:``-\\ :code:`` string. Kubernetes version 1.23 would be '1-23'. :paramtype kube_proxy_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig :keyword advanced_networking: Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. :paramtype advanced_networking: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AdvancedNetworking + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdvancedNetworking """ super().__init__(**kwargs) self.network_plugin = network_plugin @@ -2035,11 +2036,11 @@ class ContainerServiceNetworkProfileKubeProxyConfig(_serialization.Model): # py :vartype enabled: bool :ivar mode: Specify which proxy mode to use ('IPTABLES' or 'IPVS'). Known values are: "IPTABLES" and "IPVS". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Mode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Mode :ivar ipvs_config: Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. :vartype ipvs_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig """ _attribute_map = { @@ -2062,11 +2063,11 @@ def __init__( :paramtype enabled: bool :keyword mode: Specify which proxy mode to use ('IPTABLES' or 'IPVS'). Known values are: "IPTABLES" and "IPVS". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Mode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Mode :keyword ipvs_config: Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. :paramtype ipvs_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig """ super().__init__(**kwargs) self.enabled = enabled @@ -2081,7 +2082,7 @@ class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_serialization.Mod http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and "LeastConnection". :vartype scheduler: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IpvsScheduler + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IpvsScheduler :ivar tcp_timeout_seconds: The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. :vartype tcp_timeout_seconds: int @@ -2114,7 +2115,7 @@ def __init__( http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and "LeastConnection". :paramtype scheduler: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IpvsScheduler + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IpvsScheduler :keyword tcp_timeout_seconds: The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. :paramtype tcp_timeout_seconds: int @@ -2140,7 +2141,7 @@ class ContainerServiceSshConfiguration(_serialization.Model): :ivar public_keys: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. Required. :vartype public_keys: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceSshPublicKey] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceSshPublicKey] """ _validation = { @@ -2156,7 +2157,7 @@ def __init__(self, *, public_keys: List["_models.ContainerServiceSshPublicKey"], :keyword public_keys: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. Required. :paramtype public_keys: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceSshPublicKey] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceSshPublicKey] """ super().__init__(**kwargs) self.public_keys = public_keys @@ -2236,8 +2237,8 @@ class CredentialResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[bytes] = None class CredentialResults(_serialization.Model): @@ -2247,7 +2248,7 @@ class CredentialResults(_serialization.Model): :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. :vartype kubeconfigs: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResult] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResult] """ _validation = { @@ -2261,7 +2262,7 @@ class CredentialResults(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.kubeconfigs = None + self.kubeconfigs: Optional[List["_models.CredentialResult"]] = None class DailySchedule(_serialization.Model): @@ -2378,7 +2379,7 @@ class EndpointDependency(_serialization.Model): :vartype domain_name: str :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. :vartype endpoint_details: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.EndpointDetail] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.EndpointDetail] """ _attribute_map = { @@ -2398,7 +2399,7 @@ def __init__( :paramtype domain_name: str :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. :paramtype endpoint_details: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.EndpointDetail] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.EndpointDetail] """ super().__init__(**kwargs) self.domain_name = domain_name @@ -2475,8 +2476,8 @@ class ErrorAdditionalInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.info = None + self.type: Optional[str] = None + self.info: Optional[JSON] = None class ErrorDetail(_serialization.Model): @@ -2491,10 +2492,10 @@ class ErrorDetail(_serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ErrorDetail] + :vartype details: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ErrorDetail] :ivar additional_info: The error additional info. :vartype additional_info: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ErrorAdditionalInfo] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ErrorAdditionalInfo] """ _validation = { @@ -2516,11 +2517,11 @@ class ErrorDetail(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None + self.details: Optional[List["_models.ErrorDetail"]] = None + self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None class ErrorResponse(_serialization.Model): @@ -2528,7 +2529,7 @@ class ErrorResponse(_serialization.Model): operations. (This also follows the OData error response format.). :ivar error: The error object. - :vartype error: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ErrorDetail + :vartype error: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ErrorDetail """ _attribute_map = { @@ -2538,7 +2539,7 @@ class ErrorResponse(_serialization.Model): def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. - :paramtype error: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ErrorDetail + :paramtype error: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ErrorDetail """ super().__init__(**kwargs) self.error = error @@ -2551,7 +2552,7 @@ class ExtendedLocation(_serialization.Model): :vartype name: str :ivar type: The type of the extended location. "EdgeZone" :vartype type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ExtendedLocationTypes + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ExtendedLocationTypes """ _attribute_map = { @@ -2571,7 +2572,7 @@ def __init__( :paramtype name: str :keyword type: The type of the extended location. "EdgeZone" :paramtype type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ExtendedLocationTypes + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ExtendedLocationTypes """ super().__init__(**kwargs) self.name = name @@ -2584,7 +2585,7 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2593,7 +2594,7 @@ class Resource(_serialization.Model): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData """ _validation = { @@ -2613,10 +2614,10 @@ class Resource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None class GuardrailsAvailableVersion(Resource): @@ -2627,7 +2628,7 @@ class GuardrailsAvailableVersion(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2636,10 +2637,10 @@ class GuardrailsAvailableVersion(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar properties: Whether the version is default or not and support info. Required. :vartype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersionsProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersionsProperties """ _validation = { @@ -2662,7 +2663,7 @@ def __init__(self, *, properties: "_models.GuardrailsAvailableVersionsProperties """ :keyword properties: Whether the version is default or not and support info. Required. :paramtype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersionsProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersionsProperties """ super().__init__(**kwargs) self.properties = properties @@ -2675,7 +2676,7 @@ class GuardrailsAvailableVersionsList(_serialization.Model): :ivar value: Array of AKS supported Guardrails versions. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersion] :ivar next_link: The URL to get the next Guardrails available version. :vartype next_link: str """ @@ -2693,11 +2694,11 @@ def __init__(self, *, value: Optional[List["_models.GuardrailsAvailableVersion"] """ :keyword value: Array of AKS supported Guardrails versions. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersion] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class GuardrailsAvailableVersionsProperties(_serialization.Model): @@ -2710,7 +2711,7 @@ class GuardrailsAvailableVersionsProperties(_serialization.Model): :ivar support: Whether the version is preview or stable. Known values are: "Preview" and "Stable". :vartype support: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsSupport + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsSupport """ _validation = { @@ -2726,8 +2727,8 @@ class GuardrailsAvailableVersionsProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.is_default_version = None - self.support = None + self.is_default_version: Optional[bool] = None + self.support: Optional[Union[str, "_models.GuardrailsSupport"]] = None class IPTag(_serialization.Model): @@ -2762,7 +2763,7 @@ class IstioCertificateAuthority(_serialization.Model): :ivar plugin: Plugin certificates information for Service Mesh. :vartype plugin: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioPluginCertificateAuthority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioPluginCertificateAuthority """ _attribute_map = { @@ -2773,7 +2774,7 @@ def __init__(self, *, plugin: Optional["_models.IstioPluginCertificateAuthority" """ :keyword plugin: Plugin certificates information for Service Mesh. :paramtype plugin: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioPluginCertificateAuthority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioPluginCertificateAuthority """ super().__init__(**kwargs) self.plugin = plugin @@ -2784,10 +2785,10 @@ class IstioComponents(_serialization.Model): :ivar ingress_gateways: Istio ingress gateways. :vartype ingress_gateways: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioIngressGateway] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioIngressGateway] :ivar egress_gateways: Istio egress gateways. :vartype egress_gateways: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioEgressGateway] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioEgressGateway] """ _attribute_map = { @@ -2805,10 +2806,10 @@ def __init__( """ :keyword ingress_gateways: Istio ingress gateways. :paramtype ingress_gateways: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioIngressGateway] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioIngressGateway] :keyword egress_gateways: Istio egress gateways. :paramtype egress_gateways: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioEgressGateway] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioEgressGateway] """ super().__init__(**kwargs) self.ingress_gateways = ingress_gateways @@ -2883,7 +2884,7 @@ class IstioIngressGateway(_serialization.Model): :ivar mode: Mode of an ingress gateway. Required. Known values are: "External" and "Internal". :vartype mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioIngressGatewayMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioIngressGatewayMode :ivar enabled: Whether to enable the ingress gateway. Required. :vartype enabled: bool """ @@ -2903,7 +2904,7 @@ def __init__(self, *, mode: Union[str, "_models.IstioIngressGatewayMode"], enabl :keyword mode: Mode of an ingress gateway. Required. Known values are: "External" and "Internal". :paramtype mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioIngressGatewayMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioIngressGatewayMode :keyword enabled: Whether to enable the ingress gateway. Required. :paramtype enabled: bool """ @@ -2969,11 +2970,11 @@ class IstioServiceMesh(_serialization.Model): """Istio service mesh configuration. :ivar components: Istio components configuration. - :vartype components: ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioComponents + :vartype components: ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioComponents :ivar certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. :vartype certificate_authority: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioCertificateAuthority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioCertificateAuthority :ivar revisions: The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: @@ -3001,11 +3002,11 @@ def __init__( ) -> None: """ :keyword components: Istio components configuration. - :paramtype components: ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioComponents + :paramtype components: ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioComponents :keyword certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. :paramtype certificate_authority: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioCertificateAuthority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioCertificateAuthority :keyword revisions: The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: @@ -3060,7 +3061,7 @@ class KubeletConfig(_serialization.Model): specified, 'Unconfined' will be used by default. Known values are: "Unconfined" and "RuntimeDefault". :vartype seccomp_default: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SeccompDefault + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SeccompDefault """ _validation = { @@ -3138,7 +3139,7 @@ def __init__( not specified, 'Unconfined' will be used by default. Known values are: "Unconfined" and "RuntimeDefault". :paramtype seccomp_default: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SeccompDefault + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SeccompDefault """ super().__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy @@ -3182,14 +3183,14 @@ class KubernetesVersion(_serialization.Model): :vartype version: str :ivar capabilities: Capabilities on this Kubernetes version. :vartype capabilities: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesVersionCapabilities + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesVersionCapabilities :ivar is_default: Whether this version is default. :vartype is_default: bool :ivar is_preview: Whether this version is in preview mode. :vartype is_preview: bool :ivar patch_versions: Patch versions of Kubernetes release. :vartype patch_versions: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesPatchVersion] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesPatchVersion] """ _attribute_map = { @@ -3215,14 +3216,14 @@ def __init__( :paramtype version: str :keyword capabilities: Capabilities on this Kubernetes version. :paramtype capabilities: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesVersionCapabilities + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesVersionCapabilities :keyword is_default: Whether this version is default. :paramtype is_default: bool :keyword is_preview: Whether this version is in preview mode. :paramtype is_preview: bool :keyword patch_versions: Patch versions of Kubernetes release. :paramtype patch_versions: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesPatchVersion] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesPatchVersion] """ super().__init__(**kwargs) self.version = version @@ -3237,7 +3238,7 @@ class KubernetesVersionCapabilities(_serialization.Model): :ivar support_plan: :vartype support_plan: list[str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesSupportPlan] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesSupportPlan] """ _attribute_map = { @@ -3250,7 +3251,7 @@ def __init__( """ :keyword support_plan: :paramtype support_plan: list[str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesSupportPlan] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesSupportPlan] """ super().__init__(**kwargs) self.support_plan = support_plan @@ -3261,7 +3262,7 @@ class KubernetesVersionListResult(_serialization.Model): :ivar values: Array of AKS supported Kubernetes versions. :vartype values: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesVersion] """ _attribute_map = { @@ -3272,7 +3273,7 @@ def __init__(self, *, values: Optional[List["_models.KubernetesVersion"]] = None """ :keyword values: Array of AKS supported Kubernetes versions. :paramtype values: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesVersion] """ super().__init__(**kwargs) self.values = values @@ -3291,7 +3292,7 @@ class LabelSelector(_serialization.Model): :ivar match_expressions: matchExpressions is a list of label selector requirements. The requirements are ANDed. :vartype match_expressions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelectorRequirement] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelectorRequirement] """ _attribute_map = { @@ -3315,7 +3316,7 @@ def __init__( :keyword match_expressions: matchExpressions is a list of label selector requirements. The requirements are ANDed. :paramtype match_expressions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelectorRequirement] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelectorRequirement] """ super().__init__(**kwargs) self.match_labels = match_labels @@ -3330,7 +3331,7 @@ class LabelSelectorRequirement(_serialization.Model): :vartype key: str :ivar operator: operator represents a key's relationship to a set of values. Valid operators are In and NotIn. Known values are: "In", "NotIn", "Exists", "DoesNotExist", and "In". - :vartype operator: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Operator + :vartype operator: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Operator :ivar values: values is an array of string values, the values array must be non-empty. :vartype values: list[str] """ @@ -3354,7 +3355,7 @@ def __init__( :paramtype key: str :keyword operator: operator represents a key's relationship to a set of values. Valid operators are In and NotIn. Known values are: "In", "NotIn", "Exists", "DoesNotExist", and "In". - :paramtype operator: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Operator + :paramtype operator: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Operator :keyword values: values is an array of string values, the values array must be non-empty. :paramtype values: list[str] """ @@ -3369,7 +3370,7 @@ class LinuxOSConfig(_serialization.Model): `_ for more details. :ivar sysctls: Sysctl settings for Linux agent nodes. - :vartype sysctls: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SysctlConfig + :vartype sysctls: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SysctlConfig :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. @@ -3401,7 +3402,7 @@ def __init__( ) -> None: """ :keyword sysctls: Sysctl settings for Linux agent nodes. - :paramtype sysctls: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SysctlConfig + :paramtype sysctls: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SysctlConfig :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. @@ -3428,7 +3429,7 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3437,7 +3438,7 @@ class ProxyResource(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData """ @@ -3453,7 +3454,7 @@ class LoadBalancer(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3462,7 +3463,7 @@ class LoadBalancer(ProxyResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar primary_agent_pool_name: Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. An @@ -3475,14 +3476,14 @@ class LoadBalancer(ProxyResource): :ivar service_label_selector: Only services that must match this selector can be placed on this load balancer. :vartype service_label_selector: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelector + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelector :ivar service_namespace_selector: Services created in namespaces that match the selector can be placed on this load balancer. :vartype service_namespace_selector: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelector + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelector :ivar node_selector: Nodes that match this selector will be possible members of this load balancer. - :vartype node_selector: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelector + :vartype node_selector: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelector :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str """ @@ -3531,14 +3532,14 @@ def __init__( :keyword service_label_selector: Only services that must match this selector can be placed on this load balancer. :paramtype service_label_selector: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelector + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelector :keyword service_namespace_selector: Services created in namespaces that match the selector can be placed on this load balancer. :paramtype service_namespace_selector: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelector + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelector :keyword node_selector: Nodes that match this selector will be possible members of this load balancer. - :paramtype node_selector: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LabelSelector + :paramtype node_selector: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LabelSelector """ super().__init__(**kwargs) self.primary_agent_pool_name = primary_agent_pool_name @@ -3546,7 +3547,7 @@ def __init__( self.service_label_selector = service_label_selector self.service_namespace_selector = service_namespace_selector self.node_selector = node_selector - self.provisioning_state = None + self.provisioning_state: Optional[str] = None class LoadBalancerListResult(_serialization.Model): @@ -3555,7 +3556,7 @@ class LoadBalancerListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Load Balancers. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer] :ivar next_link: The URL to get the next set of load balancer results. :vartype next_link: str """ @@ -3572,11 +3573,11 @@ class LoadBalancerListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.LoadBalancer"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of Load Balancers. - :paramtype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer] + :paramtype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class Machine(SubResource): @@ -3594,7 +3595,7 @@ class Machine(SubResource): :ivar type: Resource type. :vartype type: str :ivar properties: The properties of the machine. - :vartype properties: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MachineProperties + :vartype properties: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MachineProperties """ _validation = { @@ -3614,7 +3615,7 @@ class Machine(SubResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.properties = None + self.properties: Optional["_models.MachineProperties"] = None class MachineIpAddress(_serialization.Model): @@ -3624,7 +3625,7 @@ class MachineIpAddress(_serialization.Model): :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and "IPv6". - :vartype family: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.IPFamily + :vartype family: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.IPFamily :ivar ip: IPv4 or IPv6 address of the machine. :vartype ip: str """ @@ -3642,8 +3643,8 @@ class MachineIpAddress(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.family = None - self.ip = None + self.family: Optional[Union[str, "_models.IPFamily"]] = None + self.ip: Optional[str] = None class MachineListResult(_serialization.Model): @@ -3652,7 +3653,7 @@ class MachineListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Machines in cluster. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.Machine] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Machine] :ivar next_link: The URL to get the next set of machine results. :vartype next_link: str """ @@ -3669,11 +3670,11 @@ class MachineListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.Machine"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of Machines in cluster. - :paramtype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.Machine] + :paramtype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Machine] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MachineNetworkProperties(_serialization.Model): @@ -3683,7 +3684,7 @@ class MachineNetworkProperties(_serialization.Model): :ivar ip_addresses: IPv4, IPv6 addresses of the machine. :vartype ip_addresses: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MachineIpAddress] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MachineIpAddress] """ _validation = { @@ -3697,7 +3698,7 @@ class MachineNetworkProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.ip_addresses = None + self.ip_addresses: Optional[List["_models.MachineIpAddress"]] = None class MachineProperties(_serialization.Model): @@ -3707,7 +3708,7 @@ class MachineProperties(_serialization.Model): :ivar network: network properties of the machine. :vartype network: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MachineNetworkProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MachineNetworkProperties :ivar resource_id: Arm resource id of the machine. It can be used to GET underlying VM Instance. :vartype resource_id: str @@ -3726,8 +3727,8 @@ class MachineProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.network = None - self.resource_id = None + self.network: Optional["_models.MachineNetworkProperties"] = None + self.resource_id: Optional[str] = None class MaintenanceConfiguration(SubResource): @@ -3744,16 +3745,16 @@ class MaintenanceConfiguration(SubResource): :ivar type: Resource type. :vartype type: str :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :vartype time_in_week: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TimeInWeek] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TimeInWeek] :ivar not_allowed_time: Time slots on which upgrade is not allowed. :vartype not_allowed_time: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TimeSpan] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TimeSpan] :ivar maintenance_window: Maintenance window for the maintenance configuration. :vartype maintenance_window: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceWindow + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceWindow """ _validation = { @@ -3785,16 +3786,16 @@ def __init__( :keyword time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. :paramtype time_in_week: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TimeInWeek] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TimeInWeek] :keyword not_allowed_time: Time slots on which upgrade is not allowed. :paramtype not_allowed_time: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TimeSpan] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TimeSpan] :keyword maintenance_window: Maintenance window for the maintenance configuration. :paramtype maintenance_window: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceWindow + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceWindow """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.time_in_week = time_in_week self.not_allowed_time = not_allowed_time self.maintenance_window = maintenance_window @@ -3807,7 +3808,7 @@ class MaintenanceConfigurationListResult(_serialization.Model): :ivar value: The list of maintenance configurations. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -3825,11 +3826,11 @@ def __init__(self, *, value: Optional[List["_models.MaintenanceConfiguration"]] """ :keyword value: The list of maintenance configurations. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MaintenanceWindow(_serialization.Model): @@ -3838,7 +3839,7 @@ class MaintenanceWindow(_serialization.Model): All required parameters must be populated in order to send to server. :ivar schedule: Recurrence schedule for the maintenance window. Required. - :vartype schedule: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Schedule + :vartype schedule: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Schedule :ivar duration_hours: Length of maintenance window range from 4 to 24 hours. :vartype duration_hours: int :ivar utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' @@ -3857,7 +3858,7 @@ class MaintenanceWindow(_serialization.Model): '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. :vartype not_allowed_dates: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.DateSpan] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.DateSpan] """ _validation = { @@ -3889,7 +3890,7 @@ def __init__( ) -> None: """ :keyword schedule: Recurrence schedule for the maintenance window. Required. - :paramtype schedule: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Schedule + :paramtype schedule: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Schedule :keyword duration_hours: Length of maintenance window range from 4 to 24 hours. :paramtype duration_hours: int :keyword utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and @@ -3908,7 +3909,7 @@ def __init__( '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. :paramtype not_allowed_dates: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.DateSpan] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.DateSpan] """ super().__init__(**kwargs) self.schedule = schedule @@ -3928,7 +3929,7 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3937,7 +3938,7 @@ class TrackedResource(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -3981,7 +3982,7 @@ class ManagedCluster(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3990,7 +3991,7 @@ class ManagedCluster(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -4001,23 +4002,23 @@ class ManagedCluster(TrackedResource): convention. :vartype e_tag: str :ivar sku: The managed cluster SKU. - :vartype sku: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKU + :vartype sku: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKU :ivar extended_location: The extended location of the Virtual Machine. :vartype extended_location: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ExtendedLocation + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ExtendedLocation :ivar identity: The identity of the managed cluster, if configured. :vartype identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIdentity :ivar kind: This is primarily used to expose different UI experiences in the portal for different kinds. :vartype kind: str :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions @@ -4042,39 +4043,39 @@ class ManagedCluster(TrackedResource): :vartype azure_portal_fqdn: str :ivar agent_pool_profiles: The agent pool properties. :vartype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAgentPoolProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAgentPoolProfile] :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. :vartype linux_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceLinuxProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceLinuxProfile :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWindowsProfile :ivar service_principal_profile: Information about a service principal identity for the cluster to use for manipulating Azure APIs. :vartype service_principal_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterServicePrincipalProfile :ivar addon_profiles: The profile of managed cluster add-on. :vartype addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAddonProfile] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAddonProfile] :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. :vartype pod_identity_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProfile :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. :vartype oidc_issuer_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterOIDCIssuerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterOIDCIssuerProfile :ivar node_resource_group: The name of the resource group containing agent pool nodes. :vartype node_resource_group: str :ivar node_resource_group_profile: The node resource group configuration profile. :vartype node_resource_group_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterNodeResourceGroupProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterNodeResourceGroupProfile :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :vartype enable_rbac: bool :ivar support_plan: The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". :vartype support_plan: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesSupportPlan + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesSupportPlan :ivar enable_pod_security_policy: (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. @@ -4085,34 +4086,34 @@ class ManagedCluster(TrackedResource): :vartype enable_namespace_resources: bool :ivar network_profile: The network configuration profile. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceNetworkProfile :ivar aad_profile: The Azure Active Directory configuration. :vartype aad_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAADProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAADProfile :ivar auto_upgrade_profile: The auto upgrade configuration. :vartype auto_upgrade_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAutoUpgradeProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAutoUpgradeProfile :ivar upgrade_settings: Settings for upgrading a cluster. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ClusterUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ClusterUpgradeSettings :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. :vartype auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPropertiesAutoScalerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPropertiesAutoScalerProfile :ivar api_server_access_profile: The access profile for managed cluster API server. :vartype api_server_access_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAPIServerAccessProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAPIServerAccessProfile :ivar disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. :vartype disk_encryption_set_id: str :ivar identity_profile: The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". :vartype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity] :ivar private_link_resources: Private link resources associated with the cluster. :vartype private_link_resources: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource] :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts @@ -4120,51 +4121,51 @@ class ManagedCluster(TrackedResource): :vartype disable_local_accounts: bool :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. :vartype http_proxy_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterHTTPProxyConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterHTTPProxyConfig :ivar security_profile: Security profile for the managed cluster. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfile :ivar storage_profile: Storage profile for the managed cluster. :vartype storage_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfile :ivar ingress_profile: Ingress profile for the managed cluster. :vartype ingress_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIngressProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIngressProfile :ivar public_network_access: Allow or deny public network access for AKS. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". :vartype public_network_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PublicNetworkAccess + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PublicNetworkAccess :ivar workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. :vartype workload_auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfile :ivar azure_monitor_profile: Prometheus addon profile for the container service cluster. :vartype azure_monitor_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfile :ivar safeguards_profile: The Safeguards profile holds all the safeguards information for a given cluster. :vartype safeguards_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsProfile :ivar service_mesh_profile: Service mesh profile for a managed cluster. :vartype service_mesh_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ServiceMeshProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ServiceMeshProfile :ivar resource_uid: The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). :vartype resource_uid: str :ivar metrics_profile: Optional cluster metrics configuration. :vartype metrics_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterMetricsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterMetricsProfile :ivar ai_toolchain_operator_profile: AI toolchain operator settings that apply to the whole cluster. :vartype ai_toolchain_operator_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAIToolchainOperatorProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAIToolchainOperatorProfile :ivar node_provisioning_profile: Node provisioning settings that apply to the whole cluster. :vartype node_provisioning_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterNodeProvisioningProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterNodeProvisioningProfile :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. :vartype bootstrap_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterBootstrapProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterBootstrapProfile :ivar status: Contains read-only information about the Managed Cluster. - :vartype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStatus + :vartype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStatus """ _validation = { @@ -4326,19 +4327,19 @@ def __init__( # pylint: disable=too-many-locals :keyword location: The geo-location where the resource lives. Required. :paramtype location: str :keyword sku: The managed cluster SKU. - :paramtype sku: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKU + :paramtype sku: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKU :keyword extended_location: The extended location of the Virtual Machine. :paramtype extended_location: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ExtendedLocation + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ExtendedLocation :keyword identity: The identity of the managed cluster, if configured. :paramtype identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIdentity :keyword kind: This is primarily used to expose different UI experiences in the portal for different kinds. :paramtype kind: str :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however @@ -4351,39 +4352,39 @@ def __init__( # pylint: disable=too-many-locals :paramtype fqdn_subdomain: str :keyword agent_pool_profiles: The agent pool properties. :paramtype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAgentPoolProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAgentPoolProfile] :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. :paramtype linux_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceLinuxProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceLinuxProfile :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWindowsProfile :keyword service_principal_profile: Information about a service principal identity for the cluster to use for manipulating Azure APIs. :paramtype service_principal_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterServicePrincipalProfile :keyword addon_profiles: The profile of managed cluster add-on. :paramtype addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAddonProfile] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAddonProfile] :keyword pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. :paramtype pod_identity_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProfile :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. :paramtype oidc_issuer_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterOIDCIssuerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterOIDCIssuerProfile :keyword node_resource_group: The name of the resource group containing agent pool nodes. :paramtype node_resource_group: str :keyword node_resource_group_profile: The node resource group configuration profile. :paramtype node_resource_group_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterNodeResourceGroupProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterNodeResourceGroupProfile :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :paramtype enable_rbac: bool :keyword support_plan: The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". :paramtype support_plan: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesSupportPlan + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesSupportPlan :keyword enable_pod_security_policy: (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. @@ -4394,34 +4395,34 @@ def __init__( # pylint: disable=too-many-locals :paramtype enable_namespace_resources: bool :keyword network_profile: The network configuration profile. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ContainerServiceNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ContainerServiceNetworkProfile :keyword aad_profile: The Azure Active Directory configuration. :paramtype aad_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAADProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAADProfile :keyword auto_upgrade_profile: The auto upgrade configuration. :paramtype auto_upgrade_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAutoUpgradeProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAutoUpgradeProfile :keyword upgrade_settings: Settings for upgrading a cluster. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ClusterUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ClusterUpgradeSettings :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. :paramtype auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPropertiesAutoScalerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPropertiesAutoScalerProfile :keyword api_server_access_profile: The access profile for managed cluster API server. :paramtype api_server_access_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAPIServerAccessProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAPIServerAccessProfile :keyword disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. :paramtype disk_encryption_set_id: str :keyword identity_profile: The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". :paramtype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity] :keyword private_link_resources: Private link resources associated with the cluster. :paramtype private_link_resources: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource] :keyword disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts @@ -4430,66 +4431,66 @@ def __init__( # pylint: disable=too-many-locals :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. :paramtype http_proxy_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterHTTPProxyConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterHTTPProxyConfig :keyword security_profile: Security profile for the managed cluster. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfile :keyword storage_profile: Storage profile for the managed cluster. :paramtype storage_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfile :keyword ingress_profile: Ingress profile for the managed cluster. :paramtype ingress_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIngressProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIngressProfile :keyword public_network_access: Allow or deny public network access for AKS. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". :paramtype public_network_access: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PublicNetworkAccess + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PublicNetworkAccess :keyword workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. :paramtype workload_auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfile :keyword azure_monitor_profile: Prometheus addon profile for the container service cluster. :paramtype azure_monitor_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfile :keyword safeguards_profile: The Safeguards profile holds all the safeguards information for a given cluster. :paramtype safeguards_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsProfile :keyword service_mesh_profile: Service mesh profile for a managed cluster. :paramtype service_mesh_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ServiceMeshProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ServiceMeshProfile :keyword metrics_profile: Optional cluster metrics configuration. :paramtype metrics_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterMetricsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterMetricsProfile :keyword ai_toolchain_operator_profile: AI toolchain operator settings that apply to the whole cluster. :paramtype ai_toolchain_operator_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAIToolchainOperatorProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAIToolchainOperatorProfile :keyword node_provisioning_profile: Node provisioning settings that apply to the whole cluster. :paramtype node_provisioning_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterNodeProvisioningProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterNodeProvisioningProfile :keyword bootstrap_profile: Profile of the cluster bootstrap configuration. :paramtype bootstrap_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterBootstrapProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterBootstrapProfile :keyword status: Contains read-only information about the Managed Cluster. - :paramtype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStatus + :paramtype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStatus """ super().__init__(tags=tags, location=location, **kwargs) - self.e_tag = None + self.e_tag: Optional[str] = None self.sku = sku self.extended_location = extended_location self.identity = identity self.kind = kind - self.provisioning_state = None - self.power_state = None + self.provisioning_state: Optional[str] = None + self.power_state: Optional["_models.PowerState"] = None self.creation_data = creation_data - self.max_agent_pools = None + self.max_agent_pools: Optional[int] = None self.kubernetes_version = kubernetes_version - self.current_kubernetes_version = None + self.current_kubernetes_version: Optional[str] = None self.dns_prefix = dns_prefix self.fqdn_subdomain = fqdn_subdomain - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None + self.fqdn: Optional[str] = None + self.private_fqdn: Optional[str] = None + self.azure_portal_fqdn: Optional[str] = None self.agent_pool_profiles = agent_pool_profiles self.linux_profile = linux_profile self.windows_profile = windows_profile @@ -4522,7 +4523,7 @@ def __init__( # pylint: disable=too-many-locals self.azure_monitor_profile = azure_monitor_profile self.safeguards_profile = safeguards_profile self.service_mesh_profile = service_mesh_profile - self.resource_uid = None + self.resource_uid: Optional[str] = None self.metrics_profile = metrics_profile self.ai_toolchain_operator_profile = ai_toolchain_operator_profile self.node_provisioning_profile = node_provisioning_profile @@ -4615,7 +4616,7 @@ class ManagedClusterAccessProfile(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4624,7 +4625,7 @@ class ManagedClusterAccessProfile(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -4684,7 +4685,7 @@ class ManagedClusterAddonProfile(_serialization.Model): :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAddonProfileIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAddonProfileIdentity """ _validation = { @@ -4708,7 +4709,7 @@ def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, ** super().__init__(**kwargs) self.enabled = enabled self.config = config - self.identity = None + self.identity: Optional["_models.ManagedClusterAddonProfileIdentity"] = None class UserAssignedIdentity(_serialization.Model): @@ -4790,15 +4791,15 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): `_. Known values are: "Managed" and "Ephemeral". :vartype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSDiskType :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :vartype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletDiskType :ivar workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer", "WasmWasi", and "KataMshvVmIsolation". :vartype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WorkloadRuntime :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -4807,27 +4808,27 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype vnet_subnet_id: str :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype pod_subnet_id: str :ivar pod_ip_allocation_mode: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values are: "DynamicIndividual" and "StaticBlock". :vartype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodIPAllocationMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodIPAllocationMode :ivar max_pods: The maximum number of pods that can run on a node. :vartype max_pods: int :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :ivar max_count: The maximum number of nodes for auto-scaling. :vartype max_count: int :ivar min_count: The minimum number of nodes for auto-scaling. @@ -4837,15 +4838,15 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :vartype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleDownMode :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". - :vartype type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolType + :vartype type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolType :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", and "Gateway". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolMode :ivar orchestrator_version: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created @@ -4864,14 +4865,14 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :vartype node_image_version: str :ivar upgrade_settings: Settings for upgrading the agentpool. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :vartype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :vartype availability_zones: list[str] @@ -4888,16 +4889,16 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): stores. Defaults to false. :vartype enable_custom_ca_trust: bool :ivar node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :vartype node_public_ip_prefix_id: str :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :vartype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetPriority :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :vartype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetEvictionPolicy :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -4919,9 +4920,9 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar proximity_placement_group_id: The ID for Proximity Placement Group. :vartype proximity_placement_group_id: str :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletConfig + :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletConfig :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LinuxOSConfig + :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LinuxOSConfig :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -4935,45 +4936,45 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :vartype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GPUInstanceProfile :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :vartype capacity_reservation_group_id: str :ivar host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :vartype host_group_id: str :ivar windows_profile: The Windows agent pool's specific profile. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolWindowsProfile :ivar network_profile: Network-related settings of an agent pool. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolNetworkProfile :ivar security_profile: The security settings of an agent pool. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSecurityProfile :ivar gpu_profile: The GPU settings of an agent pool. :vartype gpu_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGPUProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGPUProfile :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolArtifactStreamingProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolArtifactStreamingProfile :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. :vartype virtual_machines_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachinesProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachinesProfile :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. :vartype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachineNodes] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachineNodes] :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. :vartype gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGatewayProfile :ivar status: Contains read-only information about the Agent Pool. - :vartype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolStatus + :vartype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolStatus """ _validation = { @@ -5119,15 +5120,15 @@ def __init__( # pylint: disable=too-many-locals `_. Known values are: "Managed" and "Ephemeral". :paramtype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSDiskType :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :paramtype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletDiskType :keyword workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer", "WasmWasi", and "KataMshvVmIsolation". :paramtype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WorkloadRuntime :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -5136,27 +5137,27 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype vnet_subnet_id: str :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype pod_subnet_id: str :keyword pod_ip_allocation_mode: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values are: "DynamicIndividual" and "StaticBlock". :paramtype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodIPAllocationMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodIPAllocationMode :keyword max_pods: The maximum number of pods that can run on a node. :paramtype max_pods: int :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :keyword max_count: The maximum number of nodes for auto-scaling. :paramtype max_count: int :keyword min_count: The minimum number of nodes for auto-scaling. @@ -5166,15 +5167,15 @@ def __init__( # pylint: disable=too-many-locals :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :paramtype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleDownMode :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". - :paramtype type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolType + :paramtype type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolType :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", and "Gateway". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolMode :keyword orchestrator_version: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created @@ -5187,12 +5188,12 @@ def __init__( # pylint: disable=too-many-locals :paramtype orchestrator_version: str :keyword upgrade_settings: Settings for upgrading the agentpool. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeSettings :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :paramtype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :paramtype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :keyword availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :paramtype availability_zones: list[str] @@ -5200,7 +5201,7 @@ def __init__( # pylint: disable=too-many-locals their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node - `_. # pylint: disable=line-too-long + `_. The default is false. :paramtype enable_node_public_ip: bool :keyword enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that @@ -5209,16 +5210,16 @@ def __init__( # pylint: disable=too-many-locals stores. Defaults to false. :paramtype enable_custom_ca_trust: bool :keyword node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :paramtype node_public_ip_prefix_id: str :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :paramtype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetPriority :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :paramtype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetEvictionPolicy :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -5241,10 +5242,10 @@ def __init__( # pylint: disable=too-many-locals :paramtype proximity_placement_group_id: str :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. :paramtype kubelet_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletConfig :keyword linux_os_config: The OS configuration of Linux agent nodes. :paramtype linux_os_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LinuxOSConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LinuxOSConfig :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -5259,48 +5260,48 @@ def __init__( # pylint: disable=too-many-locals profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :paramtype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GPUInstanceProfile :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :paramtype capacity_reservation_group_id: str :keyword host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :paramtype host_group_id: str :keyword windows_profile: The Windows agent pool's specific profile. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolWindowsProfile :keyword network_profile: Network-related settings of an agent pool. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolNetworkProfile :keyword security_profile: The security settings of an agent pool. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSecurityProfile :keyword gpu_profile: The GPU settings of an agent pool. :paramtype gpu_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGPUProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGPUProfile :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolArtifactStreamingProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolArtifactStreamingProfile :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. :paramtype virtual_machines_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachinesProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachinesProfile :keyword virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. :paramtype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachineNodes] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachineNodes] :keyword gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. :paramtype gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGatewayProfile :keyword status: Contains read-only information about the Agent Pool. - :paramtype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolStatus + :paramtype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolStatus """ super().__init__(**kwargs) - self.e_tag = None + self.e_tag: Optional[str] = None self.count = count self.vm_size = vm_size self.os_disk_size_gb = os_disk_size_gb @@ -5321,10 +5322,10 @@ def __init__( # pylint: disable=too-many-locals self.type = type self.mode = mode self.orchestrator_version = orchestrator_version - self.current_orchestrator_version = None - self.node_image_version = None + self.current_orchestrator_version: Optional[str] = None + self.node_image_version: Optional[str] = None self.upgrade_settings = upgrade_settings - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.power_state = power_state self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip @@ -5388,15 +5389,15 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): `_. Known values are: "Managed" and "Ephemeral". :vartype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSDiskType :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :vartype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletDiskType :ivar workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer", "WasmWasi", and "KataMshvVmIsolation". :vartype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WorkloadRuntime :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -5405,27 +5406,27 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype vnet_subnet_id: str :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype pod_subnet_id: str :ivar pod_ip_allocation_mode: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values are: "DynamicIndividual" and "StaticBlock". :vartype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodIPAllocationMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodIPAllocationMode :ivar max_pods: The maximum number of pods that can run on a node. :vartype max_pods: int :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :ivar max_count: The maximum number of nodes for auto-scaling. :vartype max_count: int :ivar min_count: The minimum number of nodes for auto-scaling. @@ -5435,15 +5436,15 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :vartype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleDownMode :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". - :vartype type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolType + :vartype type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolType :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", and "Gateway". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolMode :ivar orchestrator_version: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created @@ -5462,14 +5463,14 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :vartype node_image_version: str :ivar upgrade_settings: Settings for upgrading the agentpool. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :vartype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :vartype availability_zones: list[str] @@ -5486,16 +5487,16 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): stores. Defaults to false. :vartype enable_custom_ca_trust: bool :ivar node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :vartype node_public_ip_prefix_id: str :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :vartype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetPriority :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :vartype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetEvictionPolicy :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -5517,9 +5518,9 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar proximity_placement_group_id: The ID for Proximity Placement Group. :vartype proximity_placement_group_id: str :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletConfig + :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletConfig :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LinuxOSConfig + :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LinuxOSConfig :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -5533,45 +5534,45 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :vartype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GPUInstanceProfile :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :vartype capacity_reservation_group_id: str :ivar host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :vartype host_group_id: str :ivar windows_profile: The Windows agent pool's specific profile. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolWindowsProfile :ivar network_profile: Network-related settings of an agent pool. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolNetworkProfile :ivar security_profile: The security settings of an agent pool. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSecurityProfile :ivar gpu_profile: The GPU settings of an agent pool. :vartype gpu_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGPUProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGPUProfile :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolArtifactStreamingProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolArtifactStreamingProfile :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. :vartype virtual_machines_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachinesProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachinesProfile :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. :vartype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachineNodes] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachineNodes] :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. :vartype gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGatewayProfile :ivar status: Contains read-only information about the Agent Pool. - :vartype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolStatus + :vartype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolStatus :ivar name: Windows agent pool names must be 6 characters or less. Required. :vartype name: str """ @@ -5722,15 +5723,15 @@ def __init__( # pylint: disable=too-many-locals `_. Known values are: "Managed" and "Ephemeral". :paramtype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSDiskType :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :paramtype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletDiskType :keyword workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer", "WasmWasi", and "KataMshvVmIsolation". :paramtype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WorkloadRuntime :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -5739,27 +5740,27 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype vnet_subnet_id: str :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype pod_subnet_id: str :keyword pod_ip_allocation_mode: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values are: "DynamicIndividual" and "StaticBlock". :paramtype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PodIPAllocationMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PodIPAllocationMode :keyword max_pods: The maximum number of pods that can run on a node. :paramtype max_pods: int :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :keyword max_count: The maximum number of nodes for auto-scaling. :paramtype max_count: int :keyword min_count: The minimum number of nodes for auto-scaling. @@ -5769,15 +5770,15 @@ def __init__( # pylint: disable=too-many-locals :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :paramtype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleDownMode :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". - :paramtype type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolType + :paramtype type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolType :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", and "Gateway". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolMode :keyword orchestrator_version: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created @@ -5790,12 +5791,12 @@ def __init__( # pylint: disable=too-many-locals :paramtype orchestrator_version: str :keyword upgrade_settings: Settings for upgrading the agentpool. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeSettings :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :paramtype power_state: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PowerState + :paramtype power_state: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PowerState :keyword availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :paramtype availability_zones: list[str] @@ -5803,7 +5804,7 @@ def __init__( # pylint: disable=too-many-locals their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node - `_. # pylint: disable=line-too-long + `_. The default is false. :paramtype enable_node_public_ip: bool :keyword enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that @@ -5812,16 +5813,16 @@ def __init__( # pylint: disable=too-many-locals stores. Defaults to false. :paramtype enable_custom_ca_trust: bool :keyword node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :paramtype node_public_ip_prefix_id: str :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :paramtype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetPriority :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :paramtype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleSetEvictionPolicy :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -5844,10 +5845,10 @@ def __init__( # pylint: disable=too-many-locals :paramtype proximity_placement_group_id: str :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. :paramtype kubelet_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubeletConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubeletConfig :keyword linux_os_config: The OS configuration of Linux agent nodes. :paramtype linux_os_config: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LinuxOSConfig + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LinuxOSConfig :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -5862,45 +5863,45 @@ def __init__( # pylint: disable=too-many-locals profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :paramtype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.GPUInstanceProfile :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :paramtype capacity_reservation_group_id: str :keyword host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :paramtype host_group_id: str :keyword windows_profile: The Windows agent pool's specific profile. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolWindowsProfile :keyword network_profile: Network-related settings of an agent pool. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolNetworkProfile :keyword security_profile: The security settings of an agent pool. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolSecurityProfile :keyword gpu_profile: The GPU settings of an agent pool. :paramtype gpu_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGPUProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGPUProfile :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolArtifactStreamingProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolArtifactStreamingProfile :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. :paramtype virtual_machines_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachinesProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachinesProfile :keyword virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. :paramtype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.VirtualMachineNodes] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.VirtualMachineNodes] :keyword gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. :paramtype gateway_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolGatewayProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolGatewayProfile :keyword status: Contains read-only information about the Agent Pool. - :paramtype status: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolStatus + :paramtype status: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolStatus :keyword name: Windows agent pool names must be 6 characters or less. Required. :paramtype name: str """ @@ -6076,11 +6077,11 @@ class ManagedClusterAutoUpgradeProfile(_serialization.Model): `_. Known values are: "rapid", "stable", "patch", "node-image", and "none". :vartype upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UpgradeChannel + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UpgradeChannel :ivar node_os_upgrade_channel: The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. Known values are: "None", "Unmanaged", "SecurityPatch", and "NodeImage". :vartype node_os_upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeOSUpgradeChannel + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeOSUpgradeChannel """ _attribute_map = { @@ -6100,12 +6101,12 @@ def __init__( channel `_. Known values are: "rapid", "stable", "patch", "node-image", and "none". :paramtype upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UpgradeChannel + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UpgradeChannel :keyword node_os_upgrade_channel: The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. Known values are: "None", "Unmanaged", "SecurityPatch", and "NodeImage". :paramtype node_os_upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeOSUpgradeChannel + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeOSUpgradeChannel """ super().__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -6117,18 +6118,18 @@ class ManagedClusterAzureMonitorProfile(_serialization.Model): :ivar metrics: Metrics profile for the prometheus service addon. :vartype metrics: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileMetrics + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileMetrics :ivar container_insights: Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. :vartype container_insights: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileContainerInsights + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileContainerInsights :ivar app_monitoring: Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :vartype app_monitoring: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring """ _attribute_map = { @@ -6151,18 +6152,18 @@ def __init__( """ :keyword metrics: Metrics profile for the prometheus service addon. :paramtype metrics: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileMetrics + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileMetrics :keyword container_insights: Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. :paramtype container_insights: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileContainerInsights + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileContainerInsights :keyword app_monitoring: Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :paramtype app_monitoring: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring """ super().__init__(**kwargs) self.metrics = metrics @@ -6180,19 +6181,19 @@ class ManagedClusterAzureMonitorProfileAppMonitoring(_serialization.Model): # p SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :vartype auto_instrumentation: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation :ivar open_telemetry_metrics: Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :vartype open_telemetry_metrics: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics :ivar open_telemetry_logs: Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :vartype open_telemetry_logs: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs """ _attribute_map = { @@ -6228,19 +6229,19 @@ def __init__( SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :paramtype auto_instrumentation: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation :keyword open_telemetry_metrics: Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :paramtype open_telemetry_metrics: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics :keyword open_telemetry_logs: Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. :paramtype open_telemetry_logs: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs """ super().__init__(**kwargs) self.auto_instrumentation = auto_instrumentation @@ -6449,7 +6450,7 @@ class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): :ivar kube_state_metrics: Kube State Metrics for prometheus addon profile for the container service cluster. :vartype kube_state_metrics: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics """ _validation = { @@ -6474,7 +6475,7 @@ def __init__( :keyword kube_state_metrics: Kube State Metrics for prometheus addon profile for the container service cluster. :paramtype kube_state_metrics: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics """ super().__init__(**kwargs) self.enabled = enabled @@ -6487,7 +6488,7 @@ class ManagedClusterBootstrapProfile(_serialization.Model): :ivar artifact_source: The source where the artifacts are downloaded from. Known values are: "Cache" and "Direct". :vartype artifact_source: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ArtifactSource + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ArtifactSource :ivar container_registry_id: The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. :vartype container_registry_id: str @@ -6509,7 +6510,7 @@ def __init__( :keyword artifact_source: The source where the artifacts are downloaded from. Known values are: "Cache" and "Direct". :paramtype artifact_source: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ArtifactSource + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ArtifactSource :keyword container_registry_id: The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. :paramtype container_registry_id: str @@ -6598,7 +6599,7 @@ def __init__( self.http_proxy = http_proxy self.https_proxy = https_proxy self.no_proxy = no_proxy - self.effective_no_proxy = None + self.effective_no_proxy: Optional[List[str]] = None self.trusted_ca = trusted_ca @@ -6617,16 +6618,16 @@ class ManagedClusterIdentity(_serialization.Model): `_. Known values are: "SystemAssigned", "UserAssigned", and "None". :vartype type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceIdentityType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceIdentityType :ivar delegated_resources: The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only. :vartype delegated_resources: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.DelegatedResource] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.DelegatedResource] :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :vartype user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -6660,20 +6661,20 @@ def __init__( `_. Known values are: "SystemAssigned", "UserAssigned", and "None". :paramtype type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceIdentityType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceIdentityType :keyword delegated_resources: The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only. :paramtype delegated_resources: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.DelegatedResource] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.DelegatedResource] :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type self.delegated_resources = delegated_resources self.user_assigned_identities = user_assigned_identities @@ -6684,7 +6685,7 @@ class ManagedClusterIngressProfile(_serialization.Model): :ivar web_app_routing: Web App Routing settings for the ingress profile. :vartype web_app_routing: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIngressProfileWebAppRouting + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIngressProfileWebAppRouting """ _attribute_map = { @@ -6697,7 +6698,7 @@ def __init__( """ :keyword web_app_routing: Web App Routing settings for the ingress profile. :paramtype web_app_routing: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIngressProfileWebAppRouting + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIngressProfileWebAppRouting """ super().__init__(**kwargs) self.web_app_routing = web_app_routing @@ -6709,7 +6710,7 @@ class ManagedClusterIngressProfileNginx(_serialization.Model): :ivar default_ingress_controller_type: Ingress type for the default NginxIngressController custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". :vartype default_ingress_controller_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NginxIngressControllerType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NginxIngressControllerType """ _attribute_map = { @@ -6726,7 +6727,7 @@ def __init__( :keyword default_ingress_controller_type: Ingress type for the default NginxIngressController custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". :paramtype default_ingress_controller_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NginxIngressControllerType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NginxIngressControllerType """ super().__init__(**kwargs) self.default_ingress_controller_type = default_ingress_controller_type @@ -6747,13 +6748,13 @@ class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): # pylint :ivar nginx: Configuration for the default NginxIngressController. See more at https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. :vartype nginx: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIngressProfileNginx + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIngressProfileNginx :ivar identity: Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See `this overview of the add-on `_ for more instructions. - :vartype identity: ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity + :vartype identity: ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity """ _validation = { @@ -6785,15 +6786,15 @@ def __init__( all private DNS zones must be in the same resource group. :paramtype dns_zone_resource_ids: list[str] :keyword nginx: Configuration for the default NginxIngressController. See more at - https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. # pylint: disable=line-too-long + https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. :paramtype nginx: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterIngressProfileNginx + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterIngressProfileNginx """ super().__init__(**kwargs) self.enabled = enabled self.dns_zone_resource_ids = dns_zone_resource_ids self.nginx = nginx - self.identity = None + self.identity: Optional["_models.UserAssignedIdentity"] = None class ManagedClusterListResult(_serialization.Model): @@ -6802,7 +6803,7 @@ class ManagedClusterListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of managed clusters. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -6819,11 +6820,11 @@ class ManagedClusterListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.ManagedCluster"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of managed clusters. - :paramtype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + :paramtype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedClusterLoadBalancerProfile(_serialization.Model): @@ -6833,17 +6834,17 @@ class ManagedClusterLoadBalancerProfile(_serialization.Model): :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. :vartype managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. :vartype outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. :vartype outbound_i_ps: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. :vartype effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceReference] :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. @@ -6857,11 +6858,11 @@ class ManagedClusterLoadBalancerProfile(_serialization.Model): :ivar backend_pool_type: The type of the managed inbound Load Balancer BackendPool. Known values are: "NodeIPConfiguration" and "NodeIP". :vartype backend_pool_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.BackendPoolType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.BackendPoolType :ivar cluster_service_load_balancer_health_probe_mode: The health probing behavior for External Traffic Policy Cluster services. Known values are: "ServiceNodePort" and "Shared". :vartype cluster_service_load_balancer_health_probe_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode """ _validation = { @@ -6909,14 +6910,14 @@ def __init__( """ :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. :paramtype managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. :paramtype outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. :paramtype outbound_i_ps: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. @@ -6930,17 +6931,17 @@ def __init__( :keyword backend_pool_type: The type of the managed inbound Load Balancer BackendPool. Known values are: "NodeIPConfiguration" and "NodeIP". :paramtype backend_pool_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.BackendPoolType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.BackendPoolType :keyword cluster_service_load_balancer_health_probe_mode: The health probing behavior for External Traffic Policy Cluster services. Known values are: "ServiceNodePort" and "Shared". :paramtype cluster_service_load_balancer_health_probe_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode """ super().__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes self.outbound_i_ps = outbound_i_ps - self.effective_outbound_i_ps = None + self.effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None self.allocated_outbound_ports = allocated_outbound_ports self.idle_timeout_in_minutes = idle_timeout_in_minutes self.enable_multiple_standard_load_balancers = enable_multiple_standard_load_balancers @@ -6992,7 +6993,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): :ivar public_ip_prefixes: A list of public IP prefix resources. :vartype public_ip_prefixes: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceReference] """ _attribute_map = { @@ -7005,7 +7006,7 @@ def __init__( """ :keyword public_ip_prefixes: A list of public IP prefix resources. :paramtype public_ip_prefixes: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceReference] """ super().__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -7016,7 +7017,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pyl :ivar public_i_ps: A list of public IP resources. :vartype public_i_ps: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceReference] """ _attribute_map = { @@ -7027,7 +7028,7 @@ def __init__(self, *, public_i_ps: Optional[List["_models.ResourceReference"]] = """ :keyword public_i_ps: A list of public IP resources. :paramtype public_i_ps: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceReference] """ super().__init__(**kwargs) self.public_i_ps = public_i_ps @@ -7064,7 +7065,7 @@ class ManagedClusterMetricsProfile(_serialization.Model): :ivar cost_analysis: The cost analysis configuration for the cluster. :vartype cost_analysis: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterCostAnalysis + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterCostAnalysis """ _attribute_map = { @@ -7075,7 +7076,7 @@ def __init__(self, *, cost_analysis: Optional["_models.ManagedClusterCostAnalysi """ :keyword cost_analysis: The cost analysis configuration for the cluster. :paramtype cost_analysis: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterCostAnalysis + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterCostAnalysis """ super().__init__(**kwargs) self.cost_analysis = cost_analysis @@ -7089,10 +7090,10 @@ class ManagedClusterNATGatewayProfile(_serialization.Model): :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. :vartype managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterManagedOutboundIPProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterManagedOutboundIPProfile :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. :vartype effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceReference] :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. :vartype idle_timeout_in_minutes: int @@ -7123,14 +7124,14 @@ def __init__( :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. :paramtype managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterManagedOutboundIPProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterManagedOutboundIPProfile :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. :paramtype idle_timeout_in_minutes: int """ super().__init__(**kwargs) self.managed_outbound_ip_profile = managed_outbound_ip_profile - self.effective_outbound_i_ps = None + self.effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None self.idle_timeout_in_minutes = idle_timeout_in_minutes @@ -7140,7 +7141,7 @@ class ManagedClusterNodeProvisioningProfile(_serialization.Model): :ivar mode: Once the mode it set to Auto, it cannot be changed back to Manual. Known values are: "Manual" and "Auto". :vartype mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeProvisioningMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeProvisioningMode """ _attribute_map = { @@ -7152,7 +7153,7 @@ def __init__(self, *, mode: Optional[Union[str, "_models.NodeProvisioningMode"]] :keyword mode: Once the mode it set to Auto, it cannot be changed back to Manual. Known values are: "Manual" and "Auto". :paramtype mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeProvisioningMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeProvisioningMode """ super().__init__(**kwargs) self.mode = mode @@ -7164,7 +7165,7 @@ class ManagedClusterNodeResourceGroupProfile(_serialization.Model): :ivar restriction_level: The restriction level applied to the cluster's node resource group. Known values are: "Unrestricted" and "ReadOnly". :vartype restriction_level: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RestrictionLevel + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RestrictionLevel """ _attribute_map = { @@ -7178,7 +7179,7 @@ def __init__( :keyword restriction_level: The restriction level applied to the cluster's node resource group. Known values are: "Unrestricted" and "ReadOnly". :paramtype restriction_level: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RestrictionLevel + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RestrictionLevel """ super().__init__(**kwargs) self.restriction_level = restriction_level @@ -7210,7 +7211,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: :paramtype enabled: bool """ super().__init__(**kwargs) - self.issuer_url = None + self.issuer_url: Optional[str] = None self.enabled = enabled @@ -7228,14 +7229,14 @@ class ManagedClusterPodIdentity(_serialization.Model): :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. :vartype binding_selector: str :ivar identity: The user assigned identity details. Required. - :vartype identity: ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity + :vartype identity: ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Known values are: "Assigned", "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningState + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningState :ivar provisioning_info: :vartype provisioning_info: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningInfo + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningInfo """ _validation = { @@ -7273,15 +7274,15 @@ def __init__( :paramtype binding_selector: str :keyword identity: The user assigned identity details. Required. :paramtype identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity """ super().__init__(**kwargs) self.name = name self.namespace = namespace self.binding_selector = binding_selector self.identity = identity - self.provisioning_state = None - self.provisioning_info = None + self.provisioning_state: Optional[Union[str, "_models.ManagedClusterPodIdentityProvisioningState"]] = None + self.provisioning_info: Optional["_models.ManagedClusterPodIdentityProvisioningInfo"] = None class ManagedClusterPodIdentityException(_serialization.Model): @@ -7335,15 +7336,15 @@ class ManagedClusterPodIdentityProfile(_serialization.Model): :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity - `_ # pylint: disable=line-too-long + `_ for more information. :vartype allow_network_plugin_kubenet: bool :ivar user_assigned_identities: The pod identities to use in the cluster. :vartype user_assigned_identities: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentity] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentity] :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. :vartype user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityException] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityException] """ _attribute_map = { @@ -7371,15 +7372,15 @@ def __init__( :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity - `_ # pylint: disable=line-too-long + `_ for more information. :paramtype allow_network_plugin_kubenet: bool :keyword user_assigned_identities: The pod identities to use in the cluster. :paramtype user_assigned_identities: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentity] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentity] :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. :paramtype user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityException] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityException] """ super().__init__(**kwargs) self.enabled = enabled @@ -7393,7 +7394,7 @@ class ManagedClusterPodIdentityProvisioningError(_serialization.Model): # pylin :ivar error: Details about the error. :vartype error: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody """ _attribute_map = { @@ -7406,7 +7407,7 @@ def __init__( """ :keyword error: Details about the error. :paramtype error: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody """ super().__init__(**kwargs) self.error = error @@ -7426,7 +7427,7 @@ class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): # p :vartype target: str :ivar details: A list of additional details about the error. :vartype details: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] """ _attribute_map = { @@ -7457,7 +7458,7 @@ def __init__( :paramtype target: str :keyword details: A list of additional details about the error. :paramtype details: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] """ super().__init__(**kwargs) self.code = code @@ -7471,7 +7472,7 @@ class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): # pylint :ivar error: Pod identity assignment error (if any). :vartype error: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningError + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningError """ _attribute_map = { @@ -7484,7 +7485,7 @@ def __init__( """ :keyword error: Pod identity assignment error (if any). :paramtype error: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPodIdentityProvisioningError + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPodIdentityProvisioningError """ super().__init__(**kwargs) self.error = error @@ -7501,13 +7502,13 @@ class ManagedClusterPoolUpgradeProfile(_serialization.Model): :vartype name: str :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :ivar upgrades: List of orchestrator types and versions available for upgrade. :vartype upgrades: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] :ivar components_by_releases: List of components grouped by kubernetes major.minor version. :vartype components_by_releases: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ComponentsByRelease] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ComponentsByRelease] """ _validation = { @@ -7540,13 +7541,13 @@ def __init__( :paramtype name: str :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :keyword upgrades: List of orchestrator types and versions available for upgrade. :paramtype upgrades: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] :keyword components_by_releases: List of components grouped by kubernetes major.minor version. :paramtype components_by_releases: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ComponentsByRelease] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ComponentsByRelease] """ super().__init__(**kwargs) self.kubernetes_version = kubernetes_version @@ -7615,7 +7616,7 @@ class ManagedClusterPropertiesAutoScalerProfile(_serialization.Model): # pylint :vartype ignore_daemonsets_utilization: bool :ivar expander: Available values are: 'least-waste', 'most-pods', 'priority', 'random'. Known values are: "least-waste", "most-pods", "priority", and "random". - :vartype expander: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Expander + :vartype expander: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Expander :ivar max_empty_bulk_delete: The default is 10. :vartype max_empty_bulk_delete: str :ivar max_graceful_termination_sec: The default is 600. @@ -7723,7 +7724,7 @@ def __init__( :paramtype ignore_daemonsets_utilization: bool :keyword expander: Available values are: 'least-waste', 'most-pods', 'priority', 'random'. Known values are: "least-waste", "most-pods", "priority", and "random". - :paramtype expander: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Expander + :paramtype expander: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Expander :keyword max_empty_bulk_delete: The default is 10. :paramtype max_empty_bulk_delete: str :keyword max_graceful_termination_sec: The default is 600. @@ -7796,12 +7797,12 @@ class ManagedClusterPropertiesForSnapshot(_serialization.Model): :ivar kubernetes_version: The current kubernetes version. :vartype kubernetes_version: str :ivar sku: The current managed cluster sku. - :vartype sku: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKU + :vartype sku: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKU :ivar enable_rbac: Whether the cluster has enabled Kubernetes Role-Based Access Control or not. :vartype enable_rbac: bool :ivar network_profile: The current network profile. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkProfileForSnapshot + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkProfileForSnapshot """ _validation = { @@ -7827,7 +7828,7 @@ def __init__( :keyword kubernetes_version: The current kubernetes version. :paramtype kubernetes_version: str :keyword sku: The current managed cluster sku. - :paramtype sku: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKU + :paramtype sku: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKU :keyword enable_rbac: Whether the cluster has enabled Kubernetes Role-Based Access Control or not. :paramtype enable_rbac: bool @@ -7836,7 +7837,7 @@ def __init__( self.kubernetes_version = kubernetes_version self.sku = sku self.enable_rbac = enable_rbac - self.network_profile = None + self.network_profile: Optional["_models.NetworkProfileForSnapshot"] = None class ManagedClusterSecurityProfile(_serialization.Model): @@ -7844,31 +7845,31 @@ class ManagedClusterSecurityProfile(_serialization.Model): :ivar defender: Microsoft Defender settings for the security profile. :vartype defender: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefender + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefender :ivar azure_key_vault_kms: Azure Key Vault `key management service `_ settings for the security profile. :vartype azure_key_vault_kms: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AzureKeyVaultKms + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AzureKeyVaultKms :ivar workload_identity: Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. :vartype workload_identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity :ivar image_cleaner: Image Cleaner settings for the security profile. :vartype image_cleaner: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileImageCleaner + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileImageCleaner :ivar image_integrity: Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any effect unless Azure Policy is applied to enforce image signatures. See https://aka.ms/aks/image-integrity for how to use this feature via policy. :vartype image_integrity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileImageIntegrity :ivar node_restriction: `Node Restriction `_ settings for the security profile. :vartype node_restriction: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileNodeRestriction + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileNodeRestriction :ivar custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more information see `Custom CA Trust Certificates `_. @@ -7904,31 +7905,31 @@ def __init__( """ :keyword defender: Microsoft Defender settings for the security profile. :paramtype defender: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefender + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefender :keyword azure_key_vault_kms: Azure Key Vault `key management service `_ settings for the security profile. :paramtype azure_key_vault_kms: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AzureKeyVaultKms + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AzureKeyVaultKms :keyword workload_identity: Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. :paramtype workload_identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity :keyword image_cleaner: Image Cleaner settings for the security profile. :paramtype image_cleaner: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileImageCleaner + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileImageCleaner :keyword image_integrity: Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any effect unless Azure Policy is applied to enforce image signatures. See https://aka.ms/aks/image-integrity for how to use this feature via policy. :paramtype image_integrity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileImageIntegrity :keyword node_restriction: `Node Restriction `_ settings for the security profile. :paramtype node_restriction: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileNodeRestriction + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileNodeRestriction :keyword custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more information see `Custom CA Trust Certificates `_. @@ -7955,13 +7956,13 @@ class ManagedClusterSecurityProfileDefender(_serialization.Model): :ivar security_monitoring: Microsoft Defender threat detection for Cloud settings for the security profile. :vartype security_monitoring: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring :ivar security_gating: Microsoft Defender settings for security gating, validates container images eligibility for deployment based on Defender for Containers security findings. Using Admission Controller, it either audits or prevents the deployment of images that do not meet security standards. :vartype security_gating: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGating + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGating """ _attribute_map = { @@ -7990,13 +7991,13 @@ def __init__( :keyword security_monitoring: Microsoft Defender threat detection for Cloud settings for the security profile. :paramtype security_monitoring: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring :keyword security_gating: Microsoft Defender settings for security gating, validates container images eligibility for deployment based on Defender for Containers security findings. Using Admission Controller, it either audits or prevents the deployment of images that do not meet security standards. :paramtype security_gating: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGating + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGating """ super().__init__(**kwargs) self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id @@ -8018,7 +8019,7 @@ class ManagedClusterSecurityProfileDefenderSecurityGating(_serialization.Model): pull container images. Each identity provided should have federated identity credential attached to it. :vartype identities: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] # pylint: disable=line-too-long + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] :ivar allow_secret_access: In use only while registry access granted by secret rather than managed identity. Set whether to grant the Defender gating agent access to the cluster's secrets for pulling images from registries. If secret access is denied and the registry @@ -8054,7 +8055,7 @@ def __init__( to pull container images. Each identity provided should have federated identity credential attached to it. :paramtype identities: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] # pylint: disable=line-too-long + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] :keyword allow_secret_access: In use only while registry access granted by secret rather than managed identity. Set whether to grant the Defender gating agent access to the cluster's secrets for pulling images from registries. If secret access is denied and the registry @@ -8077,7 +8078,7 @@ class ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem( identity specified here should have a federated identity credential attached to it. :vartype azure_container_registry: str :ivar identity: The identity object used to access the registry. - :vartype identity: ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity + :vartype identity: ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity """ _attribute_map = { @@ -8098,7 +8099,7 @@ def __init__( :paramtype azure_container_registry: str :keyword identity: The identity object used to access the registry. :paramtype identity: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.UserAssignedIdentity + ~azure.mgmt.containerservice.v2025_02_02_preview.models.UserAssignedIdentity """ super().__init__(**kwargs) self.azure_container_registry = azure_container_registry @@ -8250,12 +8251,12 @@ class ManagedClusterSKU(_serialization.Model): :ivar name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". :vartype name: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKUName + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKUName :ivar tier: If not specified, the default is 'Free'. See `AKS Pricing Tier `_ for more details. Known values are: "Premium", "Standard", and "Free". :vartype tier: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKUTier + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKUTier """ _attribute_map = { @@ -8273,12 +8274,12 @@ def __init__( """ :keyword name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". :paramtype name: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKUName + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKUName :keyword tier: If not specified, the default is 'Free'. See `AKS Pricing Tier `_ for more details. Known values are: "Premium", "Standard", and "Free". :paramtype tier: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSKUTier + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSKUTier """ super().__init__(**kwargs) self.name = name @@ -8293,7 +8294,7 @@ class ManagedClusterSnapshot(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -8302,22 +8303,22 @@ class ManagedClusterSnapshot(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar creation_data: CreationData to be used to specify the source resource ID to create this snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :ivar snapshot_type: The type of a snapshot. The default is NodePool. Known values are: "NodePool" and "ManagedCluster". :vartype snapshot_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SnapshotType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SnapshotType :ivar managed_cluster_properties_read_only: What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. :vartype managed_cluster_properties_read_only: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPropertiesForSnapshot + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPropertiesForSnapshot """ _validation = { @@ -8360,16 +8361,16 @@ def __init__( :paramtype location: str :keyword creation_data: CreationData to be used to specify the source resource ID to create this snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :keyword snapshot_type: The type of a snapshot. The default is NodePool. Known values are: "NodePool" and "ManagedCluster". :paramtype snapshot_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SnapshotType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SnapshotType """ super().__init__(tags=tags, location=location, **kwargs) self.creation_data = creation_data self.snapshot_type = snapshot_type - self.managed_cluster_properties_read_only = None + self.managed_cluster_properties_read_only: Optional["_models.ManagedClusterPropertiesForSnapshot"] = None class ManagedClusterSnapshotListResult(_serialization.Model): @@ -8379,7 +8380,7 @@ class ManagedClusterSnapshotListResult(_serialization.Model): :ivar value: The list of managed cluster snapshots. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot] :ivar next_link: The URL to get the next set of managed cluster snapshot results. :vartype next_link: str """ @@ -8397,11 +8398,11 @@ def __init__(self, *, value: Optional[List["_models.ManagedClusterSnapshot"]] = """ :keyword value: The list of managed cluster snapshots. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedClusterStaticEgressGatewayProfile(_serialization.Model): @@ -8432,7 +8433,7 @@ class ManagedClusterStatus(_serialization.Model): :ivar provisioning_error: Preserves the detailed info of failure. If there was no error, this field is omitted. :vartype provisioning_error: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.CloudErrorBody + ~azure.mgmt.containerservice.v2025_02_02_preview.models.CloudErrorBody """ _validation = { @@ -8446,7 +8447,7 @@ class ManagedClusterStatus(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_error = None + self.provisioning_error: Optional["_models.CloudErrorBody"] = None class ManagedClusterStorageProfile(_serialization.Model): @@ -8454,16 +8455,16 @@ class ManagedClusterStorageProfile(_serialization.Model): :ivar disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. :vartype disk_csi_driver: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. :vartype file_csi_driver: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileFileCSIDriver :ivar snapshot_controller: Snapshot Controller settings for the storage profile. :vartype snapshot_controller: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileSnapshotController + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileSnapshotController :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. :vartype blob_csi_driver: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver """ _attribute_map = { @@ -8485,16 +8486,16 @@ def __init__( """ :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. :paramtype disk_csi_driver: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. :paramtype file_csi_driver: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileFileCSIDriver :keyword snapshot_controller: Snapshot Controller settings for the storage profile. :paramtype snapshot_controller: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileSnapshotController + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileSnapshotController :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. :paramtype blob_csi_driver: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver """ super().__init__(**kwargs) self.disk_csi_driver = disk_csi_driver @@ -8605,10 +8606,10 @@ class ManagedClusterUpgradeProfile(_serialization.Model): :ivar control_plane_profile: The list of available upgrade versions for the control plane. Required. :vartype control_plane_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPoolUpgradeProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPoolUpgradeProfile :ivar agent_pool_profiles: The list of available upgrade versions for agent pools. Required. :vartype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPoolUpgradeProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPoolUpgradeProfile] """ _validation = { @@ -8638,15 +8639,15 @@ def __init__( :keyword control_plane_profile: The list of available upgrade versions for the control plane. Required. :paramtype control_plane_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPoolUpgradeProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPoolUpgradeProfile :keyword agent_pool_profiles: The list of available upgrade versions for agent pools. Required. :paramtype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterPoolUpgradeProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterPoolUpgradeProfile] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.control_plane_profile = control_plane_profile self.agent_pool_profiles = agent_pool_profiles @@ -8676,13 +8677,13 @@ class ManagedClusterWindowsProfile(_serialization.Model): `_ for more details. Known values are: "None" and "Windows_Server". :vartype license_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LicenseType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LicenseType :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. :vartype enable_csi_proxy: bool :ivar gmsa_profile: The Windows gMSA Profile in the Managed Cluster. :vartype gmsa_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WindowsGmsaProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WindowsGmsaProfile """ _validation = { @@ -8728,13 +8729,13 @@ def __init__( `_ for more details. Known values are: "None" and "Windows_Server". :paramtype license_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LicenseType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LicenseType :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. :paramtype enable_csi_proxy: bool :keyword gmsa_profile: The Windows gMSA Profile in the Managed Cluster. :paramtype gmsa_profile: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.WindowsGmsaProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.WindowsGmsaProfile """ super().__init__(**kwargs) self.admin_username = admin_username @@ -8750,10 +8751,10 @@ class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. :vartype keda: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda :ivar vertical_pod_autoscaler: :vartype vertical_pod_autoscaler: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler """ _attribute_map = { @@ -8777,10 +8778,10 @@ def __init__( :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. :paramtype keda: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda :keyword vertical_pod_autoscaler: :paramtype vertical_pod_autoscaler: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler """ super().__init__(**kwargs) self.keda = keda @@ -8825,7 +8826,7 @@ class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler( :ivar addon_autoscaling: Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. Known values are: "Enabled" and "Disabled". :vartype addon_autoscaling: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AddonAutoscaling + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AddonAutoscaling """ _validation = { @@ -8850,7 +8851,7 @@ def __init__( :keyword addon_autoscaling: Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. Known values are: "Enabled" and "Disabled". :paramtype addon_autoscaling: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AddonAutoscaling + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AddonAutoscaling """ super().__init__(**kwargs) self.enabled = enabled @@ -8881,76 +8882,36 @@ class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None + self.principal_id: Optional[str] = None + self.client_id: Optional[str] = None class ManualScaleProfile(_serialization.Model): """Specifications on number of machines. - :ivar sizes: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', - 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is - unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. - :vartype sizes: list[str] + :ivar size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + 'Standard_E16s_v3' or 'Standard_D16s_v5'. + :vartype size: str :ivar count: Number of nodes. :vartype count: int - :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine - in the master/agent pool. If you specify 0, it will apply the default osDisk size according to - the vmSize specified. - :vartype os_disk_size_gb: int - :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Known values are: - "Managed" and "Ephemeral". - :vartype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType """ - _validation = { - "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, - } - _attribute_map = { - "sizes": {"key": "sizes", "type": "[str]"}, + "size": {"key": "size", "type": "str"}, "count": {"key": "count", "type": "int"}, - "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, - "os_disk_type": {"key": "osDiskType", "type": "str"}, } - def __init__( - self, - *, - sizes: Optional[List[str]] = None, - count: Optional[int] = None, - os_disk_size_gb: Optional[int] = None, - os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, size: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: """ - :keyword sizes: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', - 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is - unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. - :paramtype sizes: list[str] + :keyword size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + 'Standard_E16s_v3' or 'Standard_D16s_v5'. + :paramtype size: str :keyword count: Number of nodes. :paramtype count: int - :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :paramtype os_disk_size_gb: int - :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Known values are: - "Managed" and "Ephemeral". - :paramtype os_disk_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSDiskType """ super().__init__(**kwargs) - self.sizes = sizes + self.size = size self.count = count - self.os_disk_size_gb = os_disk_size_gb - self.os_disk_type = os_disk_type class MeshRevision(_serialization.Model): @@ -8963,7 +8924,7 @@ class MeshRevision(_serialization.Model): :ivar compatible_with: List of items this revision of service mesh is compatible with, and their associated versions. :vartype compatible_with: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.CompatibleVersions] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.CompatibleVersions] """ _attribute_map = { @@ -8988,7 +8949,7 @@ def __init__( :keyword compatible_with: List of items this revision of service mesh is compatible with, and their associated versions. :paramtype compatible_with: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.CompatibleVersions] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.CompatibleVersions] """ super().__init__(**kwargs) self.revision = revision @@ -9002,7 +8963,7 @@ class MeshRevisionProfile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -9011,10 +8972,10 @@ class MeshRevisionProfile(ProxyResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar properties: Mesh revision profile properties for a mesh. :vartype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfileProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfileProperties """ _validation = { @@ -9036,7 +8997,7 @@ def __init__(self, *, properties: Optional["_models.MeshRevisionProfilePropertie """ :keyword properties: Mesh revision profile properties for a mesh. :paramtype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfileProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfileProperties """ super().__init__(**kwargs) self.properties = properties @@ -9049,7 +9010,7 @@ class MeshRevisionProfileList(_serialization.Model): :ivar value: Array of service mesh add-on revision profiles for all supported mesh modes. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfile] :ivar next_link: The URL to get the next set of mesh revision profile. :vartype next_link: str """ @@ -9067,11 +9028,11 @@ def __init__(self, *, value: Optional[List["_models.MeshRevisionProfile"]] = Non """ :keyword value: Array of service mesh add-on revision profiles for all supported mesh modes. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfile] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MeshRevisionProfileProperties(_serialization.Model): @@ -9079,7 +9040,7 @@ class MeshRevisionProfileProperties(_serialization.Model): :ivar mesh_revisions: :vartype mesh_revisions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevision] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevision] """ _attribute_map = { @@ -9090,7 +9051,7 @@ def __init__(self, *, mesh_revisions: Optional[List["_models.MeshRevision"]] = N """ :keyword mesh_revisions: :paramtype mesh_revisions: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevision] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevision] """ super().__init__(**kwargs) self.mesh_revisions = mesh_revisions @@ -9102,7 +9063,7 @@ class MeshUpgradeProfile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -9111,10 +9072,10 @@ class MeshUpgradeProfile(ProxyResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar properties: Mesh upgrade profile properties for a major.minor release. :vartype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfileProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfileProperties """ _validation = { @@ -9136,7 +9097,7 @@ def __init__(self, *, properties: Optional["_models.MeshUpgradeProfileProperties """ :keyword properties: Mesh upgrade profile properties for a major.minor release. :paramtype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfileProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfileProperties """ super().__init__(**kwargs) self.properties = properties @@ -9149,7 +9110,7 @@ class MeshUpgradeProfileList(_serialization.Model): :ivar value: Array of supported service mesh add-on upgrade profiles. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfile] :ivar next_link: The URL to get the next set of mesh upgrade profile. :vartype next_link: str """ @@ -9167,11 +9128,11 @@ def __init__(self, *, value: Optional[List["_models.MeshUpgradeProfile"]] = None """ :keyword value: Array of supported service mesh add-on upgrade profiles. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfile] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MeshUpgradeProfileProperties(MeshRevision): @@ -9184,32 +9145,258 @@ class MeshUpgradeProfileProperties(MeshRevision): :ivar compatible_with: List of items this revision of service mesh is compatible with, and their associated versions. :vartype compatible_with: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.CompatibleVersions] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.CompatibleVersions] """ +class Namespace(SubResource): + """Namespace managed by ARM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData + :ivar tags: The tags to be persisted on the managed cluster namespace. + :vartype tags: dict[str, str] + :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value + will change when the resource is updated. Specify an if-match or if-none-match header with the + eTag value for a subsequent request to enable optimistic concurrency per the normal etag + convention. + :vartype e_tag: str + :ivar location: The location of the namespace. + :vartype location: str + :ivar properties: Properties of a namespace. + :vartype properties: + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NamespaceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "e_tag": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "e_tag": {"key": "eTag", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NamespaceProperties"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + properties: Optional["_models.NamespaceProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: The tags to be persisted on the managed cluster namespace. + :paramtype tags: dict[str, str] + :keyword location: The location of the namespace. + :paramtype location: str + :keyword properties: Properties of a namespace. + :paramtype properties: + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NamespaceProperties + """ + super().__init__(**kwargs) + self.system_data: Optional["_models.SystemData"] = None + self.tags = tags + self.e_tag: Optional[str] = None + self.location = location + self.properties = properties + + +class NamespaceListResult(_serialization.Model): + """The result of a request to list namespaces in a managed cluster. + + :ivar value: The list of namespaces. + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :ivar next_link: The URI to fetch the next page of results, if any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[Namespace]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.Namespace"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list of namespaces. + :paramtype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :keyword next_link: The URI to fetch the next page of results, if any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NamespaceProperties(_serialization.Model): + """Properties of a namespace managed by ARM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The current provisioning state of the namespace. Known values are: + "Updating", "Deleting", "Creating", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NamespaceProvisioningState + :ivar labels: The labels of managed namespace. + :vartype labels: dict[str, str] + :ivar annotations: The annotations of managed namespace. + :vartype annotations: dict[str, str] + :ivar default_resource_quota: The default resource quota enforced upon the namespace. Customers + can have other Kubernetes resource quota objects under the namespace. All the resource quotas + will be enforced. + :vartype default_resource_quota: + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceQuota + :ivar default_network_policy: The default network policy enforced upon the namespace. Customers + can have other Kubernetes network policy objects under the namespace. All the network policies + will be enforced. + :vartype default_network_policy: + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPolicies + :ivar adoption_policy: Action if Kubernetes namespace with same name already exists. Known + values are: "Never", "IfIdentical", and "Always". + :vartype adoption_policy: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdoptionPolicy + :ivar delete_policy: Delete options of a namespace. Known values are: "Keep" and "Delete". + :vartype delete_policy: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.DeletePolicy + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "labels": {"key": "labels", "type": "{str}"}, + "annotations": {"key": "annotations", "type": "{str}"}, + "default_resource_quota": {"key": "defaultResourceQuota", "type": "ResourceQuota"}, + "default_network_policy": {"key": "defaultNetworkPolicy", "type": "NetworkPolicies"}, + "adoption_policy": {"key": "adoptionPolicy", "type": "str"}, + "delete_policy": {"key": "deletePolicy", "type": "str"}, + } + + def __init__( + self, + *, + labels: Optional[Dict[str, str]] = None, + annotations: Optional[Dict[str, str]] = None, + default_resource_quota: Optional["_models.ResourceQuota"] = None, + default_network_policy: Optional["_models.NetworkPolicies"] = None, + adoption_policy: Optional[Union[str, "_models.AdoptionPolicy"]] = None, + delete_policy: Optional[Union[str, "_models.DeletePolicy"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword labels: The labels of managed namespace. + :paramtype labels: dict[str, str] + :keyword annotations: The annotations of managed namespace. + :paramtype annotations: dict[str, str] + :keyword default_resource_quota: The default resource quota enforced upon the namespace. + Customers can have other Kubernetes resource quota objects under the namespace. All the + resource quotas will be enforced. + :paramtype default_resource_quota: + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ResourceQuota + :keyword default_network_policy: The default network policy enforced upon the namespace. + Customers can have other Kubernetes network policy objects under the namespace. All the network + policies will be enforced. + :paramtype default_network_policy: + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPolicies + :keyword adoption_policy: Action if Kubernetes namespace with same name already exists. Known + values are: "Never", "IfIdentical", and "Always". + :paramtype adoption_policy: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AdoptionPolicy + :keyword delete_policy: Delete options of a namespace. Known values are: "Keep" and "Delete". + :paramtype delete_policy: str or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.DeletePolicy + """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.NamespaceProvisioningState"]] = None + self.labels = labels + self.annotations = annotations + self.default_resource_quota = default_resource_quota + self.default_network_policy = default_network_policy + self.adoption_policy = adoption_policy + self.delete_policy = delete_policy + + +class NetworkPolicies(_serialization.Model): + """Default network policy of the namespace, specifying ingress and egress rules. + + :ivar ingress: Ingress policy for the network. Known values are: "DenyAll", "AllowAll", and + "AllowSameNamespace". + :vartype ingress: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.PolicyRule + :ivar egress: Egress policy for the network. Known values are: "DenyAll", "AllowAll", and + "AllowSameNamespace". + :vartype egress: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.PolicyRule + """ + + _attribute_map = { + "ingress": {"key": "ingress", "type": "str"}, + "egress": {"key": "egress", "type": "str"}, + } + + def __init__( + self, + *, + ingress: Optional[Union[str, "_models.PolicyRule"]] = None, + egress: Optional[Union[str, "_models.PolicyRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword ingress: Ingress policy for the network. Known values are: "DenyAll", "AllowAll", and + "AllowSameNamespace". + :paramtype ingress: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.PolicyRule + :keyword egress: Egress policy for the network. Known values are: "DenyAll", "AllowAll", and + "AllowSameNamespace". + :paramtype egress: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.PolicyRule + """ + super().__init__(**kwargs) + self.ingress = ingress + self.egress = egress + + class NetworkProfileForSnapshot(_serialization.Model): """network profile for managed cluster snapshot, these properties are read only. :ivar network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", "kubenet", and "none". :vartype network_plugin: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPlugin + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPlugin :ivar network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" :vartype network_plugin_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPluginMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPluginMode :ivar network_policy: networkPolicy for managed cluster snapshot. Known values are: "none", "calico", "azure", and "cilium". :vartype network_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPolicy :ivar network_mode: networkMode for managed cluster snapshot. Known values are: "transparent" and "bridge". :vartype network_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkMode :ivar load_balancer_sku: loadBalancerSku for managed cluster snapshot. Known values are: "standard" and "basic". :vartype load_balancer_sku: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancerSku + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancerSku """ _attribute_map = { @@ -9234,22 +9421,22 @@ def __init__( :keyword network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", "kubenet", and "none". :paramtype network_plugin: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPlugin + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPlugin :keyword network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" :paramtype network_plugin_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPluginMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPluginMode :keyword network_policy: networkPolicy for managed cluster snapshot. Known values are: "none", "calico", "azure", and "cilium". :paramtype network_policy: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkPolicy + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkPolicy :keyword network_mode: networkMode for managed cluster snapshot. Known values are: "transparent" and "bridge". :paramtype network_mode: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.NetworkMode + ~azure.mgmt.containerservice.v2025_02_02_preview.models.NetworkMode :keyword load_balancer_sku: loadBalancerSku for managed cluster snapshot. Known values are: "standard" and "basic". :paramtype load_balancer_sku: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancerSku + ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancerSku """ super().__init__(**kwargs) self.network_plugin = network_plugin @@ -9315,7 +9502,7 @@ class NodeImageVersionsListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Array of AKS Node Image versions. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeImageVersion] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeImageVersion] :ivar next_link: The URL to get the next set of machine results. :vartype next_link: str """ @@ -9333,11 +9520,11 @@ def __init__(self, *, value: Optional[List["_models.NodeImageVersion"]] = None, """ :keyword value: Array of AKS Node Image versions. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeImageVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeImageVersion] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class OperationListResult(_serialization.Model): @@ -9346,7 +9533,7 @@ class OperationListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationValue] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationValue] """ _validation = { @@ -9360,7 +9547,7 @@ class OperationListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.OperationValue"]] = None class OperationStatusResult(_serialization.Model): @@ -9387,9 +9574,9 @@ class OperationStatusResult(_serialization.Model): :vartype end_time: ~datetime.datetime :ivar operations: The operations list. :vartype operations: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult] :ivar error: If present, details of the operation error. - :vartype error: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ErrorDetail + :vartype error: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ErrorDetail """ _validation = { @@ -9438,13 +9625,13 @@ def __init__( :paramtype end_time: ~datetime.datetime :keyword operations: The operations list. :paramtype operations: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult] :keyword error: If present, details of the operation error. - :paramtype error: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ErrorDetail + :paramtype error: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ErrorDetail """ super().__init__(**kwargs) self.id = id - self.resource_id = None + self.resource_id: Optional[str] = None self.name = name self.status = status self.percent_complete = percent_complete @@ -9461,7 +9648,7 @@ class OperationStatusResultList(_serialization.Model): :ivar value: List of operations. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult] :ivar next_link: URL to get the next set of operation list results (if there are any). :vartype next_link: str """ @@ -9479,8 +9666,8 @@ class OperationStatusResultList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.OperationStatusResult"]] = None + self.next_link: Optional[str] = None class OperationValue(_serialization.Model): @@ -9523,12 +9710,12 @@ class OperationValue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None + self.origin: Optional[str] = None + self.name: Optional[str] = None + self.operation: Optional[str] = None + self.resource: Optional[str] = None + self.description: Optional[str] = None + self.provider: Optional[str] = None class OutboundEnvironmentEndpoint(_serialization.Model): @@ -9539,7 +9726,7 @@ class OutboundEnvironmentEndpoint(_serialization.Model): :vartype category: str :ivar endpoints: The endpoints that AKS agent nodes connect to. :vartype endpoints: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.EndpointDependency] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.EndpointDependency] """ _attribute_map = { @@ -9560,7 +9747,7 @@ def __init__( :paramtype category: str :keyword endpoints: The endpoints that AKS agent nodes connect to. :paramtype endpoints: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.EndpointDependency] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.EndpointDependency] """ super().__init__(**kwargs) self.category = category @@ -9576,7 +9763,7 @@ class OutboundEnvironmentEndpointCollection(_serialization.Model): :ivar value: Collection of resources. Required. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.OutboundEnvironmentEndpoint] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -9595,11 +9782,11 @@ def __init__(self, *, value: List["_models.OutboundEnvironmentEndpoint"], **kwar """ :keyword value: Collection of resources. Required. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.OutboundEnvironmentEndpoint] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.OutboundEnvironmentEndpoint] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class PortRange(_serialization.Model): @@ -9612,7 +9799,7 @@ class PortRange(_serialization.Model): 65535, and be greater than or equal to portStart. :vartype port_end: int :ivar protocol: The network protocol of the port. Known values are: "TCP" and "UDP". - :vartype protocol: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Protocol + :vartype protocol: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Protocol """ _validation = { @@ -9642,7 +9829,7 @@ def __init__( to 65535, and be greater than or equal to portStart. :paramtype port_end: int :keyword protocol: The network protocol of the port. Known values are: "TCP" and "UDP". - :paramtype protocol: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Protocol + :paramtype protocol: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Protocol """ super().__init__(**kwargs) self.port_start = port_start @@ -9655,7 +9842,7 @@ class PowerState(_serialization.Model): :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and "Stopped". - :vartype code: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Code """ _attribute_map = { @@ -9666,7 +9853,7 @@ def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwarg """ :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and "Stopped". - :paramtype code: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Code + :paramtype code: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Code """ super().__init__(**kwargs) self.code = code @@ -9706,14 +9893,14 @@ class PrivateEndpointConnection(_serialization.Model): :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", "Creating", "Deleting", "Failed", and "Succeeded". :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnectionProvisioningState + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnectionProvisioningState :ivar private_endpoint: The resource of private endpoint. :vartype private_endpoint: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpoint + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpoint :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkServiceConnectionState + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkServiceConnectionState """ _validation = { @@ -9745,17 +9932,17 @@ def __init__( """ :keyword private_endpoint: The resource of private endpoint. :paramtype private_endpoint: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpoint + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpoint :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkServiceConnectionState + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkServiceConnectionState """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = None self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state @@ -9765,7 +9952,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): :ivar value: The collection value. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection] """ _attribute_map = { @@ -9776,7 +9963,7 @@ def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] """ :keyword value: The collection value. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection] """ super().__init__(**kwargs) self.value = value @@ -9843,7 +10030,7 @@ def __init__( self.type = type self.group_id = group_id self.required_members = required_members - self.private_link_service_id = None + self.private_link_service_id: Optional[str] = None class PrivateLinkResourcesListResult(_serialization.Model): @@ -9851,7 +10038,7 @@ class PrivateLinkResourcesListResult(_serialization.Model): :ivar value: The collection value. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource] """ _attribute_map = { @@ -9862,7 +10049,7 @@ def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = Non """ :keyword value: The collection value. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource] """ super().__init__(**kwargs) self.value = value @@ -9874,7 +10061,7 @@ class PrivateLinkServiceConnectionState(_serialization.Model): :ivar status: The private link service connection status. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". :vartype status: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ConnectionStatus + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ConnectionStatus :ivar description: The private link service connection description. :vartype description: str """ @@ -9895,7 +10082,7 @@ def __init__( :keyword status: The private link service connection status. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". :paramtype status: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ConnectionStatus + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ConnectionStatus :keyword description: The private link service connection description. :paramtype description: str """ @@ -9937,10 +10124,10 @@ class RelativeMonthlySchedule(_serialization.Model): :ivar week_index: Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. Required. Known values are: "First", "Second", "Third", "Fourth", and "Last". - :vartype week_index: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Type + :vartype week_index: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Type :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeekDay + :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeekDay """ _validation = { @@ -9970,11 +10157,11 @@ def __init__( :keyword week_index: Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. Required. Known values are: "First", "Second", "Third", "Fourth", and "Last". - :paramtype week_index: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Type + :paramtype week_index: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Type :keyword day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeekDay + :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeekDay """ super().__init__(**kwargs) self.interval_months = interval_months @@ -9982,6 +10169,75 @@ def __init__( self.day_of_week = day_of_week +class ResourceQuota(_serialization.Model): + """Resource quota for the namespace. + + :ivar cpu_request: CPU request of the namespace in one-thousandth CPU form. See `CPU resource + units + `_ + for more details. + :vartype cpu_request: str + :ivar cpu_limit: CPU limit of the namespace in one-thousandth CPU form. See `CPU resource units + `_ + for more details. + :vartype cpu_limit: str + :ivar memory_request: Memory request of the namespace in the power-of-two equivalents form: Ei, + Pi, Ti, Gi, Mi, Ki. See `Memory resource units + `_ + for more details. + :vartype memory_request: str + :ivar memory_limit: Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, + Ti, Gi, Mi, Ki. See `Memory resource units + `_ + for more details. + :vartype memory_limit: str + """ + + _attribute_map = { + "cpu_request": {"key": "cpuRequest", "type": "str"}, + "cpu_limit": {"key": "cpuLimit", "type": "str"}, + "memory_request": {"key": "memoryRequest", "type": "str"}, + "memory_limit": {"key": "memoryLimit", "type": "str"}, + } + + def __init__( + self, + *, + cpu_request: Optional[str] = None, + cpu_limit: Optional[str] = None, + memory_request: Optional[str] = None, + memory_limit: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword cpu_request: CPU request of the namespace in one-thousandth CPU form. See `CPU + resource units + `_ + for more details. + :paramtype cpu_request: str + :keyword cpu_limit: CPU limit of the namespace in one-thousandth CPU form. See `CPU resource + units + `_ + for more details. + :paramtype cpu_limit: str + :keyword memory_request: Memory request of the namespace in the power-of-two equivalents form: + Ei, Pi, Ti, Gi, Mi, Ki. See `Memory resource units + `_ + for more details. + :paramtype memory_request: str + :keyword memory_limit: Memory limit of the namespace in the power-of-two equivalents form: Ei, + Pi, Ti, Gi, Mi, Ki. See `Memory resource units + `_ + for more details. + :paramtype memory_limit: str + """ + super().__init__(**kwargs) + self.cpu_request = cpu_request + self.cpu_limit = cpu_limit + self.memory_request = memory_request + self.memory_limit = memory_limit + + class ResourceReference(_serialization.Model): """A reference to an Azure resource. @@ -10086,13 +10342,13 @@ class RunCommandResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None + self.id: Optional[str] = None + self.provisioning_state: Optional[str] = None + self.exit_code: Optional[int] = None + self.started_at: Optional[datetime.datetime] = None + self.finished_at: Optional[datetime.datetime] = None + self.logs: Optional[str] = None + self.reason: Optional[str] = None class SafeguardsAvailableVersion(Resource): @@ -10103,7 +10359,7 @@ class SafeguardsAvailableVersion(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10112,10 +10368,10 @@ class SafeguardsAvailableVersion(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar properties: Whether the version is default or not and support info. Required. :vartype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersionsProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersionsProperties """ _validation = { @@ -10138,7 +10394,7 @@ def __init__(self, *, properties: "_models.SafeguardsAvailableVersionsProperties """ :keyword properties: Whether the version is default or not and support info. Required. :paramtype properties: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersionsProperties + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersionsProperties """ super().__init__(**kwargs) self.properties = properties @@ -10151,7 +10407,7 @@ class SafeguardsAvailableVersionsList(_serialization.Model): :ivar value: Array of AKS supported Safeguards versions. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersion] :ivar next_link: The URL to get the next Safeguards available version. :vartype next_link: str """ @@ -10169,11 +10425,11 @@ def __init__(self, *, value: Optional[List["_models.SafeguardsAvailableVersion"] """ :keyword value: Array of AKS supported Safeguards versions. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersion] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersion] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class SafeguardsAvailableVersionsProperties(_serialization.Model): @@ -10186,7 +10442,7 @@ class SafeguardsAvailableVersionsProperties(_serialization.Model): :ivar support: Whether the version is preview or stable. Known values are: "Preview" and "Stable". :vartype support: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsSupport + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsSupport """ _validation = { @@ -10202,8 +10458,8 @@ class SafeguardsAvailableVersionsProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.is_default_version = None - self.support = None + self.is_default_version: Optional[bool] = None + self.support: Optional[Union[str, "_models.SafeguardsSupport"]] = None class SafeguardsProfile(_serialization.Model): @@ -10221,7 +10477,7 @@ class SafeguardsProfile(_serialization.Model): :ivar level: The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces. Required. Known values are: "Off", "Warning", and "Enforcement". - :vartype level: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Level + :vartype level: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Level :ivar excluded_namespaces: List of namespaces excluded from Safeguards checks. :vartype excluded_namespaces: list[str] """ @@ -10252,12 +10508,12 @@ def __init__( :keyword level: The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces. Required. Known values are: "Off", "Warning", and "Enforcement". - :paramtype level: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Level + :paramtype level: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Level :keyword excluded_namespaces: List of namespaces excluded from Safeguards checks. :paramtype excluded_namespaces: list[str] """ super().__init__(**kwargs) - self.system_excluded_namespaces = None + self.system_excluded_namespaces: Optional[List[str]] = None self.version = version self.level = level self.excluded_namespaces = excluded_namespaces @@ -10268,33 +10524,31 @@ class ScaleProfile(_serialization.Model): :ivar manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. :vartype manual: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManualScaleProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManualScaleProfile] :ivar autoscale: Specifications on how to auto-scale the VirtualMachines agent pool within a - predefined size range. Currently, at most one AutoScaleProfile is allowed. - :vartype autoscale: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AutoScaleProfile] + predefined size range. + :vartype autoscale: JSON """ _attribute_map = { "manual": {"key": "manual", "type": "[ManualScaleProfile]"}, - "autoscale": {"key": "autoscale", "type": "[AutoScaleProfile]"}, + "autoscale": {"key": "autoscale", "type": "object"}, } def __init__( self, *, manual: Optional[List["_models.ManualScaleProfile"]] = None, - autoscale: Optional[List["_models.AutoScaleProfile"]] = None, + autoscale: Optional[JSON] = None, **kwargs: Any ) -> None: """ :keyword manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. :paramtype manual: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManualScaleProfile] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManualScaleProfile] :keyword autoscale: Specifications on how to auto-scale the VirtualMachines agent pool within a - predefined size range. Currently, at most one AutoScaleProfile is allowed. - :paramtype autoscale: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.AutoScaleProfile] + predefined size range. + :paramtype autoscale: JSON """ super().__init__(**kwargs) self.manual = manual @@ -10306,17 +10560,17 @@ class Schedule(_serialization.Model): 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. :ivar daily: For schedules like: 'recur every day' or 'recur every 3 days'. - :vartype daily: ~azure.mgmt.containerservice.v2025_01_02_preview.models.DailySchedule + :vartype daily: ~azure.mgmt.containerservice.v2025_02_02_preview.models.DailySchedule :ivar weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - :vartype weekly: ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeeklySchedule + :vartype weekly: ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeeklySchedule :ivar absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. :vartype absolute_monthly: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AbsoluteMonthlySchedule + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AbsoluteMonthlySchedule :ivar relative_monthly: For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. :vartype relative_monthly: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RelativeMonthlySchedule + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RelativeMonthlySchedule """ _attribute_map = { @@ -10337,18 +10591,18 @@ def __init__( ) -> None: """ :keyword daily: For schedules like: 'recur every day' or 'recur every 3 days'. - :paramtype daily: ~azure.mgmt.containerservice.v2025_01_02_preview.models.DailySchedule + :paramtype daily: ~azure.mgmt.containerservice.v2025_02_02_preview.models.DailySchedule :keyword weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - :paramtype weekly: ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeeklySchedule + :paramtype weekly: ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeeklySchedule :keyword absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. :paramtype absolute_monthly: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AbsoluteMonthlySchedule + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AbsoluteMonthlySchedule :keyword relative_monthly: For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. :paramtype relative_monthly: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RelativeMonthlySchedule + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RelativeMonthlySchedule """ super().__init__(**kwargs) self.daily = daily @@ -10363,9 +10617,9 @@ class ServiceMeshProfile(_serialization.Model): All required parameters must be populated in order to send to server. :ivar mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.ServiceMeshMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.ServiceMeshMode :ivar istio: Istio service mesh configuration. - :vartype istio: ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioServiceMesh + :vartype istio: ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioServiceMesh """ _validation = { @@ -10386,9 +10640,9 @@ def __init__( ) -> None: """ :keyword mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.ServiceMeshMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.ServiceMeshMode :keyword istio: Istio service mesh configuration. - :paramtype istio: ~azure.mgmt.containerservice.v2025_01_02_preview.models.IstioServiceMesh + :paramtype istio: ~azure.mgmt.containerservice.v2025_02_02_preview.models.IstioServiceMesh """ super().__init__(**kwargs) self.mode = mode @@ -10403,7 +10657,7 @@ class Snapshot(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10412,30 +10666,30 @@ class Snapshot(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :ivar snapshot_type: The type of a snapshot. The default is NodePool. Known values are: "NodePool" and "ManagedCluster". :vartype snapshot_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SnapshotType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SnapshotType :ivar kubernetes_version: The version of Kubernetes. :vartype kubernetes_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", "AzureLinux", "CBLMariner", "Windows2019", "Windows2022", and "WindowsAnnual". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.OSSKU + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.OSSKU :ivar vm_size: The size of the VM. :vartype vm_size: str :ivar enable_fips: Whether to use a FIPS-enabled OS. @@ -10489,21 +10743,21 @@ def __init__( :paramtype location: str :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreationData :keyword snapshot_type: The type of a snapshot. The default is NodePool. Known values are: "NodePool" and "ManagedCluster". :paramtype snapshot_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.SnapshotType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.SnapshotType """ super().__init__(tags=tags, location=location, **kwargs) self.creation_data = creation_data self.snapshot_type = snapshot_type - self.kubernetes_version = None - self.node_image_version = None - self.os_type = None - self.os_sku = None - self.vm_size = None - self.enable_fips = None + self.kubernetes_version: Optional[str] = None + self.node_image_version: Optional[str] = None + self.os_type: Optional[Union[str, "_models.OSType"]] = None + self.os_sku: Optional[Union[str, "_models.OSSKU"]] = None + self.vm_size: Optional[str] = None + self.enable_fips: Optional[bool] = None class SnapshotListResult(_serialization.Model): @@ -10512,7 +10766,7 @@ class SnapshotListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of snapshots. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot] :ivar next_link: The URL to get the next set of snapshot results. :vartype next_link: str """ @@ -10529,11 +10783,11 @@ class SnapshotListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of snapshots. - :paramtype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot] + :paramtype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class SysctlConfig(_serialization.Model): @@ -10764,7 +11018,7 @@ class SystemData(_serialization.Model): :ivar created_by_type: The type of identity that created the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :vartype created_by_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreatedByType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. @@ -10772,7 +11026,7 @@ class SystemData(_serialization.Model): :ivar last_modified_by_type: The type of identity that last modified the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :vartype last_modified_by_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreatedByType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -10803,7 +11057,7 @@ def __init__( :keyword created_by_type: The type of identity that created the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :paramtype created_by_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreatedByType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. @@ -10811,7 +11065,7 @@ def __init__( :keyword last_modified_by_type: The type of identity that last modified the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :paramtype last_modified_by_type: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.CreatedByType + ~azure.mgmt.containerservice.v2025_02_02_preview.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ @@ -10849,7 +11103,7 @@ class TimeInWeek(_serialization.Model): :ivar day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeekDay + :vartype day: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeekDay :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. @@ -10871,7 +11125,7 @@ def __init__( """ :keyword day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeekDay + :paramtype day: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeekDay :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. @@ -10923,7 +11177,7 @@ class TrustedAccessRole(_serialization.Model): Role `_. :vartype rules: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleRule] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleRule] """ _validation = { @@ -10941,9 +11195,9 @@ class TrustedAccessRole(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.source_resource_type = None - self.name = None - self.rules = None + self.source_resource_type: Optional[str] = None + self.name: Optional[str] = None + self.rules: Optional[List["_models.TrustedAccessRoleRule"]] = None class TrustedAccessRoleBinding(Resource): @@ -10954,7 +11208,7 @@ class TrustedAccessRoleBinding(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10963,11 +11217,11 @@ class TrustedAccessRoleBinding(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SystemData :ivar provisioning_state: The current provisioning state of trusted access role binding. Known values are: "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBindingProvisioningState + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBindingProvisioningState :ivar source_resource_id: The ARM resource ID of source resource that trusted access is configured for. Required. :vartype source_resource_id: str @@ -11006,7 +11260,7 @@ def __init__(self, *, source_resource_id: str, roles: List[str], **kwargs: Any) :paramtype roles: list[str] """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.TrustedAccessRoleBindingProvisioningState"]] = None self.source_resource_id = source_resource_id self.roles = roles @@ -11018,7 +11272,7 @@ class TrustedAccessRoleBindingListResult(_serialization.Model): :ivar value: Role binding list. :vartype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -11036,11 +11290,11 @@ def __init__(self, *, value: Optional[List["_models.TrustedAccessRoleBinding"]] """ :keyword value: Role binding list. :paramtype value: - list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class TrustedAccessRoleListResult(_serialization.Model): @@ -11049,7 +11303,7 @@ class TrustedAccessRoleListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Role list. - :vartype value: list[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRole] + :vartype value: list[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRole] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -11067,8 +11321,8 @@ class TrustedAccessRoleListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.TrustedAccessRole"]] = None + self.next_link: Optional[str] = None class TrustedAccessRoleRule(_serialization.Model): @@ -11107,11 +11361,11 @@ class TrustedAccessRoleRule(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.verbs = None - self.api_groups = None - self.resources = None - self.resource_names = None - self.non_resource_ur_ls = None + self.verbs: Optional[List[str]] = None + self.api_groups: Optional[List[str]] = None + self.resources: Optional[List[str]] = None + self.resource_names: Optional[List[str]] = None + self.non_resource_ur_ls: Optional[List[str]] = None class UpgradeOverrideSettings(_serialization.Model): @@ -11182,7 +11436,7 @@ class VirtualMachinesProfile(_serialization.Model): """Specifications on VirtualMachines agent pool. :ivar scale: Specifications on how to scale a VirtualMachines agent pool. - :vartype scale: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleProfile + :vartype scale: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleProfile """ _attribute_map = { @@ -11192,7 +11446,7 @@ class VirtualMachinesProfile(_serialization.Model): def __init__(self, *, scale: Optional["_models.ScaleProfile"] = None, **kwargs: Any) -> None: """ :keyword scale: Specifications on how to scale a VirtualMachines agent pool. - :paramtype scale: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ScaleProfile + :paramtype scale: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ScaleProfile """ super().__init__(**kwargs) self.scale = scale @@ -11207,7 +11461,7 @@ class WeeklySchedule(_serialization.Model): :vartype interval_weeks: int :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeekDay + :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeekDay """ _validation = { @@ -11228,7 +11482,7 @@ def __init__(self, *, interval_weeks: int, day_of_week: Union[str, "_models.Week :keyword day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.WeekDay + :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.WeekDay """ super().__init__(**kwargs) self.interval_weeks = interval_weeks diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_patch.py similarity index 61% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_patch.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/operations/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/models/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/__init__.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/__init__.py index 786209b6598f..f8fd4f978b64 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/__init__.py @@ -16,6 +16,7 @@ from ._managed_clusters_operations import ManagedClustersOperations # type: ignore from ._container_service_operations import ContainerServiceOperations # type: ignore from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations # type: ignore +from ._namespaces_operations import NamespacesOperations # type: ignore from ._agent_pools_operations import AgentPoolsOperations # type: ignore from ._machines_operations import MachinesOperations # type: ignore from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore @@ -37,6 +38,7 @@ "ManagedClustersOperations", "ContainerServiceOperations", "MaintenanceConfigurationsOperations", + "NamespacesOperations", "AgentPoolsOperations", "MachinesOperations", "PrivateEndpointConnectionsOperations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_agent_pools_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_agent_pools_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_agent_pools_operations.py index 27fe44c31647..c7dd7da37753 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_agent_pools_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ def build_abort_latest_operation_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -93,14 +91,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -133,14 +131,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -183,7 +181,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,7 +189,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -240,14 +238,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -289,14 +287,14 @@ def build_get_upgrade_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -332,7 +330,7 @@ def build_delete_machines_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -340,7 +338,7 @@ def build_delete_machines_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -378,14 +376,14 @@ def build_get_available_agent_pool_versions_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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -418,14 +416,14 @@ def build_upgrade_node_image_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -461,7 +459,7 @@ class AgentPoolsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`agent_pools` attribute. """ @@ -469,10 +467,12 @@ class AgentPoolsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _abort_latest_operation_initial( @@ -490,7 +490,7 @@ def _abort_latest_operation_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -560,7 +560,7 @@ def begin_abort_latest_operation( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -614,14 +614,14 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I :type resource_name: str :return: An iterator like instance of either AgentPool or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) @@ -703,7 +703,7 @@ def get( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPool or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -718,7 +718,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) @@ -773,7 +773,7 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -850,7 +850,7 @@ def begin_create_or_update( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :param parameters: The agent pool to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -862,7 +862,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -903,7 +903,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -931,7 +931,7 @@ def begin_create_or_update( :type agent_pool_name: str :param parameters: The agent pool to create or update. Is either a AgentPool type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. @@ -941,14 +941,14 @@ def begin_create_or_update( :type if_none_match: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) @@ -1017,7 +1017,7 @@ def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1096,7 +1096,7 @@ def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1153,7 +1153,7 @@ def get_upgrade_profile( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPoolUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1168,7 +1168,7 @@ def get_upgrade_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) @@ -1221,7 +1221,7 @@ def _delete_machines_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1299,7 +1299,7 @@ def begin_delete_machines( :type agent_pool_name: str :param machines: A list of machines from the agent pool to be deleted. Required. :type machines: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolDeleteMachinesParameter + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolDeleteMachinesParameter :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1363,7 +1363,7 @@ def begin_delete_machines( :param machines: A list of machines from the agent pool to be deleted. Is either a AgentPoolDeleteMachinesParameter type or a IO[bytes] type. Required. :type machines: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolDeleteMachinesParameter or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolDeleteMachinesParameter or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] @@ -1373,7 +1373,7 @@ def begin_delete_machines( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1431,7 +1431,7 @@ def get_available_agent_pool_versions( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: AgentPoolAvailableVersions or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPoolAvailableVersions + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1446,7 +1446,7 @@ def get_available_agent_pool_versions( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) @@ -1493,7 +1493,7 @@ def _upgrade_node_image_version_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1556,14 +1556,14 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_container_service_operations.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_container_service_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_container_service_operations.py index 3cd28c296a22..a9868d63effa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_container_service_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_container_service_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +40,14 @@ def build_list_node_image_versions_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/nodeImageVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -72,7 +70,7 @@ class ContainerServiceOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`container_service` attribute. """ @@ -80,10 +78,12 @@ class ContainerServiceOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -98,14 +98,14 @@ def list_node_image_versions(self, location: str, **kwargs: Any) -> Iterable["_m :type location: str :return: An iterator like instance of either NodeImageVersion or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.NodeImageVersion] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.NodeImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.NodeImageVersionsListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_load_balancers_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_load_balancers_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_load_balancers_operations.py index 75a64b143d06..9c299659280b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_load_balancers_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_load_balancers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_managed_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -89,14 +88,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +136,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +144,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -188,14 +187,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -236,7 +235,7 @@ class LoadBalancersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`load_balancers` attribute. """ @@ -244,10 +243,12 @@ class LoadBalancersOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -265,14 +266,14 @@ def list_by_managed_cluster( :type resource_name: str :return: An iterator like instance of either LoadBalancer or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) @@ -354,7 +355,7 @@ def get( :param load_balancer_name: The name of the load balancer. Required. :type load_balancer_name: str :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -369,7 +370,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) @@ -425,12 +426,12 @@ def create_or_update( :param load_balancer_name: The name of the load balancer. Required. :type load_balancer_name: str :param parameters: The load balancer to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ @@ -462,7 +463,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ @@ -488,10 +489,10 @@ def create_or_update( :type load_balancer_name: str :param parameters: The load balancer to create or update. Is either a LoadBalancer type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer or IO[bytes] :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.LoadBalancer + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.LoadBalancer :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -506,7 +507,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) @@ -566,7 +567,7 @@ def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -632,7 +633,7 @@ def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_machines_operations.py similarity index 91% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_machines_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_machines_operations.py index 6a7ac8e6c2f7..8d5126e726c0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_machines_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +43,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -92,14 +91,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -138,7 +137,7 @@ class MachinesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`machines` attribute. """ @@ -146,10 +145,12 @@ class MachinesOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -169,14 +170,14 @@ def list( :type agent_pool_name: str :return: An iterator like instance of either Machine or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.Machine] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Machine] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) @@ -261,7 +262,7 @@ def get( :param machine_name: host name of the machine. Required. :type machine_name: str :return: Machine or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Machine + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -276,7 +277,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.Machine] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_maintenance_configurations_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_maintenance_configurations_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_maintenance_configurations_operations.py index aa7af37f9fee..ccdee6e96f99 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_maintenance_configurations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +44,14 @@ def build_list_by_managed_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -85,14 +84,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -126,7 +125,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -170,14 +169,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -211,7 +210,7 @@ class MaintenanceConfigurationsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`maintenance_configurations` attribute. """ @@ -219,10 +218,12 @@ class MaintenanceConfigurationsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -241,14 +242,14 @@ def list_by_managed_cluster( :return: An iterator like instance of either MaintenanceConfiguration or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) @@ -330,7 +331,7 @@ def get( :param config_name: The name of the maintenance configuration. Required. :type config_name: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -345,7 +346,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) @@ -402,12 +403,12 @@ def create_or_update( :type config_name: str :param parameters: The maintenance configuration to create or update. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -439,7 +440,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -466,9 +467,9 @@ def create_or_update( :param parameters: The maintenance configuration to create or update. Is either a MaintenanceConfiguration type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -483,7 +484,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) @@ -559,7 +560,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_managed_cluster_snapshots_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_managed_cluster_snapshots_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_managed_cluster_snapshots_operations.py index 59d663084e03..e133f7a524d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,13 +42,13 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -69,14 +68,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -99,14 +98,14 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -139,7 +138,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,7 +146,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -182,7 +181,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,7 +189,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -225,14 +224,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -265,7 +264,7 @@ class ManagedClusterSnapshotsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`managed_cluster_snapshots` attribute. """ @@ -273,10 +272,12 @@ class ManagedClusterSnapshotsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -288,14 +289,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: :return: An iterator like instance of either ManagedClusterSnapshot or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) @@ -373,14 +374,14 @@ def list_by_resource_group( :return: An iterator like instance of either ManagedClusterSnapshot or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) @@ -457,7 +458,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -472,7 +473,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) @@ -525,12 +526,12 @@ def create_or_update( :type resource_name: str :param parameters: The managed cluster snapshot to create or update. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -559,7 +560,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -583,9 +584,9 @@ def create_or_update( :param parameters: The managed cluster snapshot to create or update. Is either a ManagedClusterSnapshot type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot or IO[bytes] :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -600,7 +601,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) @@ -665,12 +666,12 @@ def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -700,7 +701,7 @@ def update_tags( Default value is "application/json". :paramtype content_type: str :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -723,10 +724,10 @@ def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or IO[bytes] :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterSnapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -741,7 +742,7 @@ def update_tags( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) @@ -814,7 +815,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_managed_clusters_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_managed_clusters_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_managed_clusters_operations.py index 72eaabe3918b..15969f1d8d26 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,14 +46,14 @@ def build_list_kubernetes_versions_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -76,7 +74,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,14 +100,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -134,14 +132,14 @@ def build_get_upgrade_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -174,14 +172,14 @@ def build_get_access_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -220,14 +218,14 @@ def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-lo _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -268,14 +266,14 @@ def build_list_cluster_user_credentials_request( # pylint: disable=name-too-lon _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -317,14 +315,14 @@ def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=n _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -357,14 +355,14 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -403,7 +401,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -411,7 +409,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -450,7 +448,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -458,7 +456,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -501,14 +499,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -547,7 +545,7 @@ def build_reset_service_principal_profile_request( # pylint: disable=name-too-l _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -555,7 +553,7 @@ def build_reset_service_principal_profile_request( # pylint: disable=name-too-l _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -590,7 +588,7 @@ def build_reset_aad_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -598,7 +596,7 @@ def build_reset_aad_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -633,14 +631,14 @@ def build_abort_latest_operation_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -673,14 +671,14 @@ def build_rotate_cluster_certificates_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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -713,14 +711,14 @@ def build_rotate_service_account_signing_keys_request( # pylint: disable=name-t _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -753,14 +751,14 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -793,14 +791,14 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -833,7 +831,7 @@ def build_run_command_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -841,7 +839,7 @@ def build_run_command_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -876,14 +874,14 @@ def build_get_command_result_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -917,14 +915,14 @@ def build_list_outbound_network_dependencies_endpoints_request( # pylint: disab _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -957,14 +955,14 @@ def build_get_guardrails_versions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -986,14 +984,14 @@ def build_list_guardrails_versions_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -1016,14 +1014,14 @@ def build_get_safeguards_versions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -1045,14 +1043,14 @@ def build_list_safeguards_versions_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -1075,14 +1073,14 @@ def build_list_mesh_revision_profiles_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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -1105,14 +1103,14 @@ def build_get_mesh_revision_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -1143,14 +1141,14 @@ def build_list_mesh_upgrade_profiles_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1183,14 +1181,14 @@ def build_get_mesh_upgrade_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1231,7 +1229,7 @@ def build_rebalance_load_balancers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1239,7 +1237,7 @@ def build_rebalance_load_balancers_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1274,7 +1272,7 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`managed_clusters` attribute. """ @@ -1282,10 +1280,12 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -1298,7 +1298,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :param location: The name of the Azure region. Required. :type location: str :return: KubernetesVersionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.KubernetesVersionListResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1313,7 +1313,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) @@ -1352,14 +1352,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) @@ -1434,14 +1434,14 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite :type resource_group_name: str :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) @@ -1520,7 +1520,7 @@ def get_upgrade_profile( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedClusterUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1535,7 +1535,7 @@ def get_upgrade_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) @@ -1586,7 +1586,7 @@ def get_access_profile( :param role_name: The name of the role for managed cluster accessProfile resource. Required. :type role_name: str :return: ManagedClusterAccessProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAccessProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1601,7 +1601,7 @@ def get_access_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) @@ -1650,7 +1650,7 @@ def list_cluster_admin_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1665,7 +1665,7 @@ def list_cluster_admin_credentials( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) @@ -1722,9 +1722,9 @@ def list_cluster_user_credentials( 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. Known values are: "azure", "exec", and "exec". Default value is None. - :type format: str or ~azure.mgmt.containerservice.v2025_01_02_preview.models.Format + :type format: str or ~azure.mgmt.containerservice.v2025_02_02_preview.models.Format :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1739,7 +1739,7 @@ def list_cluster_user_credentials( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) @@ -1789,7 +1789,7 @@ def list_cluster_monitoring_user_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1804,7 +1804,7 @@ def list_cluster_monitoring_user_credentials( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) @@ -1849,7 +1849,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedCluster or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1864,7 +1864,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) @@ -1917,7 +1917,7 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1990,7 +1990,7 @@ def begin_create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The managed cluster to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -2003,7 +2003,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2042,7 +2042,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2067,7 +2067,7 @@ def begin_create_or_update( :type resource_name: str :param parameters: The managed cluster to create or update. Is either a ManagedCluster type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. @@ -2078,14 +2078,14 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) @@ -2152,7 +2152,7 @@ def _update_tags_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2223,7 +2223,7 @@ def begin_update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -2233,7 +2233,7 @@ def begin_update_tags( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2268,7 +2268,7 @@ def begin_update_tags( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2292,7 +2292,7 @@ def begin_update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. @@ -2300,14 +2300,14 @@ def begin_update_tags( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) @@ -2373,7 +2373,7 @@ def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2448,7 +2448,7 @@ def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2507,7 +2507,7 @@ def _reset_service_principal_profile_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2581,7 +2581,7 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterServicePrincipalProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2639,7 +2639,7 @@ def begin_reset_service_principal_profile( :param parameters: The service principal profile to set on the managed cluster. Is either a ManagedClusterServicePrincipalProfile type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterServicePrincipalProfile or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] @@ -2649,7 +2649,7 @@ def begin_reset_service_principal_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2711,7 +2711,7 @@ def _reset_aad_profile_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2787,7 +2787,7 @@ def begin_reset_aad_profile( :type resource_name: str :param parameters: The AAD profile to set on the Managed Cluster. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAADProfile + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAADProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2849,7 +2849,7 @@ def begin_reset_aad_profile( :param parameters: The AAD profile to set on the Managed Cluster. Is either a ManagedClusterAADProfile type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.ManagedClusterAADProfile or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.ManagedClusterAADProfile or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2858,7 +2858,7 @@ def begin_reset_aad_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2916,7 +2916,7 @@ def _abort_latest_operation_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2983,7 +2983,7 @@ def begin_abort_latest_operation( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3038,7 +3038,7 @@ def _rotate_cluster_certificates_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3101,7 +3101,7 @@ def begin_rotate_cluster_certificates( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3156,7 +3156,7 @@ def _rotate_service_account_signing_keys_initial( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3218,7 +3218,7 @@ def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3271,7 +3271,7 @@ def _stop_initial(self, resource_group_name: str, resource_name: str, **kwargs: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3335,7 +3335,7 @@ def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3388,7 +3388,7 @@ def _start_initial(self, resource_group_name: str, resource_name: str, **kwargs: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3449,7 +3449,7 @@ def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: An _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3508,7 +3508,7 @@ def _run_command_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3584,14 +3584,14 @@ def begin_run_command( :type resource_name: str :param request_payload: The run command request. Required. :type request_payload: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandRequest + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3624,7 +3624,7 @@ def begin_run_command( :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3650,18 +3650,18 @@ def begin_run_command( :param request_payload: The run command request. Is either a RunCommandRequest type or a IO[bytes] type. Required. :type request_payload: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandRequest or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandRequest or IO[bytes] :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) @@ -3724,7 +3724,7 @@ def get_command_result( :param command_id: Id of the command. Required. :type command_id: str :return: RunCommandResult or None or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.RunCommandResult or None + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3739,7 +3739,7 @@ def get_command_result( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) @@ -3782,7 +3782,6 @@ def get_command_result( def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> Iterable["_models.OutboundEnvironmentEndpoint"]: - # pylint: disable=line-too-long """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. @@ -3797,14 +3796,14 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.OutboundEnvironmentEndpoint] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.OutboundEnvironmentEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) @@ -3881,7 +3880,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :param version: Safeguards version. Required. :type version: str :return: GuardrailsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersion + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3896,7 +3895,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) @@ -3930,7 +3929,6 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> @distributed_trace def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_models.GuardrailsAvailableVersion"]: - # pylint: disable=line-too-long """Gets a list of supported Guardrails versions in the specified subscription and location. Contains list of Guardrails version along with its support info and whether it is a default @@ -3941,14 +3939,14 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m :return: An iterator like instance of either GuardrailsAvailableVersion or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.GuardrailsAvailableVersion] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.GuardrailsAvailableVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) @@ -4024,7 +4022,7 @@ def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> :param version: Safeguards version. Required. :type version: str :return: SafeguardsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersion + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4039,7 +4037,7 @@ def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) @@ -4073,7 +4071,6 @@ def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> @distributed_trace def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_models.SafeguardsAvailableVersion"]: - # pylint: disable=line-too-long """Gets a list of supported Safeguards versions in the specified subscription and location. Contains list of Safeguards version along with its support info and whether it is a default @@ -4084,14 +4081,14 @@ def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_m :return: An iterator like instance of either SafeguardsAvailableVersion or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.SafeguardsAvailableVersion] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.SafeguardsAvailableVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) @@ -4167,14 +4164,14 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ :type location: str :return: An iterator like instance of either MeshRevisionProfile or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfile] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) @@ -4251,7 +4248,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :param mode: The mode of the mesh. Required. :type mode: str :return: MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshRevisionProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4266,7 +4263,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) @@ -4313,14 +4310,14 @@ def list_mesh_upgrade_profiles( :type resource_name: str :return: An iterator like instance of either MeshUpgradeProfile or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfile] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) @@ -4402,7 +4399,7 @@ def get_mesh_upgrade_profile( :param mode: The mode of the mesh. Required. :type mode: str :return: MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.MeshUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4417,7 +4414,7 @@ def get_mesh_upgrade_profile( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) @@ -4469,7 +4466,7 @@ def _rebalance_load_balancers_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -4544,7 +4541,7 @@ def begin_rebalance_load_balancers( :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RebalanceLoadBalancersRequestBody + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RebalanceLoadBalancersRequestBody :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4604,7 +4601,7 @@ def begin_rebalance_load_balancers( balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.RebalanceLoadBalancersRequestBody or + ~azure.mgmt.containerservice.v2025_02_02_preview.models.RebalanceLoadBalancersRequestBody or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] @@ -4614,7 +4611,7 @@ def begin_rebalance_load_balancers( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_namespaces_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_namespaces_operations.py new file mode 100644 index 000000000000..4b51081bf97e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_namespaces_operations.py @@ -0,0 +1,1054 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_managed_cluster_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "resourceName": _SERIALIZER.url( + "resource_name", + resource_name, + "str", + max_length=63, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, resource_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces/{namespaceName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "resourceName": _SERIALIZER.url( + "resource_name", + resource_name, + "str", + max_length=63, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + "namespaceName": _SERIALIZER.url( + "namespace_name", + namespace_name, + "str", + max_length=63, + min_length=1, + pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, resource_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces/{namespaceName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "resourceName": _SERIALIZER.url( + "resource_name", + resource_name, + "str", + max_length=63, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + "namespaceName": _SERIALIZER.url( + "namespace_name", + namespace_name, + "str", + max_length=63, + min_length=1, + pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, resource_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces/{namespaceName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "resourceName": _SERIALIZER.url( + "resource_name", + resource_name, + "str", + max_length=63, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + "namespaceName": _SERIALIZER.url( + "namespace_name", + namespace_name, + "str", + max_length=63, + min_length=1, + pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, resource_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces/{namespaceName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "resourceName": _SERIALIZER.url( + "resource_name", + resource_name, + "str", + max_length=63, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + "namespaceName": _SERIALIZER.url( + "namespace_name", + namespace_name, + "str", + max_length=63, + min_length=1, + pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_credential_request( + resource_group_name: str, resource_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/namespaces/{namespaceName}/listCredential", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "resourceName": _SERIALIZER.url( + "resource_name", + resource_name, + "str", + max_length=63, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + "namespaceName": _SERIALIZER.url( + "namespace_name", + namespace_name, + "str", + max_length=63, + min_length=1, + pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class NamespacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s + :attr:`namespaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientTestConfiguration = ( + 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") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.Namespace"]: + """Gets a list of managed namespaces in the specified managed cluster. + + Gets a list of managed namespaces in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of either Namespace or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NamespaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> _models.Namespace: + """Gets the specified namespace of a managed cluster. + + Gets the specified namespace of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Namespace") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: _models.Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Creates or updates a namespace in the specified managed cluster. + + Creates or updates a namespace in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Creates or updates a namespace in the specified managed cluster. + + Creates or updates a namespace in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Creates or updates a namespace in the specified managed cluster. + + Creates or updates a namespace in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: The namespace to create or update. Is either a Namespace type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace or + IO[bytes] + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Namespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Namespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a namespace. + + Deletes a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Namespace: + """Updates tags on a namespace. + + Updates tags on a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Namespace: + """Updates tags on a namespace. + + Updates tags on a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + resource_name: str, + namespace_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Namespace: + """Updates tags on a namespace. + + Updates tags on a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Is either a TagsObject type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or + IO[bytes] + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_credential( + self, resource_group_name: str, resource_name: str, namespace_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of a namespace. + + Lists the credentials of a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_credential_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_operation_status_result_operations.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_operation_status_result_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_operation_status_result_operations.py index 6bb4aaa248f2..66936482651d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_operation_status_result_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +43,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -84,14 +83,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -130,14 +129,14 @@ def build_get_by_agent_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -174,7 +173,7 @@ class OperationStatusResultOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`operation_status_result` attribute. """ @@ -182,10 +181,12 @@ class OperationStatusResultOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -204,14 +205,14 @@ def list( :return: An iterator like instance of either OperationStatusResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) @@ -293,7 +294,7 @@ def get( :param operation_id: The ID of an ongoing async operation. Required. :type operation_id: str :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -308,7 +309,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -359,7 +360,7 @@ def get_by_agent_pool( :param operation_id: The ID of an ongoing async operation. Required. :type operation_id: str :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationStatusResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -374,7 +375,7 @@ def get_by_agent_pool( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_operations.py similarity index 86% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_operations.py index be35b5c8e0b8..5d6ef5b0cb62 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +61,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`operations` attribute. """ @@ -71,10 +69,12 @@ 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -85,14 +85,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: :return: An iterator like instance of either OperationValue or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.OperationValue] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.OperationValue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_private_endpoint_connections_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_private_endpoint_connections_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_private_endpoint_connections_operations.py index 504c04c9a06f..4b10311417cf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,12 +30,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,14 +46,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -91,14 +90,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -138,7 +137,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -146,7 +145,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -188,14 +187,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -231,7 +230,7 @@ class PrivateEndpointConnectionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`private_endpoint_connections` attribute. """ @@ -239,10 +238,12 @@ class PrivateEndpointConnectionsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -261,7 +262,7 @@ def list( :type resource_name: str :return: PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnectionListResult + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -276,7 +277,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) @@ -325,7 +326,7 @@ def get( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -340,7 +341,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -397,12 +398,12 @@ def update( :type private_endpoint_connection_name: str :param parameters: The updated private endpoint connection. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -434,7 +435,7 @@ def update( Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -461,9 +462,9 @@ def update( :param parameters: The updated private endpoint connection. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection or IO[bytes] :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -478,7 +479,7 @@ def update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -538,7 +539,7 @@ def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -599,7 +600,7 @@ def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_private_link_resources_operations.py similarity index 85% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_private_link_resources_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_private_link_resources_operations.py index ba6206c9ab62..881b088c8cac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +41,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -82,7 +81,7 @@ class PrivateLinkResourcesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`private_link_resources` attribute. """ @@ -90,10 +89,12 @@ class PrivateLinkResourcesOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -111,7 +112,7 @@ def list( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResourcesListResult + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -126,7 +127,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_resolve_private_link_service_id_operations.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_resolve_private_link_service_id_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_resolve_private_link_service_id_operations.py index 64284eb30697..2f1a9812d891 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_post_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -51,7 +50,7 @@ def build_post_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -86,7 +85,7 @@ class ResolvePrivateLinkServiceIdOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`resolve_private_link_service_id` attribute. """ @@ -94,10 +93,12 @@ class ResolvePrivateLinkServiceIdOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload @@ -120,12 +121,12 @@ def post( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -154,7 +155,7 @@ def post( Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -177,10 +178,10 @@ def post( :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Is either a PrivateLinkResource type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource or IO[bytes] :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -195,7 +196,7 @@ def post( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_snapshots_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_snapshots_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_snapshots_operations.py index e1982a834736..60d4cc861812 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_snapshots_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,14 +66,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -97,14 +96,14 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +136,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +144,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -180,7 +179,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -188,7 +187,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -223,14 +222,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -263,7 +262,7 @@ class SnapshotsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`snapshots` attribute. """ @@ -271,10 +270,12 @@ class SnapshotsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -285,14 +286,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: :return: An iterator like instance of either Snapshot or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) @@ -367,14 +368,14 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite :type resource_group_name: str :return: An iterator like instance of either Snapshot or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) @@ -451,7 +452,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -466,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -518,12 +519,12 @@ def create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -552,7 +553,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -575,9 +576,9 @@ def create_or_update( :type resource_name: str :param parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -592,7 +593,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -656,12 +657,12 @@ def update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -690,7 +691,7 @@ def update_tags( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -713,10 +714,10 @@ def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TagsObject or + :type parameters: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TagsObject or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -731,7 +732,7 @@ def update_tags( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -804,7 +805,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_trusted_access_role_bindings_operations.py similarity index 95% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_trusted_access_role_bindings_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_trusted_access_role_bindings_operations.py index a426f8628c3b..a07c446a11ae 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -93,14 +92,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -145,7 +144,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,7 +152,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -200,14 +199,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -248,7 +247,7 @@ class TrustedAccessRoleBindingsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`trusted_access_role_bindings` attribute. """ @@ -256,10 +255,12 @@ class TrustedAccessRoleBindingsOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -278,14 +279,14 @@ def list( :return: An iterator like instance of either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) @@ -367,7 +368,7 @@ def get( :param trusted_access_role_binding_name: The name of trusted access role binding. Required. :type trusted_access_role_binding_name: str :return: TrustedAccessRoleBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding + :rtype: ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -382,7 +383,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) @@ -435,7 +436,7 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -510,14 +511,14 @@ def begin_create_or_update( :type trusted_access_role_binding_name: str :param trusted_access_role_binding: A trusted access role binding. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -551,7 +552,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -578,18 +579,18 @@ def begin_create_or_update( :param trusted_access_role_binding: A trusted access role binding. Is either a TrustedAccessRoleBinding type or a IO[bytes] type. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding or IO[bytes] + ~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding or IO[bytes] :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRoleBinding] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) @@ -650,7 +651,7 @@ def _delete_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -716,7 +717,7 @@ def begin_delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_trusted_access_roles_operations.py similarity index 87% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_trusted_access_roles_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_trusted_access_roles_operations.py index 9f84bd6e3f09..b8dcafae816c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/operations/_trusted_access_roles_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientTestConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +40,14 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2025-01-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -72,7 +70,7 @@ class TrustedAccessRolesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_01_02_preview.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_02_02_preview.ContainerServiceClientTest`'s :attr:`trusted_access_roles` attribute. """ @@ -80,10 +78,12 @@ class TrustedAccessRolesOperations: 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: ContainerServiceClientTestConfiguration = ( + 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -96,14 +96,14 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR :type location: str :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_01_02_preview.models.TrustedAccessRole] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_02_preview.models.TrustedAccessRole] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2025-01-02-preview") + "api_version", _params.pop("api-version", self._api_version or "2025-02-02-preview") ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/py.typed similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/py.typed rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_02_preview/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/__init__.py similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/__init__.py diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_configuration.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_configuration.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_configuration.py index 6c5d5778d2a1..7d311cb211ad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_configuration.py @@ -27,13 +27,13 @@ class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-02-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/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_container_service_client.py similarity index 79% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_container_service_client.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_container_service_client.py index 6fdce52a95bc..a82f1b11ea16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_container_service_client.py @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models -from .._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import ( AgentPoolsOperations, MachinesOperations, @@ -40,41 +42,41 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """The Container Service Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerservice.v2025_02_01.operations.Operations + :vartype operations: azure.mgmt.containerservice.v2025_03_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: - azure.mgmt.containerservice.v2025_02_01.operations.ManagedClustersOperations + azure.mgmt.containerservice.v2025_03_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations :vartype maintenance_configurations: - azure.mgmt.containerservice.v2025_02_01.operations.MaintenanceConfigurationsOperations + azure.mgmt.containerservice.v2025_03_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2025_02_01.operations.AgentPoolsOperations + :vartype agent_pools: azure.mgmt.containerservice.v2025_03_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - azure.mgmt.containerservice.v2025_02_01.operations.PrivateEndpointConnectionsOperations + azure.mgmt.containerservice.v2025_03_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: - azure.mgmt.containerservice.v2025_02_01.operations.PrivateLinkResourcesOperations + azure.mgmt.containerservice.v2025_03_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations :vartype resolve_private_link_service_id: - azure.mgmt.containerservice.v2025_02_01.operations.ResolvePrivateLinkServiceIdOperations + azure.mgmt.containerservice.v2025_03_01.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.containerservice.v2025_02_01.operations.SnapshotsOperations + :vartype snapshots: azure.mgmt.containerservice.v2025_03_01.operations.SnapshotsOperations :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations :vartype trusted_access_role_bindings: - azure.mgmt.containerservice.v2025_02_01.operations.TrustedAccessRoleBindingsOperations + azure.mgmt.containerservice.v2025_03_01.operations.TrustedAccessRoleBindingsOperations :ivar trusted_access_roles: TrustedAccessRolesOperations operations :vartype trusted_access_roles: - azure.mgmt.containerservice.v2025_02_01.operations.TrustedAccessRolesOperations + azure.mgmt.containerservice.v2025_03_01.operations.TrustedAccessRolesOperations :ivar machines: MachinesOperations operations - :vartype machines: azure.mgmt.containerservice.v2025_02_01.operations.MachinesOperations + :vartype machines: azure.mgmt.containerservice.v2025_03_01.operations.MachinesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + :keyword api_version: Api Version. 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 @@ -82,15 +84,17 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -109,41 +113,41 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2025-02-01") + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2025-03-01") self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.trusted_access_roles = TrustedAccessRolesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) - self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize, "2025-02-01") + self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize, "2025-03-01") def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_metadata.json similarity index 81% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_metadata.json rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_metadata.json index 44974bd690a8..ddb2384cf43e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2025-02-01", - "total_api_version_list": ["2025-02-01"], + "chosen_version": "2025-03-01", + "total_api_version_list": ["2025-03-01"], "client": { "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "host_value": "\"https://management.azure.com\"", + "host_value": null, "parameterized_host_template": null, "azure_arm": true, "has_public_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._utils.serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -57,7 +57,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, @@ -80,7 +80,7 @@ "method_location": "positional" }, "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", + "signature": "base_url: Optional[str] = None,", "description": "Service URL", "docstring_type": "str", "required": false, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_utils/serialization.py new file mode 100644 index 000000000000..f5187701d7be --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_utils/serialization.py @@ -0,0 +1,2032 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_version.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_version.py index 6ba690f28963..470657edc1cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "35.0.0" +VERSION = "36.0.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/__init__.py similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_01_02_preview/aio/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/__init__.py diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_configuration.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_configuration.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_configuration.py index 7e775f1c42a9..7f55141ff04b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_configuration.py @@ -27,13 +27,13 @@ class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-02-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/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_container_service_client.py similarity index 79% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_container_service_client.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_container_service_client.py index ea3e675f5a89..984b630b7fee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_container_service_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from ..._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration from .operations import ( AgentPoolsOperations, @@ -40,42 +42,42 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """The Container Service Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerservice.v2025_02_01.aio.operations.Operations + :vartype operations: azure.mgmt.containerservice.v2025_03_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: - azure.mgmt.containerservice.v2025_02_01.aio.operations.ManagedClustersOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations :vartype maintenance_configurations: - azure.mgmt.containerservice.v2025_02_01.aio.operations.MaintenanceConfigurationsOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: - azure.mgmt.containerservice.v2025_02_01.aio.operations.AgentPoolsOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - azure.mgmt.containerservice.v2025_02_01.aio.operations.PrivateEndpointConnectionsOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: - azure.mgmt.containerservice.v2025_02_01.aio.operations.PrivateLinkResourcesOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations :vartype resolve_private_link_service_id: - azure.mgmt.containerservice.v2025_02_01.aio.operations.ResolvePrivateLinkServiceIdOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.containerservice.v2025_02_01.aio.operations.SnapshotsOperations + :vartype snapshots: azure.mgmt.containerservice.v2025_03_01.aio.operations.SnapshotsOperations :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations :vartype trusted_access_role_bindings: - azure.mgmt.containerservice.v2025_02_01.aio.operations.TrustedAccessRoleBindingsOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.TrustedAccessRoleBindingsOperations :ivar trusted_access_roles: TrustedAccessRolesOperations operations :vartype trusted_access_roles: - azure.mgmt.containerservice.v2025_02_01.aio.operations.TrustedAccessRolesOperations + azure.mgmt.containerservice.v2025_03_01.aio.operations.TrustedAccessRolesOperations :ivar machines: MachinesOperations operations - :vartype machines: azure.mgmt.containerservice.v2025_02_01.aio.operations.MachinesOperations + :vartype machines: azure.mgmt.containerservice.v2025_03_01.aio.operations.MachinesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + :keyword api_version: Api Version. 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 @@ -83,15 +85,17 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ContainerServiceClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -110,41 +114,43 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2025-02-01") + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2025-03-01") self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) self.trusted_access_roles = TrustedAccessRolesOperations( - self._client, self._config, self._serialize, self._deserialize, "2025-02-01" + self._client, self._config, self._serialize, self._deserialize, "2025-03-01" ) - self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize, "2025-02-01") + self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize, "2025-03-01") def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/__init__.py similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/__init__.py diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_agent_pools_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_agent_pools_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_agent_pools_operations.py index 72b6670c926d..c925bcbe94dd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_agent_pools_operations.py @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._agent_pools_operations import ( build_abort_latest_operation_request, build_create_or_update_request, @@ -43,11 +45,8 @@ build_list_request, build_upgrade_node_image_version_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +57,7 @@ class AgentPoolsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`agent_pools` attribute. """ @@ -66,10 +65,10 @@ class AgentPoolsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _abort_latest_operation_initial( @@ -86,7 +85,7 @@ async def _abort_latest_operation_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_abort_latest_operation_request( @@ -154,7 +153,7 @@ async def begin_abort_latest_operation( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -207,13 +206,13 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A :type resource_name: str :return: An iterator like instance of either AgentPool or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -294,7 +293,7 @@ async def get( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPool or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPool + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -308,7 +307,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) _request = build_get_request( @@ -361,7 +360,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -437,7 +436,7 @@ async def begin_create_or_update( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :param parameters: The agent pool to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPool + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPool :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -450,7 +449,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -492,7 +491,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -520,7 +519,7 @@ async def begin_create_or_update( :type agent_pool_name: str :param parameters: The agent pool to create or update. Is either a AgentPool type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPool or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPool or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -530,13 +529,13 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -603,7 +602,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -680,7 +679,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -736,7 +735,7 @@ async def get_upgrade_profile( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPoolUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -750,7 +749,7 @@ async def get_upgrade_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) _request = build_get_upgrade_profile_request( @@ -801,7 +800,7 @@ async def _delete_machines_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -878,7 +877,7 @@ async def begin_delete_machines( :type agent_pool_name: str :param machines: A list of machines from the agent pool to be deleted. Required. :type machines: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolDeleteMachinesParameter + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolDeleteMachinesParameter :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -942,7 +941,7 @@ async def begin_delete_machines( :param machines: A list of machines from the agent pool to be deleted. Is either a AgentPoolDeleteMachinesParameter type or a IO[bytes] type. Required. :type machines: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolDeleteMachinesParameter or IO[bytes] + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolDeleteMachinesParameter or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -950,7 +949,7 @@ async def begin_delete_machines( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1007,7 +1006,7 @@ async def get_available_agent_pool_versions( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: AgentPoolAvailableVersions or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolAvailableVersions + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1021,7 +1020,7 @@ async def get_available_agent_pool_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) _request = build_get_available_agent_pool_versions_request( @@ -1066,7 +1065,7 @@ async def _upgrade_node_image_version_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_upgrade_node_image_version_request( @@ -1129,13 +1128,13 @@ async def begin_upgrade_node_image_version( :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_machines_operations.py similarity index 90% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_machines_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_machines_operations.py index 2ec1c0ac55dc..66f75223b8f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_machines_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._machines_operations import build_get_request, build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +41,7 @@ class MachinesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`machines` attribute. """ @@ -50,10 +49,10 @@ class MachinesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -73,13 +72,13 @@ def list( :type agent_pool_name: str :return: An iterator like instance of either Machine or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.Machine] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.Machine] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -163,7 +162,7 @@ async def get( :param machine_name: host name of the machine. Required. :type machine_name: str :return: Machine or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Machine + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -177,7 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.Machine] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_maintenance_configurations_operations.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_maintenance_configurations_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_maintenance_configurations_operations.py index 5a1d4ad766f1..f11c286ba716 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_maintenance_configurations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,17 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._maintenance_configurations_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ class MaintenanceConfigurationsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`maintenance_configurations` attribute. """ @@ -56,17 +56,16 @@ class MaintenanceConfigurationsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.MaintenanceConfiguration"]: - # pylint: disable=line-too-long """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -79,13 +78,13 @@ def list_by_managed_cluster( :return: An iterator like instance of either MaintenanceConfiguration or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -166,7 +165,7 @@ async def get( :param config_name: The name of the maintenance configuration. Required. :type config_name: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -180,7 +179,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) _request = build_get_request( @@ -235,12 +234,12 @@ async def create_or_update( :param config_name: The name of the maintenance configuration. Required. :type config_name: str :param parameters: The maintenance configuration to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -272,7 +271,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -298,10 +297,10 @@ async def create_or_update( :type config_name: str :param parameters: The maintenance configuration to create or update. Is either a MaintenanceConfiguration type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -315,7 +314,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) @@ -387,7 +386,7 @@ async def delete(self, resource_group_name: str, resource_name: str, config_name _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_managed_clusters_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_managed_clusters_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_managed_clusters_operations.py index 9290bbaf0561..a1b8e5df4434 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._managed_clusters_operations import ( build_abort_latest_operation_request, build_create_or_update_request, @@ -60,11 +62,8 @@ build_stop_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +74,7 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`managed_clusters` attribute. """ @@ -83,10 +82,10 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async @@ -99,7 +98,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :param location: The name of the Azure region. Required. :type location: str :return: KubernetesVersionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesVersionListResult + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -113,7 +112,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) _request = build_list_kubernetes_versions_request( @@ -151,13 +150,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -233,13 +232,13 @@ def list_by_resource_group( :type resource_group_name: str :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -317,7 +316,7 @@ async def get_upgrade_profile( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedClusterUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -331,7 +330,7 @@ async def get_upgrade_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) _request = build_get_upgrade_profile_request( @@ -381,7 +380,7 @@ async def get_access_profile( :param role_name: The name of the role for managed cluster accessProfile resource. Required. :type role_name: str :return: ManagedClusterAccessProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAccessProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -395,7 +394,7 @@ async def get_access_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) _request = build_get_access_profile_request( @@ -443,7 +442,7 @@ async def list_cluster_admin_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -457,7 +456,7 @@ async def list_cluster_admin_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) _request = build_list_cluster_admin_credentials_request( @@ -513,9 +512,9 @@ async def list_cluster_user_credentials( 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. Known values are: "azure", "exec", and "exec". Default value is None. - :type format: str or ~azure.mgmt.containerservice.v2025_02_01.models.Format + :type format: str or ~azure.mgmt.containerservice.v2025_03_01.models.Format :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -529,7 +528,7 @@ async def list_cluster_user_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) _request = build_list_cluster_user_credentials_request( @@ -578,7 +577,7 @@ async def list_cluster_monitoring_user_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -592,7 +591,7 @@ async def list_cluster_monitoring_user_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) _request = build_list_cluster_monitoring_user_credentials_request( @@ -636,7 +635,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedCluster or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -650,7 +649,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) _request = build_get_request( @@ -701,7 +700,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -773,7 +772,7 @@ async def begin_create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The managed cluster to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -786,7 +785,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -825,7 +824,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -850,7 +849,7 @@ async def begin_create_or_update( :type resource_name: str :param parameters: The managed cluster to create or update. Is either a ManagedCluster type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -860,13 +859,13 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -931,7 +930,7 @@ async def _update_tags_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1001,7 +1000,7 @@ async def begin_update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -1011,7 +1010,7 @@ async def begin_update_tags( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1046,7 +1045,7 @@ async def begin_update_tags( :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1070,20 +1069,20 @@ async def begin_update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1142,7 +1141,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1206,7 +1205,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1262,7 +1261,7 @@ async def _reset_service_principal_profile_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1335,7 +1334,7 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterServicePrincipalProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1393,7 +1392,7 @@ async def begin_reset_service_principal_profile( :param parameters: The service principal profile to set on the managed cluster. Is either a ManagedClusterServicePrincipalProfile type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterServicePrincipalProfile or + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterServicePrincipalProfile or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -1402,7 +1401,7 @@ async def begin_reset_service_principal_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1462,7 +1461,7 @@ async def _reset_aad_profile_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1536,7 +1535,7 @@ async def begin_reset_aad_profile( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The AAD profile to set on the Managed Cluster. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAADProfile + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAADProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1597,7 +1596,7 @@ async def begin_reset_aad_profile( :type resource_name: str :param parameters: The AAD profile to set on the Managed Cluster. Is either a ManagedClusterAADProfile type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAADProfile or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAADProfile or IO[bytes] :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -1606,7 +1605,7 @@ async def begin_reset_aad_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1662,7 +1661,7 @@ async def _rotate_cluster_certificates_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_rotate_cluster_certificates_request( @@ -1723,7 +1722,7 @@ async def begin_rotate_cluster_certificates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1776,7 +1775,7 @@ async def _abort_latest_operation_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_abort_latest_operation_request( @@ -1841,7 +1840,7 @@ async def begin_abort_latest_operation( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1894,7 +1893,7 @@ async def _rotate_service_account_signing_keys_initial( # pylint: disable=name- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_rotate_service_account_signing_keys_request( @@ -1954,7 +1953,7 @@ async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2005,7 +2004,7 @@ async def _stop_initial(self, resource_group_name: str, resource_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_stop_request( @@ -2067,7 +2066,7 @@ async def begin_stop(self, resource_group_name: str, resource_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2118,7 +2117,7 @@ async def _start_initial(self, resource_group_name: str, resource_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_start_request( @@ -2177,7 +2176,7 @@ async def begin_start(self, resource_group_name: str, resource_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2234,7 +2233,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2308,14 +2307,14 @@ async def begin_run_command( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param request_payload: The run command request. Required. - :type request_payload: ~azure.mgmt.containerservice.v2025_02_01.models.RunCommandRequest + :type request_payload: ~azure.mgmt.containerservice.v2025_03_01.models.RunCommandRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2348,7 +2347,7 @@ async def begin_run_command( :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2373,18 +2372,18 @@ async def begin_run_command( :type resource_name: str :param request_payload: The run command request. Is either a RunCommandRequest type or a IO[bytes] type. Required. - :type request_payload: ~azure.mgmt.containerservice.v2025_02_01.models.RunCommandRequest or + :type request_payload: ~azure.mgmt.containerservice.v2025_03_01.models.RunCommandRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2446,7 +2445,7 @@ async def get_command_result( :param command_id: Id of the command. Required. :type command_id: str :return: RunCommandResult or None or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult or None + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2460,7 +2459,7 @@ async def get_command_result( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) _request = build_get_command_result_request( @@ -2502,7 +2501,6 @@ async def get_command_result( def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpoint"]: - # pylint: disable=line-too-long """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. @@ -2517,13 +2515,13 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.OutboundEnvironmentEndpoint] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.OutboundEnvironmentEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2599,13 +2597,13 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter :type location: str :return: An iterator like instance of either MeshRevisionProfile or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfile] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2681,7 +2679,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :param mode: The mode of the mesh. Required. :type mode: str :return: MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2695,7 +2693,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) _request = build_get_mesh_revision_profile_request( @@ -2741,13 +2739,13 @@ def list_mesh_upgrade_profiles( :type resource_name: str :return: An iterator like instance of either MeshUpgradeProfile or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfile] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2828,7 +2826,7 @@ async def get_mesh_upgrade_profile( :param mode: The mode of the mesh. Required. :type mode: str :return: MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2842,7 +2840,7 @@ async def get_mesh_upgrade_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) _request = build_get_mesh_upgrade_profile_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_operations.py similarity index 85% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_operations.py index bcb289c7e5e9..e25990d20128 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`operations` attribute. """ @@ -49,10 +48,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -63,13 +62,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: :return: An iterator like instance of either OperationValue or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.OperationValue] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.OperationValue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_private_endpoint_connections_operations.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_private_endpoint_connections_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_private_endpoint_connections_operations.py index 1703b73ecd42..2c9159c4604b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,17 +29,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_endpoint_connections_operations import ( build_delete_request, build_get_request, build_list_request, build_update_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +48,7 @@ class PrivateEndpointConnectionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`private_endpoint_connections` attribute. """ @@ -57,10 +56,10 @@ class PrivateEndpointConnectionsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async @@ -78,7 +77,7 @@ async def list( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnectionListResult + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -92,7 +91,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) _request = build_list_request( @@ -140,7 +139,7 @@ async def get( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -154,7 +153,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( @@ -209,12 +208,12 @@ async def update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param parameters: The updated private endpoint connection. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -246,7 +245,7 @@ async def update( Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -272,10 +271,10 @@ async def update( :type private_endpoint_connection_name: str :param parameters: The updated private endpoint connection. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection or IO[bytes] :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -289,7 +288,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -347,7 +346,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -406,7 +405,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_private_link_resources_operations.py similarity index 83% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_private_link_resources_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_private_link_resources_operations.py index 46bb6e9fa769..04785c682c2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_private_link_resources_operations.py @@ -5,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_link_resources_operations import build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +38,7 @@ class PrivateLinkResourcesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`private_link_resources` attribute. """ @@ -47,10 +46,10 @@ class PrivateLinkResourcesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async @@ -68,7 +67,7 @@ async def list( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResourcesListResult + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -82,7 +81,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) _request = build_list_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_resolve_private_link_service_id_operations.py similarity index 87% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_resolve_private_link_service_id_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_resolve_private_link_service_id_operations.py index f80af2b8f948..ea3a14a3a2c5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._resolve_private_link_service_id_operations import build_post_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +39,7 @@ class ResolvePrivateLinkServiceIdOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`resolve_private_link_service_id` attribute. """ @@ -48,10 +47,10 @@ class ResolvePrivateLinkServiceIdOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload @@ -74,12 +73,12 @@ async def post( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -108,7 +107,7 @@ async def post( Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -131,10 +130,10 @@ async def post( :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Is either a PrivateLinkResource type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource or IO[bytes] :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -148,7 +147,7 @@ async def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_snapshots_operations.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_snapshots_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_snapshots_operations.py index be1e33839ed7..9c82370c84ab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_snapshots_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._snapshots_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +37,8 @@ build_list_request, build_update_tags_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ class SnapshotsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`snapshots` attribute. """ @@ -58,10 +57,10 @@ class SnapshotsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -72,13 +71,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: :return: An iterator like instance of either Snapshot or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.Snapshot] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -152,13 +151,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy :type resource_group_name: str :return: An iterator like instance of either Snapshot or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.Snapshot] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -234,7 +233,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -248,7 +247,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) _request = build_get_request( @@ -299,12 +298,12 @@ async def create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -333,7 +332,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -356,9 +355,9 @@ async def create_or_update( :type resource_name: str :param parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -372,7 +371,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -435,12 +434,12 @@ async def update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -469,7 +468,7 @@ async def update_tags( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -492,9 +491,9 @@ async def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -508,7 +507,7 @@ async def update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -577,7 +576,7 @@ async def delete(self, resource_group_name: str, resource_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_trusted_access_role_bindings_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_trusted_access_role_bindings_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_trusted_access_role_bindings_operations.py index 5b8b79bc4a75..3adc9e9d0fb6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_trusted_access_role_bindings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, 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, @@ -31,17 +33,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._trusted_access_role_bindings_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +52,7 @@ class TrustedAccessRoleBindingsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`trusted_access_role_bindings` attribute. """ @@ -60,17 +60,16 @@ class TrustedAccessRoleBindingsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.TrustedAccessRoleBinding"]: - # pylint: disable=line-too-long """List trusted access role bindings. List trusted access role bindings. @@ -83,13 +82,13 @@ def list( :return: An iterator like instance of either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -170,7 +169,7 @@ async def get( :param trusted_access_role_binding_name: The name of trusted access role binding. Required. :type trusted_access_role_binding_name: str :return: TrustedAccessRoleBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -184,7 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) _request = build_get_request( @@ -235,7 +234,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -309,14 +308,14 @@ async def begin_create_or_update( :type trusted_access_role_binding_name: str :param trusted_access_role_binding: A trusted access role binding. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding + ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -350,7 +349,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -377,17 +376,17 @@ async def begin_create_or_update( :param trusted_access_role_binding: A trusted access role binding. Is either a TrustedAccessRoleBinding type or a IO[bytes] type. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding or IO[bytes] + ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding or IO[bytes] :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -446,7 +445,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -510,7 +509,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_trusted_access_roles_operations.py similarity index 86% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_trusted_access_roles_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_trusted_access_roles_operations.py index 4b78f8a75848..20b4207d09a9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/aio/operations/_trusted_access_roles_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._trusted_access_roles_operations import build_list_request +from .._configuration import ContainerServiceClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ class TrustedAccessRolesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.aio.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.aio.ContainerServiceClient`'s :attr:`trusted_access_roles` attribute. """ @@ -49,10 +48,10 @@ class TrustedAccessRolesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -65,13 +64,13 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc :type location: str :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRole] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRole] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/__init__.py similarity index 99% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/__init__.py index 16027289986f..71f7257d63f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/__init__.py @@ -220,6 +220,7 @@ SnapshotType, TrustedAccessRoleBindingProvisioningState, Type, + UndrainableNodeBehavior, UpgradeChannel, WeekDay, WorkloadRuntime, @@ -432,6 +433,7 @@ "SnapshotType", "TrustedAccessRoleBindingProvisioningState", "Type", + "UndrainableNodeBehavior", "UpgradeChannel", "WeekDay", "WorkloadRuntime", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_container_service_client_enums.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_container_service_client_enums.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_container_service_client_enums.py index e0876b8f626b..cde0db95dd29 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_container_service_client_enums.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -398,6 +399,10 @@ class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): WINDOWS2022 = "Windows2022" """Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports Windows2022 containers; it cannot run Windows2019 containers and vice versa.""" + UBUNTU2204 = "Ubuntu2204" + """Use Ubuntu2204 as the OS for node images, however, Ubuntu 22.04 may not be supported for all + nodepools. For limitations and supported kubernetes versions, see see + https://aka.ms/aks/supported-ubuntu-versions""" class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -565,6 +570,27 @@ class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Last week of the month.""" +class UndrainableNodeBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable + nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period + is exceeding the remaining per-node drain timeout or pod is still being in a running state, can + also cause undrainable nodes. + """ + + CORDON = "Cordon" + """AKS will cordon the blocked nodes and replace them with surge nodes during upgrade. The blocked + nodes will be cordoned and replaced by surge nodes. The blocked nodes will have label + 'kubernetes.azure.com/upgrade-status:Quarantined'. A surge node will be retained for each + blocked node. A best-effort attempt will be made to delete all other surge nodes. If there are + enough surge nodes to replace blocked nodes, then the upgrade operation and the managed cluster + will be in failed state. Otherwise, the upgrade operation and the managed cluster will be in + canceled state.""" + SCHEDULE = "Schedule" + """AKS will mark the blocked nodes schedulable, but the blocked nodes are not upgraded. A + best-effort attempt will be made to delete all surge nodes. The upgrade operation and the + managed cluster will be in failed state if there are any blocked nodes.""" + + class UpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """For more information see `setting the AKS cluster auto-upgrade channel `_. diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_models_py3.py similarity index 91% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_models_py3.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_models_py3.py index a69a625663ff..1f638fc3d76f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_models_py3.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -10,7 +10,7 @@ import datetime from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -62,9 +62,9 @@ class AdvancedNetworking(_serialization.Model): :ivar observability: Observability profile to enable advanced network metrics and flow logs with historical contexts. :vartype observability: - ~azure.mgmt.containerservice.v2025_02_01.models.AdvancedNetworkingObservability + ~azure.mgmt.containerservice.v2025_03_01.models.AdvancedNetworkingObservability :ivar security: Security profile to enable security features on cilium based cluster. - :vartype security: ~azure.mgmt.containerservice.v2025_02_01.models.AdvancedNetworkingSecurity + :vartype security: ~azure.mgmt.containerservice.v2025_03_01.models.AdvancedNetworkingSecurity """ _attribute_map = { @@ -90,9 +90,9 @@ def __init__( :keyword observability: Observability profile to enable advanced network metrics and flow logs with historical contexts. :paramtype observability: - ~azure.mgmt.containerservice.v2025_02_01.models.AdvancedNetworkingObservability + ~azure.mgmt.containerservice.v2025_03_01.models.AdvancedNetworkingObservability :keyword security: Security profile to enable security features on cilium based cluster. - :paramtype security: ~azure.mgmt.containerservice.v2025_02_01.models.AdvancedNetworkingSecurity + :paramtype security: ~azure.mgmt.containerservice.v2025_03_01.models.AdvancedNetworkingSecurity """ super().__init__(**kwargs) self.enabled = enabled @@ -174,9 +174,9 @@ class SubResource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None class AgentPool(SubResource): @@ -213,15 +213,15 @@ class AgentPool(SubResource): after creation. For more information see `Ephemeral OS `_. Known values are: "Managed" and "Ephemeral". - :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSDiskType + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSDiskType :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :vartype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_03_01.models.KubeletDiskType :ivar workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer" and "WasmWasi". :vartype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_02_01.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_03_01.models.WorkloadRuntime :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -230,22 +230,22 @@ class AgentPool(SubResource): :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype vnet_subnet_id: str :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype pod_subnet_id: str :ivar max_pods: The maximum number of pods that can run on a node. :vartype max_pods: int :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :ivar max_count: The maximum number of nodes for auto-scaling. :vartype max_count: int :ivar min_count: The minimum number of nodes for auto-scaling. @@ -254,15 +254,15 @@ class AgentPool(SubResource): :vartype enable_auto_scaling: bool :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". - :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.ScaleDownMode + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.ScaleDownMode :ivar type_properties_type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and "AvailabilitySet". :vartype type_properties_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolType + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolType :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System" and "User". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolMode :ivar orchestrator_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -282,14 +282,14 @@ class AgentPool(SubResource): :vartype node_image_version: str :ivar upgrade_settings: Settings for upgrading the agentpool. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :vartype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :vartype availability_zones: list[str] @@ -301,16 +301,16 @@ class AgentPool(SubResource): The default is false. :vartype enable_node_public_ip: bool :ivar node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :vartype node_public_ip_prefix_id: str :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :vartype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetPriority :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :vartype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetEvictionPolicy :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -325,9 +325,9 @@ class AgentPool(SubResource): :ivar proximity_placement_group_id: The ID for Proximity Placement Group. :vartype proximity_placement_group_id: str :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_02_01.models.KubeletConfig + :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_03_01.models.KubeletConfig :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_02_01.models.LinuxOSConfig + :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_03_01.models.LinuxOSConfig :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -341,29 +341,29 @@ class AgentPool(SubResource): :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :vartype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_02_01.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_03_01.models.GPUInstanceProfile :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :vartype capacity_reservation_group_id: str :ivar host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :vartype host_group_id: str :ivar network_profile: Network-related settings of an agent pool. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolNetworkProfile :ivar windows_profile: The Windows agent pool's specific profile. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolWindowsProfile :ivar security_profile: The security settings of an agent pool. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolSecurityProfile :ivar gpu_profile: GPU settings for the Agent Pool. - :vartype gpu_profile: ~azure.mgmt.containerservice.v2025_02_01.models.GPUProfile + :vartype gpu_profile: ~azure.mgmt.containerservice.v2025_03_01.models.GPUProfile """ _validation = { @@ -498,15 +498,15 @@ def __init__( # pylint: disable=too-many-locals after creation. For more information see `Ephemeral OS `_. Known values are: "Managed" and "Ephemeral". - :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSDiskType + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSDiskType :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :paramtype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_03_01.models.KubeletDiskType :keyword workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer" and "WasmWasi". :paramtype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_02_01.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_03_01.models.WorkloadRuntime :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -515,22 +515,22 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype vnet_subnet_id: str :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype pod_subnet_id: str :keyword max_pods: The maximum number of pods that can run on a node. :paramtype max_pods: int :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :keyword os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :keyword max_count: The maximum number of nodes for auto-scaling. :paramtype max_count: int :keyword min_count: The minimum number of nodes for auto-scaling. @@ -540,15 +540,15 @@ def __init__( # pylint: disable=too-many-locals :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :paramtype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleDownMode :keyword type_properties_type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and "AvailabilitySet". :paramtype type_properties_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolType + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolType :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System" and "User". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolMode :keyword orchestrator_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -562,12 +562,12 @@ def __init__( # pylint: disable=too-many-locals :paramtype orchestrator_version: str :keyword upgrade_settings: Settings for upgrading the agentpool. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeSettings :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :paramtype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :paramtype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :keyword availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :paramtype availability_zones: list[str] @@ -575,20 +575,20 @@ def __init__( # pylint: disable=too-many-locals their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node - `_. # pylint: disable=line-too-long + `_. The default is false. :paramtype enable_node_public_ip: bool :keyword node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :paramtype node_public_ip_prefix_id: str :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :paramtype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetPriority :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :paramtype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetEvictionPolicy :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -603,9 +603,9 @@ def __init__( # pylint: disable=too-many-locals :keyword proximity_placement_group_id: The ID for Proximity Placement Group. :paramtype proximity_placement_group_id: str :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. - :paramtype kubelet_config: ~azure.mgmt.containerservice.v2025_02_01.models.KubeletConfig + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2025_03_01.models.KubeletConfig :keyword linux_os_config: The OS configuration of Linux agent nodes. - :paramtype linux_os_config: ~azure.mgmt.containerservice.v2025_02_01.models.LinuxOSConfig + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2025_03_01.models.LinuxOSConfig :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -620,32 +620,32 @@ def __init__( # pylint: disable=too-many-locals profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :paramtype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_02_01.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_03_01.models.GPUInstanceProfile :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :paramtype capacity_reservation_group_id: str :keyword host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :paramtype host_group_id: str :keyword network_profile: Network-related settings of an agent pool. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolNetworkProfile :keyword windows_profile: The Windows agent pool's specific profile. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolWindowsProfile :keyword security_profile: The security settings of an agent pool. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolSecurityProfile :keyword gpu_profile: GPU settings for the Agent Pool. - :paramtype gpu_profile: ~azure.mgmt.containerservice.v2025_02_01.models.GPUProfile + :paramtype gpu_profile: ~azure.mgmt.containerservice.v2025_03_01.models.GPUProfile """ super().__init__(**kwargs) - self.e_tag = None + self.e_tag: Optional[str] = None self.count = count self.vm_size = vm_size self.os_disk_size_gb = os_disk_size_gb @@ -665,10 +665,10 @@ def __init__( # pylint: disable=too-many-locals self.type_properties_type = type_properties_type self.mode = mode self.orchestrator_version = orchestrator_version - self.current_orchestrator_version = None - self.node_image_version = None + self.current_orchestrator_version: Optional[str] = None + self.node_image_version: Optional[str] = None self.upgrade_settings = upgrade_settings - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.power_state = power_state self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip @@ -708,7 +708,7 @@ class AgentPoolAvailableVersions(_serialization.Model): :vartype type: str :ivar agent_pool_versions: List of versions available for agent pool. :vartype agent_pool_versions: - list[~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + list[~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ _validation = { @@ -736,12 +736,12 @@ def __init__( """ :keyword agent_pool_versions: List of versions available for agent pool. :paramtype agent_pool_versions: - list[~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + list[~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.agent_pool_versions = agent_pool_versions @@ -816,7 +816,7 @@ class AgentPoolListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of agent pools. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -833,21 +833,21 @@ class AgentPoolListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.AgentPool"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of agent pools. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AgentPoolNetworkProfile(_serialization.Model): """Network settings of an agent pool. :ivar node_public_ip_tags: IPTags of instance-level public IPs. - :vartype node_public_ip_tags: list[~azure.mgmt.containerservice.v2025_02_01.models.IPTag] + :vartype node_public_ip_tags: list[~azure.mgmt.containerservice.v2025_03_01.models.IPTag] :ivar allowed_host_ports: The port ranges that are allowed to access. The specified ranges are allowed to overlap. - :vartype allowed_host_ports: list[~azure.mgmt.containerservice.v2025_02_01.models.PortRange] + :vartype allowed_host_ports: list[~azure.mgmt.containerservice.v2025_03_01.models.PortRange] :ivar application_security_groups: The IDs of the application security groups which agent pool will associate when created. :vartype application_security_groups: list[str] @@ -869,10 +869,10 @@ def __init__( ) -> None: """ :keyword node_public_ip_tags: IPTags of instance-level public IPs. - :paramtype node_public_ip_tags: list[~azure.mgmt.containerservice.v2025_02_01.models.IPTag] + :paramtype node_public_ip_tags: list[~azure.mgmt.containerservice.v2025_03_01.models.IPTag] :keyword allowed_host_ports: The port ranges that are allowed to access. The specified ranges are allowed to overlap. - :paramtype allowed_host_ports: list[~azure.mgmt.containerservice.v2025_02_01.models.PortRange] + :paramtype allowed_host_ports: list[~azure.mgmt.containerservice.v2025_03_01.models.PortRange] :keyword application_security_groups: The IDs of the application security groups which agent pool will associate when created. :paramtype application_security_groups: list[str] @@ -936,10 +936,10 @@ class AgentPoolUpgradeProfile(_serialization.Model): :vartype kubernetes_version: str :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :ivar upgrades: List of orchestrator types and versions available for upgrade. :vartype upgrades: - list[~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + list[~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] :ivar latest_node_image_version: The latest AKS supported node image version. :vartype latest_node_image_version: str """ @@ -976,17 +976,17 @@ def __init__( :paramtype kubernetes_version: str :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :keyword upgrades: List of orchestrator types and versions available for upgrade. :paramtype upgrades: - list[~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + list[~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] :keyword latest_node_image_version: The latest AKS supported node image version. :paramtype latest_node_image_version: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.kubernetes_version = kubernetes_version self.os_type = os_type self.upgrades = upgrades @@ -1028,8 +1028,14 @@ class AgentPoolUpgradeSettings(_serialization.Model): If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. :vartype max_surge: str + :ivar max_unavailable: This can either be set to an integer (e.g. '1') or a percentage (e.g. + '5%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 0. For more information, including best practices, see: + https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + :vartype max_unavailable: str :ivar drain_timeout_in_minutes: The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 @@ -1039,6 +1045,13 @@ class AgentPoolUpgradeSettings(_serialization.Model): node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. :vartype node_soak_duration_in_minutes: int + :ivar undrainable_node_behavior: Defines the behavior for undrainable nodes during upgrade. The + most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such + as pod termination grace period is exceeding the remaining per-node drain timeout or pod is + still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" + and "Schedule". + :vartype undrainable_node_behavior: str or + ~azure.mgmt.containerservice.v2025_03_01.models.UndrainableNodeBehavior """ _validation = { @@ -1048,16 +1061,20 @@ class AgentPoolUpgradeSettings(_serialization.Model): _attribute_map = { "max_surge": {"key": "maxSurge", "type": "str"}, + "max_unavailable": {"key": "maxUnavailable", "type": "str"}, "drain_timeout_in_minutes": {"key": "drainTimeoutInMinutes", "type": "int"}, "node_soak_duration_in_minutes": {"key": "nodeSoakDurationInMinutes", "type": "int"}, + "undrainable_node_behavior": {"key": "undrainableNodeBehavior", "type": "str"}, } def __init__( self, *, max_surge: Optional[str] = None, + max_unavailable: Optional[str] = None, drain_timeout_in_minutes: Optional[int] = None, node_soak_duration_in_minutes: Optional[int] = None, + undrainable_node_behavior: Optional[Union[str, "_models.UndrainableNodeBehavior"]] = None, **kwargs: Any ) -> None: """ @@ -1065,8 +1082,14 @@ def __init__( '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. :paramtype max_surge: str + :keyword max_unavailable: This can either be set to an integer (e.g. '1') or a percentage (e.g. + '5%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 0. For more information, including best practices, see: + https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + :paramtype max_unavailable: str :keyword drain_timeout_in_minutes: The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 @@ -1076,11 +1099,20 @@ def __init__( a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. :paramtype node_soak_duration_in_minutes: int + :keyword undrainable_node_behavior: Defines the behavior for undrainable nodes during upgrade. + The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, + such as pod termination grace period is exceeding the remaining per-node drain timeout or pod + is still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" + and "Schedule". + :paramtype undrainable_node_behavior: str or + ~azure.mgmt.containerservice.v2025_03_01.models.UndrainableNodeBehavior """ super().__init__(**kwargs) self.max_surge = max_surge + self.max_unavailable = max_unavailable self.drain_timeout_in_minutes = drain_timeout_in_minutes self.node_soak_duration_in_minutes = node_soak_duration_in_minutes + self.undrainable_node_behavior = undrainable_node_behavior class AgentPoolWindowsProfile(_serialization.Model): @@ -1113,7 +1145,7 @@ class AzureKeyVaultKms(_serialization.Model): :ivar enabled: Whether to enable Azure Key Vault key management service. The default is false. :vartype enabled: bool :ivar key_id: Identifier of Azure Key Vault key. See `key identifier format - `_ # pylint: disable=line-too-long + `_ for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. @@ -1123,7 +1155,7 @@ class AzureKeyVaultKms(_serialization.Model): ``Private`` means the key vault disables public access and enables private link. The default value is ``Public``. Known values are: "Public" and "Private". :vartype key_vault_network_access: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KeyVaultNetworkAccessTypes + ~azure.mgmt.containerservice.v2025_03_01.models.KeyVaultNetworkAccessTypes :ivar key_vault_resource_id: Resource ID of key vault. When keyVaultNetworkAccess is ``Private``\\ , this field is required and must be a valid resource ID. When keyVaultNetworkAccess is ``Public``\\ , leave the field empty. @@ -1151,7 +1183,7 @@ def __init__( false. :paramtype enabled: bool :keyword key_id: Identifier of Azure Key Vault key. See `key identifier format - `_ # pylint: disable=line-too-long + `_ for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. @@ -1161,7 +1193,7 @@ def __init__( networks. ``Private`` means the key vault disables public access and enables private link. The default value is ``Public``. Known values are: "Public" and "Private". :paramtype key_vault_network_access: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KeyVaultNetworkAccessTypes + ~azure.mgmt.containerservice.v2025_03_01.models.KeyVaultNetworkAccessTypes :keyword key_vault_resource_id: Resource ID of key vault. When keyVaultNetworkAccess is ``Private``\\ , this field is required and must be a valid resource ID. When keyVaultNetworkAccess is ``Public``\\ , leave the field empty. @@ -1187,7 +1219,7 @@ class CloudErrorBody(_serialization.Model): error. :vartype target: str :ivar details: A list of additional details about the error. - :vartype details: list[~azure.mgmt.containerservice.v2025_02_01.models.CloudErrorBody] + :vartype details: list[~azure.mgmt.containerservice.v2025_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -1217,7 +1249,7 @@ def __init__( error. :paramtype target: str :keyword details: A list of additional details about the error. - :paramtype details: list[~azure.mgmt.containerservice.v2025_02_01.models.CloudErrorBody] + :paramtype details: list[~azure.mgmt.containerservice.v2025_03_01.models.CloudErrorBody] """ super().__init__(**kwargs) self.code = code @@ -1231,7 +1263,7 @@ class ClusterUpgradeSettings(_serialization.Model): :ivar override_settings: Settings for overrides. :vartype override_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.UpgradeOverrideSettings + ~azure.mgmt.containerservice.v2025_03_01.models.UpgradeOverrideSettings """ _attribute_map = { @@ -1242,7 +1274,7 @@ def __init__(self, *, override_settings: Optional["_models.UpgradeOverrideSettin """ :keyword override_settings: Settings for overrides. :paramtype override_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.UpgradeOverrideSettings + ~azure.mgmt.containerservice.v2025_03_01.models.UpgradeOverrideSettings """ super().__init__(**kwargs) self.override_settings = override_settings @@ -1282,7 +1314,7 @@ class ContainerServiceLinuxProfile(_serialization.Model): :ivar admin_username: The administrator username to use for Linux VMs. Required. :vartype admin_username: str :ivar ssh: The SSH configuration for Linux-based VMs running on Azure. Required. - :vartype ssh: ~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceSshConfiguration + :vartype ssh: ~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -1301,7 +1333,7 @@ def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConf :paramtype admin_username: str :keyword ssh: The SSH configuration for Linux-based VMs running on Azure. Required. :paramtype ssh: - ~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceSshConfiguration + ~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceSshConfiguration """ super().__init__(**kwargs) self.admin_username = admin_username @@ -1313,24 +1345,24 @@ class ContainerServiceNetworkProfile(_serialization.Model): :ivar network_plugin: Network plugin used for building the Kubernetes network. Known values are: "azure", "kubenet", and "none". - :vartype network_plugin: str or ~azure.mgmt.containerservice.v2025_02_01.models.NetworkPlugin + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2025_03_01.models.NetworkPlugin :ivar network_plugin_mode: The mode the network plugin should use. "overlay" :vartype network_plugin_mode: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NetworkPluginMode + ~azure.mgmt.containerservice.v2025_03_01.models.NetworkPluginMode :ivar network_policy: Network policy used for building the Kubernetes network. Known values are: "none", "calico", "azure", and "cilium". - :vartype network_policy: str or ~azure.mgmt.containerservice.v2025_02_01.models.NetworkPolicy + :vartype network_policy: str or ~azure.mgmt.containerservice.v2025_03_01.models.NetworkPolicy :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Known values are: "transparent" and "bridge". - :vartype network_mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.NetworkMode + :vartype network_mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.NetworkMode :ivar network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: "azure" and "cilium". :vartype network_dataplane: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NetworkDataplane + ~azure.mgmt.containerservice.v2025_03_01.models.NetworkDataplane :ivar advanced_networking: Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. :vartype advanced_networking: - ~azure.mgmt.containerservice.v2025_02_01.models.AdvancedNetworking + ~azure.mgmt.containerservice.v2025_03_01.models.AdvancedNetworking :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. :vartype pod_cidr: str :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must @@ -1343,18 +1375,18 @@ class ContainerServiceNetworkProfile(_serialization.Model): For more information see `egress outbound type `_. Known values are: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". - :vartype outbound_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OutboundType + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OutboundType :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Known values are: "standard" and "basic". :vartype load_balancer_sku: str or - ~azure.mgmt.containerservice.v2025_02_01.models.LoadBalancerSku + ~azure.mgmt.containerservice.v2025_03_01.models.LoadBalancerSku :ivar load_balancer_profile: Profile of the cluster load balancer. :vartype load_balancer_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfile :ivar nat_gateway_profile: Profile of the cluster NAT gateway. :vartype nat_gateway_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterNATGatewayProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterNATGatewayProfile :ivar pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. :vartype pod_cidrs: list[str] @@ -1365,7 +1397,7 @@ class ContainerServiceNetworkProfile(_serialization.Model): :ivar ip_families: IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - :vartype ip_families: list[str or ~azure.mgmt.containerservice.v2025_02_01.models.IpFamily] + :vartype ip_families: list[str or ~azure.mgmt.containerservice.v2025_03_01.models.IpFamily] """ _validation = { @@ -1419,24 +1451,24 @@ def __init__( """ :keyword network_plugin: Network plugin used for building the Kubernetes network. Known values are: "azure", "kubenet", and "none". - :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2025_02_01.models.NetworkPlugin + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2025_03_01.models.NetworkPlugin :keyword network_plugin_mode: The mode the network plugin should use. "overlay" :paramtype network_plugin_mode: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NetworkPluginMode + ~azure.mgmt.containerservice.v2025_03_01.models.NetworkPluginMode :keyword network_policy: Network policy used for building the Kubernetes network. Known values are: "none", "calico", "azure", and "cilium". - :paramtype network_policy: str or ~azure.mgmt.containerservice.v2025_02_01.models.NetworkPolicy + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2025_03_01.models.NetworkPolicy :keyword network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Known values are: "transparent" and "bridge". - :paramtype network_mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.NetworkMode + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.NetworkMode :keyword network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: "azure" and "cilium". :paramtype network_dataplane: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NetworkDataplane + ~azure.mgmt.containerservice.v2025_03_01.models.NetworkDataplane :keyword advanced_networking: Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. :paramtype advanced_networking: - ~azure.mgmt.containerservice.v2025_02_01.models.AdvancedNetworking + ~azure.mgmt.containerservice.v2025_03_01.models.AdvancedNetworking :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. :paramtype pod_cidr: str :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It @@ -1449,18 +1481,18 @@ def __init__( later. For more information see `egress outbound type `_. Known values are: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". - :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OutboundType + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OutboundType :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Known values are: "standard" and "basic". :paramtype load_balancer_sku: str or - ~azure.mgmt.containerservice.v2025_02_01.models.LoadBalancerSku + ~azure.mgmt.containerservice.v2025_03_01.models.LoadBalancerSku :keyword load_balancer_profile: Profile of the cluster load balancer. :paramtype load_balancer_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfile :keyword nat_gateway_profile: Profile of the cluster NAT gateway. :paramtype nat_gateway_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterNATGatewayProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterNATGatewayProfile :keyword pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. :paramtype pod_cidrs: list[str] @@ -1471,7 +1503,7 @@ def __init__( :keyword ip_families: IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - :paramtype ip_families: list[str or ~azure.mgmt.containerservice.v2025_02_01.models.IpFamily] + :paramtype ip_families: list[str or ~azure.mgmt.containerservice.v2025_03_01.models.IpFamily] """ super().__init__(**kwargs) self.network_plugin = network_plugin @@ -1500,7 +1532,7 @@ class ContainerServiceSshConfiguration(_serialization.Model): :ivar public_keys: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. Required. :vartype public_keys: - list[~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceSshPublicKey] + list[~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceSshPublicKey] """ _validation = { @@ -1516,7 +1548,7 @@ def __init__(self, *, public_keys: List["_models.ContainerServiceSshPublicKey"], :keyword public_keys: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. Required. :paramtype public_keys: - list[~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceSshPublicKey] + list[~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceSshPublicKey] """ super().__init__(**kwargs) self.public_keys = public_keys @@ -1596,8 +1628,8 @@ class CredentialResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[bytes] = None class CredentialResults(_serialization.Model): @@ -1606,7 +1638,7 @@ class CredentialResults(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2025_02_01.models.CredentialResult] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2025_03_01.models.CredentialResult] """ _validation = { @@ -1620,7 +1652,7 @@ class CredentialResults(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.kubeconfigs = None + self.kubeconfigs: Optional[List["_models.CredentialResult"]] = None class DailySchedule(_serialization.Model): @@ -1736,7 +1768,7 @@ class EndpointDependency(_serialization.Model): :ivar domain_name: The domain name of the dependency. :vartype domain_name: str :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. - :vartype endpoint_details: list[~azure.mgmt.containerservice.v2025_02_01.models.EndpointDetail] + :vartype endpoint_details: list[~azure.mgmt.containerservice.v2025_03_01.models.EndpointDetail] """ _attribute_map = { @@ -1756,7 +1788,7 @@ def __init__( :paramtype domain_name: str :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. :paramtype endpoint_details: - list[~azure.mgmt.containerservice.v2025_02_01.models.EndpointDetail] + list[~azure.mgmt.containerservice.v2025_03_01.models.EndpointDetail] """ super().__init__(**kwargs) self.domain_name = domain_name @@ -1833,8 +1865,8 @@ class ErrorAdditionalInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.info = None + self.type: Optional[str] = None + self.info: Optional[JSON] = None class ErrorDetail(_serialization.Model): @@ -1849,10 +1881,10 @@ class ErrorDetail(_serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.containerservice.v2025_02_01.models.ErrorDetail] + :vartype details: list[~azure.mgmt.containerservice.v2025_03_01.models.ErrorDetail] :ivar additional_info: The error additional info. :vartype additional_info: - list[~azure.mgmt.containerservice.v2025_02_01.models.ErrorAdditionalInfo] + list[~azure.mgmt.containerservice.v2025_03_01.models.ErrorAdditionalInfo] """ _validation = { @@ -1874,11 +1906,11 @@ class ErrorDetail(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None + self.details: Optional[List["_models.ErrorDetail"]] = None + self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None class ErrorResponse(_serialization.Model): @@ -1886,7 +1918,7 @@ class ErrorResponse(_serialization.Model): operations. (This also follows the OData error response format.). :ivar error: The error object. - :vartype error: ~azure.mgmt.containerservice.v2025_02_01.models.ErrorDetail + :vartype error: ~azure.mgmt.containerservice.v2025_03_01.models.ErrorDetail """ _attribute_map = { @@ -1896,7 +1928,7 @@ class ErrorResponse(_serialization.Model): def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. - :paramtype error: ~azure.mgmt.containerservice.v2025_02_01.models.ErrorDetail + :paramtype error: ~azure.mgmt.containerservice.v2025_03_01.models.ErrorDetail """ super().__init__(**kwargs) self.error = error @@ -1908,7 +1940,7 @@ class ExtendedLocation(_serialization.Model): :ivar name: The name of the extended location. :vartype name: str :ivar type: The type of the extended location. "EdgeZone" - :vartype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.ExtendedLocationTypes + :vartype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1927,7 +1959,7 @@ def __init__( :keyword name: The name of the extended location. :paramtype name: str :keyword type: The type of the extended location. "EdgeZone" - :paramtype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.ExtendedLocationTypes + :paramtype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.ExtendedLocationTypes """ super().__init__(**kwargs) self.name = name @@ -1939,7 +1971,7 @@ class GPUProfile(_serialization.Model): :ivar driver: Whether to install GPU drivers. When it's not specified, default is Install. Known values are: "Install" and "None". - :vartype driver: str or ~azure.mgmt.containerservice.v2025_02_01.models.GPUDriver + :vartype driver: str or ~azure.mgmt.containerservice.v2025_03_01.models.GPUDriver """ _attribute_map = { @@ -1950,7 +1982,7 @@ def __init__(self, *, driver: Optional[Union[str, "_models.GPUDriver"]] = None, """ :keyword driver: Whether to install GPU drivers. When it's not specified, default is Install. Known values are: "Install" and "None". - :paramtype driver: str or ~azure.mgmt.containerservice.v2025_02_01.models.GPUDriver + :paramtype driver: str or ~azure.mgmt.containerservice.v2025_03_01.models.GPUDriver """ super().__init__(**kwargs) self.driver = driver @@ -1988,7 +2020,7 @@ class IstioCertificateAuthority(_serialization.Model): :ivar plugin: Plugin certificates information for Service Mesh. :vartype plugin: - ~azure.mgmt.containerservice.v2025_02_01.models.IstioPluginCertificateAuthority + ~azure.mgmt.containerservice.v2025_03_01.models.IstioPluginCertificateAuthority """ _attribute_map = { @@ -1999,7 +2031,7 @@ def __init__(self, *, plugin: Optional["_models.IstioPluginCertificateAuthority" """ :keyword plugin: Plugin certificates information for Service Mesh. :paramtype plugin: - ~azure.mgmt.containerservice.v2025_02_01.models.IstioPluginCertificateAuthority + ~azure.mgmt.containerservice.v2025_03_01.models.IstioPluginCertificateAuthority """ super().__init__(**kwargs) self.plugin = plugin @@ -2010,10 +2042,10 @@ class IstioComponents(_serialization.Model): :ivar ingress_gateways: Istio ingress gateways. :vartype ingress_gateways: - list[~azure.mgmt.containerservice.v2025_02_01.models.IstioIngressGateway] + list[~azure.mgmt.containerservice.v2025_03_01.models.IstioIngressGateway] :ivar egress_gateways: Istio egress gateways. :vartype egress_gateways: - list[~azure.mgmt.containerservice.v2025_02_01.models.IstioEgressGateway] + list[~azure.mgmt.containerservice.v2025_03_01.models.IstioEgressGateway] """ _attribute_map = { @@ -2031,10 +2063,10 @@ def __init__( """ :keyword ingress_gateways: Istio ingress gateways. :paramtype ingress_gateways: - list[~azure.mgmt.containerservice.v2025_02_01.models.IstioIngressGateway] + list[~azure.mgmt.containerservice.v2025_03_01.models.IstioIngressGateway] :keyword egress_gateways: Istio egress gateways. :paramtype egress_gateways: - list[~azure.mgmt.containerservice.v2025_02_01.models.IstioEgressGateway] + list[~azure.mgmt.containerservice.v2025_03_01.models.IstioEgressGateway] """ super().__init__(**kwargs) self.ingress_gateways = ingress_gateways @@ -2075,7 +2107,7 @@ class IstioIngressGateway(_serialization.Model): All required parameters must be populated in order to send to server. :ivar mode: Mode of an ingress gateway. Required. Known values are: "External" and "Internal". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.IstioIngressGatewayMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.IstioIngressGatewayMode :ivar enabled: Whether to enable the ingress gateway. Required. :vartype enabled: bool """ @@ -2094,7 +2126,7 @@ def __init__(self, *, mode: Union[str, "_models.IstioIngressGatewayMode"], enabl """ :keyword mode: Mode of an ingress gateway. Required. Known values are: "External" and "Internal". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.IstioIngressGatewayMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.IstioIngressGatewayMode :keyword enabled: Whether to enable the ingress gateway. Required. :paramtype enabled: bool """ @@ -2160,11 +2192,11 @@ class IstioServiceMesh(_serialization.Model): """Istio service mesh configuration. :ivar components: Istio components configuration. - :vartype components: ~azure.mgmt.containerservice.v2025_02_01.models.IstioComponents + :vartype components: ~azure.mgmt.containerservice.v2025_03_01.models.IstioComponents :ivar certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. :vartype certificate_authority: - ~azure.mgmt.containerservice.v2025_02_01.models.IstioCertificateAuthority + ~azure.mgmt.containerservice.v2025_03_01.models.IstioCertificateAuthority :ivar revisions: The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: @@ -2192,11 +2224,11 @@ def __init__( ) -> None: """ :keyword components: Istio components configuration. - :paramtype components: ~azure.mgmt.containerservice.v2025_02_01.models.IstioComponents + :paramtype components: ~azure.mgmt.containerservice.v2025_03_01.models.IstioComponents :keyword certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. :paramtype certificate_authority: - ~azure.mgmt.containerservice.v2025_02_01.models.IstioCertificateAuthority + ~azure.mgmt.containerservice.v2025_03_01.models.IstioCertificateAuthority :keyword revisions: The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: @@ -2360,14 +2392,14 @@ class KubernetesVersion(_serialization.Model): :vartype version: str :ivar capabilities: Capabilities on this Kubernetes version. :vartype capabilities: - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesVersionCapabilities + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesVersionCapabilities :ivar is_default: Whether this version is default. :vartype is_default: bool :ivar is_preview: Whether this version is in preview mode. :vartype is_preview: bool :ivar patch_versions: Patch versions of Kubernetes release. :vartype patch_versions: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesPatchVersion] + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesPatchVersion] """ _attribute_map = { @@ -2393,14 +2425,14 @@ def __init__( :paramtype version: str :keyword capabilities: Capabilities on this Kubernetes version. :paramtype capabilities: - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesVersionCapabilities + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesVersionCapabilities :keyword is_default: Whether this version is default. :paramtype is_default: bool :keyword is_preview: Whether this version is in preview mode. :paramtype is_preview: bool :keyword patch_versions: Patch versions of Kubernetes release. :paramtype patch_versions: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesPatchVersion] + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesPatchVersion] """ super().__init__(**kwargs) self.version = version @@ -2415,7 +2447,7 @@ class KubernetesVersionCapabilities(_serialization.Model): :ivar support_plan: :vartype support_plan: list[str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesSupportPlan] + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesSupportPlan] """ _attribute_map = { @@ -2428,7 +2460,7 @@ def __init__( """ :keyword support_plan: :paramtype support_plan: list[str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesSupportPlan] + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesSupportPlan] """ super().__init__(**kwargs) self.support_plan = support_plan @@ -2438,7 +2470,7 @@ class KubernetesVersionListResult(_serialization.Model): """Hold values properties, which is array of KubernetesVersion. :ivar values: Array of AKS supported Kubernetes versions. - :vartype values: list[~azure.mgmt.containerservice.v2025_02_01.models.KubernetesVersion] + :vartype values: list[~azure.mgmt.containerservice.v2025_03_01.models.KubernetesVersion] """ _attribute_map = { @@ -2448,7 +2480,7 @@ class KubernetesVersionListResult(_serialization.Model): def __init__(self, *, values: Optional[List["_models.KubernetesVersion"]] = None, **kwargs: Any) -> None: """ :keyword values: Array of AKS supported Kubernetes versions. - :paramtype values: list[~azure.mgmt.containerservice.v2025_02_01.models.KubernetesVersion] + :paramtype values: list[~azure.mgmt.containerservice.v2025_03_01.models.KubernetesVersion] """ super().__init__(**kwargs) self.values = values @@ -2459,7 +2491,7 @@ class LinuxOSConfig(_serialization.Model): `_ for more details. :ivar sysctls: Sysctl settings for Linux agent nodes. - :vartype sysctls: ~azure.mgmt.containerservice.v2025_02_01.models.SysctlConfig + :vartype sysctls: ~azure.mgmt.containerservice.v2025_03_01.models.SysctlConfig :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. @@ -2491,7 +2523,7 @@ def __init__( ) -> None: """ :keyword sysctls: Sysctl settings for Linux agent nodes. - :paramtype sysctls: ~azure.mgmt.containerservice.v2025_02_01.models.SysctlConfig + :paramtype sysctls: ~azure.mgmt.containerservice.v2025_03_01.models.SysctlConfig :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. @@ -2526,7 +2558,7 @@ class Machine(SubResource): :ivar type: Resource type. :vartype type: str :ivar properties: The properties of the machine. - :vartype properties: ~azure.mgmt.containerservice.v2025_02_01.models.MachineProperties + :vartype properties: ~azure.mgmt.containerservice.v2025_03_01.models.MachineProperties """ _validation = { @@ -2546,7 +2578,7 @@ class Machine(SubResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.properties = None + self.properties: Optional["_models.MachineProperties"] = None class MachineIpAddress(_serialization.Model): @@ -2556,7 +2588,7 @@ class MachineIpAddress(_serialization.Model): :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and "IPv6". - :vartype family: str or ~azure.mgmt.containerservice.v2025_02_01.models.IpFamily + :vartype family: str or ~azure.mgmt.containerservice.v2025_03_01.models.IpFamily :ivar ip: IPv4 or IPv6 address of the machine. :vartype ip: str """ @@ -2574,8 +2606,8 @@ class MachineIpAddress(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.family = None - self.ip = None + self.family: Optional[Union[str, "_models.IpFamily"]] = None + self.ip: Optional[str] = None class MachineListResult(_serialization.Model): @@ -2586,7 +2618,7 @@ class MachineListResult(_serialization.Model): :ivar next_link: The URL to get the next set of machine results. :vartype next_link: str :ivar value: The list of Machines in cluster. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.Machine] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.Machine] """ _validation = { @@ -2601,10 +2633,10 @@ class MachineListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.Machine"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of Machines in cluster. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.Machine] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.Machine] """ super().__init__(**kwargs) - self.next_link = None + self.next_link: Optional[str] = None self.value = value @@ -2614,7 +2646,7 @@ class MachineNetworkProperties(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar ip_addresses: IPv4, IPv6 addresses of the machine. - :vartype ip_addresses: list[~azure.mgmt.containerservice.v2025_02_01.models.MachineIpAddress] + :vartype ip_addresses: list[~azure.mgmt.containerservice.v2025_03_01.models.MachineIpAddress] """ _validation = { @@ -2628,7 +2660,7 @@ class MachineNetworkProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.ip_addresses = None + self.ip_addresses: Optional[List["_models.MachineIpAddress"]] = None class MachineProperties(_serialization.Model): @@ -2637,7 +2669,7 @@ class MachineProperties(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar network: network properties of the machine. - :vartype network: ~azure.mgmt.containerservice.v2025_02_01.models.MachineNetworkProperties + :vartype network: ~azure.mgmt.containerservice.v2025_03_01.models.MachineNetworkProperties :ivar resource_id: Azure resource id of the machine. It can be used to GET underlying VM Instance. :vartype resource_id: str @@ -2656,8 +2688,8 @@ class MachineProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.network = None - self.resource_id = None + self.network: Optional["_models.MachineNetworkProperties"] = None + self.resource_id: Optional[str] = None class MaintenanceConfiguration(SubResource): @@ -2674,14 +2706,14 @@ class MaintenanceConfiguration(SubResource): :ivar type: Resource type. :vartype type: str :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :vartype time_in_week: list[~azure.mgmt.containerservice.v2025_02_01.models.TimeInWeek] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2025_03_01.models.TimeInWeek] :ivar not_allowed_time: Time slots on which upgrade is not allowed. - :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2025_02_01.models.TimeSpan] + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2025_03_01.models.TimeSpan] :ivar maintenance_window: Maintenance window for the maintenance configuration. - :vartype maintenance_window: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceWindow + :vartype maintenance_window: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceWindow """ _validation = { @@ -2712,15 +2744,15 @@ def __init__( """ :keyword time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :paramtype time_in_week: list[~azure.mgmt.containerservice.v2025_02_01.models.TimeInWeek] + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2025_03_01.models.TimeInWeek] :keyword not_allowed_time: Time slots on which upgrade is not allowed. - :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2025_02_01.models.TimeSpan] + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2025_03_01.models.TimeSpan] :keyword maintenance_window: Maintenance window for the maintenance configuration. :paramtype maintenance_window: - ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceWindow + ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceWindow """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.time_in_week = time_in_week self.not_allowed_time = not_allowed_time self.maintenance_window = maintenance_window @@ -2732,7 +2764,7 @@ class MaintenanceConfigurationListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of maintenance configurations. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -2750,11 +2782,11 @@ def __init__(self, *, value: Optional[List["_models.MaintenanceConfiguration"]] """ :keyword value: The list of maintenance configurations. :paramtype value: - list[~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration] + list[~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MaintenanceWindow(_serialization.Model): @@ -2763,7 +2795,7 @@ class MaintenanceWindow(_serialization.Model): All required parameters must be populated in order to send to server. :ivar schedule: Recurrence schedule for the maintenance window. Required. - :vartype schedule: ~azure.mgmt.containerservice.v2025_02_01.models.Schedule + :vartype schedule: ~azure.mgmt.containerservice.v2025_03_01.models.Schedule :ivar duration_hours: Length of maintenance window range from 4 to 24 hours. :vartype duration_hours: int :ivar utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' @@ -2781,7 +2813,7 @@ class MaintenanceWindow(_serialization.Model): this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. - :vartype not_allowed_dates: list[~azure.mgmt.containerservice.v2025_02_01.models.DateSpan] + :vartype not_allowed_dates: list[~azure.mgmt.containerservice.v2025_03_01.models.DateSpan] """ _validation = { @@ -2813,7 +2845,7 @@ def __init__( ) -> None: """ :keyword schedule: Recurrence schedule for the maintenance window. Required. - :paramtype schedule: ~azure.mgmt.containerservice.v2025_02_01.models.Schedule + :paramtype schedule: ~azure.mgmt.containerservice.v2025_03_01.models.Schedule :keyword duration_hours: Length of maintenance window range from 4 to 24 hours. :paramtype duration_hours: int :keyword utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and @@ -2831,7 +2863,7 @@ def __init__( this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. - :paramtype not_allowed_dates: list[~azure.mgmt.containerservice.v2025_02_01.models.DateSpan] + :paramtype not_allowed_dates: list[~azure.mgmt.containerservice.v2025_03_01.models.DateSpan] """ super().__init__(**kwargs) self.schedule = schedule @@ -2848,7 +2880,7 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2857,7 +2889,7 @@ class Resource(_serialization.Model): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData """ _validation = { @@ -2877,10 +2909,10 @@ class Resource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None class TrackedResource(Resource): @@ -2892,7 +2924,7 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2901,7 +2933,7 @@ class TrackedResource(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -2945,7 +2977,7 @@ class ManagedCluster(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2954,7 +2986,7 @@ class ManagedCluster(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -2965,15 +2997,15 @@ class ManagedCluster(TrackedResource): convention. :vartype e_tag: str :ivar sku: The managed cluster SKU. - :vartype sku: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSKU + :vartype sku: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSKU :ivar extended_location: The extended location of the Virtual Machine. - :vartype extended_location: ~azure.mgmt.containerservice.v2025_02_01.models.ExtendedLocation + :vartype extended_location: ~azure.mgmt.containerservice.v2025_03_01.models.ExtendedLocation :ivar identity: The identity of the managed cluster, if configured. - :vartype identity: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIdentity + :vartype identity: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int :ivar kubernetes_version: Both patch version (e.g. 1.20.13) and @@ -3004,72 +3036,68 @@ class ManagedCluster(TrackedResource): :vartype azure_portal_fqdn: str :ivar agent_pool_profiles: The agent pool properties. :vartype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAgentPoolProfile] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAgentPoolProfile] :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. :vartype linux_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceLinuxProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceLinuxProfile :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWindowsProfile :ivar service_principal_profile: Information about a service principal identity for the cluster to use for manipulating Azure APIs. :vartype service_principal_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterServicePrincipalProfile :ivar addon_profiles: The profile of managed cluster add-on. :vartype addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAddonProfile] + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAddonProfile] :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. :vartype pod_identity_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProfile :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. :vartype oidc_issuer_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterOIDCIssuerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterOIDCIssuerProfile :ivar node_resource_group: The name of the resource group containing agent pool nodes. :vartype node_resource_group: str :ivar node_resource_group_profile: Profile of the node resource group configuration. :vartype node_resource_group_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterNodeResourceGroupProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterNodeResourceGroupProfile :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :vartype enable_rbac: bool :ivar support_plan: The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". :vartype support_plan: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesSupportPlan - :ivar enable_pod_security_policy: (DEPRECATED) Whether to enable Kubernetes pod security policy - (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in - v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - :vartype enable_pod_security_policy: bool + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesSupportPlan :ivar network_profile: The network configuration profile. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceNetworkProfile :ivar aad_profile: The Azure Active Directory configuration. - :vartype aad_profile: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAADProfile + :vartype aad_profile: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAADProfile :ivar auto_upgrade_profile: The auto upgrade configuration. :vartype auto_upgrade_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAutoUpgradeProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAutoUpgradeProfile :ivar upgrade_settings: Settings for upgrading a cluster. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.ClusterUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.ClusterUpgradeSettings :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. :vartype auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPropertiesAutoScalerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPropertiesAutoScalerProfile :ivar api_server_access_profile: The access profile for managed cluster API server. :vartype api_server_access_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAPIServerAccessProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAPIServerAccessProfile :ivar disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. :vartype disk_encryption_set_id: str :ivar identity_profile: The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". :vartype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.UserAssignedIdentity] + ~azure.mgmt.containerservice.v2025_03_01.models.UserAssignedIdentity] :ivar private_link_resources: Private link resources associated with the cluster. :vartype private_link_resources: - list[~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource] + list[~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource] :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts @@ -3077,38 +3105,38 @@ class ManagedCluster(TrackedResource): :vartype disable_local_accounts: bool :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. :vartype http_proxy_config: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterHTTPProxyConfig + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterHTTPProxyConfig :ivar security_profile: Security profile for the managed cluster. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfile :ivar storage_profile: Storage profile for the managed cluster. :vartype storage_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfile :ivar ingress_profile: Ingress profile for the managed cluster. :vartype ingress_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIngressProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIngressProfile :ivar public_network_access: Allow or deny public network access for AKS. Known values are: "Enabled" and "Disabled". :vartype public_network_access: str or - ~azure.mgmt.containerservice.v2025_02_01.models.PublicNetworkAccess + ~azure.mgmt.containerservice.v2025_03_01.models.PublicNetworkAccess :ivar workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. :vartype workload_auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWorkloadAutoScalerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWorkloadAutoScalerProfile :ivar azure_monitor_profile: Azure Monitor addon profiles for monitoring the managed cluster. :vartype azure_monitor_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAzureMonitorProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAzureMonitorProfile :ivar service_mesh_profile: Service mesh profile for a managed cluster. :vartype service_mesh_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ServiceMeshProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ServiceMeshProfile :ivar resource_uid: The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). :vartype resource_uid: str :ivar metrics_profile: Optional cluster metrics configuration. :vartype metrics_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterMetricsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterMetricsProfile :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. :vartype bootstrap_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterBootstrapProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterBootstrapProfile """ _validation = { @@ -3166,7 +3194,6 @@ class ManagedCluster(TrackedResource): }, "enable_rbac": {"key": "properties.enableRBAC", "type": "bool"}, "support_plan": {"key": "properties.supportPlan", "type": "str"}, - "enable_pod_security_policy": {"key": "properties.enablePodSecurityPolicy", "type": "bool"}, "network_profile": {"key": "properties.networkProfile", "type": "ContainerServiceNetworkProfile"}, "aad_profile": {"key": "properties.aadProfile", "type": "ManagedClusterAADProfile"}, "auto_upgrade_profile": {"key": "properties.autoUpgradeProfile", "type": "ManagedClusterAutoUpgradeProfile"}, @@ -3221,7 +3248,6 @@ def __init__( # pylint: disable=too-many-locals node_resource_group_profile: Optional["_models.ManagedClusterNodeResourceGroupProfile"] = None, enable_rbac: Optional[bool] = None, support_plan: Optional[Union[str, "_models.KubernetesSupportPlan"]] = None, - enable_pod_security_policy: Optional[bool] = None, network_profile: Optional["_models.ContainerServiceNetworkProfile"] = None, aad_profile: Optional["_models.ManagedClusterAADProfile"] = None, auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = None, @@ -3250,11 +3276,11 @@ def __init__( # pylint: disable=too-many-locals :keyword location: The geo-location where the resource lives. Required. :paramtype location: str :keyword sku: The managed cluster SKU. - :paramtype sku: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSKU + :paramtype sku: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSKU :keyword extended_location: The extended location of the Virtual Machine. - :paramtype extended_location: ~azure.mgmt.containerservice.v2025_02_01.models.ExtendedLocation + :paramtype extended_location: ~azure.mgmt.containerservice.v2025_03_01.models.ExtendedLocation :keyword identity: The identity of the managed cluster, if configured. - :paramtype identity: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIdentity + :paramtype identity: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIdentity :keyword kubernetes_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -3271,73 +3297,69 @@ def __init__( # pylint: disable=too-many-locals :paramtype fqdn_subdomain: str :keyword agent_pool_profiles: The agent pool properties. :paramtype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAgentPoolProfile] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAgentPoolProfile] :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. :paramtype linux_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceLinuxProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceLinuxProfile :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWindowsProfile :keyword service_principal_profile: Information about a service principal identity for the cluster to use for manipulating Azure APIs. :paramtype service_principal_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterServicePrincipalProfile :keyword addon_profiles: The profile of managed cluster add-on. :paramtype addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAddonProfile] + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAddonProfile] :keyword pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. :paramtype pod_identity_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProfile :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. :paramtype oidc_issuer_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterOIDCIssuerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterOIDCIssuerProfile :keyword node_resource_group: The name of the resource group containing agent pool nodes. :paramtype node_resource_group: str :keyword node_resource_group_profile: Profile of the node resource group configuration. :paramtype node_resource_group_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterNodeResourceGroupProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterNodeResourceGroupProfile :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :paramtype enable_rbac: bool :keyword support_plan: The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". :paramtype support_plan: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesSupportPlan - :keyword enable_pod_security_policy: (DEPRECATED) Whether to enable Kubernetes pod security - policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from - Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - :paramtype enable_pod_security_policy: bool + ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesSupportPlan :keyword network_profile: The network configuration profile. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ContainerServiceNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ContainerServiceNetworkProfile :keyword aad_profile: The Azure Active Directory configuration. :paramtype aad_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAADProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAADProfile :keyword auto_upgrade_profile: The auto upgrade configuration. :paramtype auto_upgrade_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAutoUpgradeProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAutoUpgradeProfile :keyword upgrade_settings: Settings for upgrading a cluster. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.ClusterUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.ClusterUpgradeSettings :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. :paramtype auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPropertiesAutoScalerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPropertiesAutoScalerProfile :keyword api_server_access_profile: The access profile for managed cluster API server. :paramtype api_server_access_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAPIServerAccessProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAPIServerAccessProfile :keyword disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. :paramtype disk_encryption_set_id: str :keyword identity_profile: The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". :paramtype identity_profile: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.UserAssignedIdentity] + ~azure.mgmt.containerservice.v2025_03_01.models.UserAssignedIdentity] :keyword private_link_resources: Private link resources associated with the cluster. :paramtype private_link_resources: - list[~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource] + list[~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource] :keyword disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts @@ -3346,52 +3368,52 @@ def __init__( # pylint: disable=too-many-locals :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. :paramtype http_proxy_config: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterHTTPProxyConfig + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterHTTPProxyConfig :keyword security_profile: Security profile for the managed cluster. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfile :keyword storage_profile: Storage profile for the managed cluster. :paramtype storage_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfile :keyword ingress_profile: Ingress profile for the managed cluster. :paramtype ingress_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIngressProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIngressProfile :keyword public_network_access: Allow or deny public network access for AKS. Known values are: "Enabled" and "Disabled". :paramtype public_network_access: str or - ~azure.mgmt.containerservice.v2025_02_01.models.PublicNetworkAccess + ~azure.mgmt.containerservice.v2025_03_01.models.PublicNetworkAccess :keyword workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. :paramtype workload_auto_scaler_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWorkloadAutoScalerProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWorkloadAutoScalerProfile :keyword azure_monitor_profile: Azure Monitor addon profiles for monitoring the managed cluster. :paramtype azure_monitor_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAzureMonitorProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAzureMonitorProfile :keyword service_mesh_profile: Service mesh profile for a managed cluster. :paramtype service_mesh_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ServiceMeshProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ServiceMeshProfile :keyword metrics_profile: Optional cluster metrics configuration. :paramtype metrics_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterMetricsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterMetricsProfile :keyword bootstrap_profile: Profile of the cluster bootstrap configuration. :paramtype bootstrap_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterBootstrapProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterBootstrapProfile """ super().__init__(tags=tags, location=location, **kwargs) - self.e_tag = None + self.e_tag: Optional[str] = None self.sku = sku self.extended_location = extended_location self.identity = identity - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None + self.provisioning_state: Optional[str] = None + self.power_state: Optional["_models.PowerState"] = None + self.max_agent_pools: Optional[int] = None self.kubernetes_version = kubernetes_version - self.current_kubernetes_version = None + self.current_kubernetes_version: Optional[str] = None self.dns_prefix = dns_prefix self.fqdn_subdomain = fqdn_subdomain - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None + self.fqdn: Optional[str] = None + self.private_fqdn: Optional[str] = None + self.azure_portal_fqdn: Optional[str] = None self.agent_pool_profiles = agent_pool_profiles self.linux_profile = linux_profile self.windows_profile = windows_profile @@ -3403,7 +3425,6 @@ def __init__( # pylint: disable=too-many-locals self.node_resource_group_profile = node_resource_group_profile self.enable_rbac = enable_rbac self.support_plan = support_plan - self.enable_pod_security_policy = enable_pod_security_policy self.network_profile = network_profile self.aad_profile = aad_profile self.auto_upgrade_profile = auto_upgrade_profile @@ -3422,7 +3443,7 @@ def __init__( # pylint: disable=too-many-locals self.workload_auto_scaler_profile = workload_auto_scaler_profile self.azure_monitor_profile = azure_monitor_profile self.service_mesh_profile = service_mesh_profile - self.resource_uid = None + self.resource_uid: Optional[str] = None self.metrics_profile = metrics_profile self.bootstrap_profile = bootstrap_profile @@ -3512,7 +3533,7 @@ class ManagedClusterAccessProfile(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3521,7 +3542,7 @@ class ManagedClusterAccessProfile(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -3581,7 +3602,7 @@ class ManagedClusterAddonProfile(_serialization.Model): :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAddonProfileIdentity + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAddonProfileIdentity """ _validation = { @@ -3605,7 +3626,7 @@ def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, ** super().__init__(**kwargs) self.enabled = enabled self.config = config - self.identity = None + self.identity: Optional["_models.ManagedClusterAddonProfileIdentity"] = None class UserAssignedIdentity(_serialization.Model): @@ -3686,15 +3707,15 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): after creation. For more information see `Ephemeral OS `_. Known values are: "Managed" and "Ephemeral". - :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSDiskType + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSDiskType :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :vartype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_03_01.models.KubeletDiskType :ivar workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer" and "WasmWasi". :vartype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_02_01.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_03_01.models.WorkloadRuntime :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -3703,22 +3724,22 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype vnet_subnet_id: str :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype pod_subnet_id: str :ivar max_pods: The maximum number of pods that can run on a node. :vartype max_pods: int :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :ivar max_count: The maximum number of nodes for auto-scaling. :vartype max_count: int :ivar min_count: The minimum number of nodes for auto-scaling. @@ -3727,14 +3748,14 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :vartype enable_auto_scaling: bool :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". - :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.ScaleDownMode + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.ScaleDownMode :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and "AvailabilitySet". - :vartype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolType + :vartype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolType :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System" and "User". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolMode :ivar orchestrator_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -3754,14 +3775,14 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :vartype node_image_version: str :ivar upgrade_settings: Settings for upgrading the agentpool. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :vartype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :vartype availability_zones: list[str] @@ -3773,16 +3794,16 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): The default is false. :vartype enable_node_public_ip: bool :ivar node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :vartype node_public_ip_prefix_id: str :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :vartype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetPriority :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :vartype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetEvictionPolicy :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -3797,9 +3818,9 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar proximity_placement_group_id: The ID for Proximity Placement Group. :vartype proximity_placement_group_id: str :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_02_01.models.KubeletConfig + :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_03_01.models.KubeletConfig :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_02_01.models.LinuxOSConfig + :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_03_01.models.LinuxOSConfig :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -3813,29 +3834,29 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :vartype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_02_01.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_03_01.models.GPUInstanceProfile :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :vartype capacity_reservation_group_id: str :ivar host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :vartype host_group_id: str :ivar network_profile: Network-related settings of an agent pool. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolNetworkProfile :ivar windows_profile: The Windows agent pool's specific profile. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolWindowsProfile :ivar security_profile: The security settings of an agent pool. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolSecurityProfile :ivar gpu_profile: GPU settings for the Agent Pool. - :vartype gpu_profile: ~azure.mgmt.containerservice.v2025_02_01.models.GPUProfile + :vartype gpu_profile: ~azure.mgmt.containerservice.v2025_03_01.models.GPUProfile """ _validation = { @@ -3964,15 +3985,15 @@ def __init__( # pylint: disable=too-many-locals after creation. For more information see `Ephemeral OS `_. Known values are: "Managed" and "Ephemeral". - :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSDiskType + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSDiskType :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :paramtype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_03_01.models.KubeletDiskType :keyword workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer" and "WasmWasi". :paramtype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_02_01.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_03_01.models.WorkloadRuntime :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -3981,22 +4002,22 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype vnet_subnet_id: str :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype pod_subnet_id: str :keyword max_pods: The maximum number of pods that can run on a node. :paramtype max_pods: int :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :keyword os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :keyword max_count: The maximum number of nodes for auto-scaling. :paramtype max_count: int :keyword min_count: The minimum number of nodes for auto-scaling. @@ -4006,14 +4027,14 @@ def __init__( # pylint: disable=too-many-locals :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :paramtype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleDownMode :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and "AvailabilitySet". - :paramtype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolType + :paramtype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolType :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System" and "User". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolMode :keyword orchestrator_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -4027,12 +4048,12 @@ def __init__( # pylint: disable=too-many-locals :paramtype orchestrator_version: str :keyword upgrade_settings: Settings for upgrading the agentpool. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeSettings :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :paramtype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :paramtype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :keyword availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :paramtype availability_zones: list[str] @@ -4040,20 +4061,20 @@ def __init__( # pylint: disable=too-many-locals their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node - `_. # pylint: disable=line-too-long + `_. The default is false. :paramtype enable_node_public_ip: bool :keyword node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :paramtype node_public_ip_prefix_id: str :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :paramtype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetPriority :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :paramtype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetEvictionPolicy :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -4068,9 +4089,9 @@ def __init__( # pylint: disable=too-many-locals :keyword proximity_placement_group_id: The ID for Proximity Placement Group. :paramtype proximity_placement_group_id: str :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. - :paramtype kubelet_config: ~azure.mgmt.containerservice.v2025_02_01.models.KubeletConfig + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2025_03_01.models.KubeletConfig :keyword linux_os_config: The OS configuration of Linux agent nodes. - :paramtype linux_os_config: ~azure.mgmt.containerservice.v2025_02_01.models.LinuxOSConfig + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2025_03_01.models.LinuxOSConfig :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -4085,32 +4106,32 @@ def __init__( # pylint: disable=too-many-locals profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :paramtype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_02_01.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_03_01.models.GPUInstanceProfile :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :paramtype capacity_reservation_group_id: str :keyword host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :paramtype host_group_id: str :keyword network_profile: Network-related settings of an agent pool. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolNetworkProfile :keyword windows_profile: The Windows agent pool's specific profile. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolWindowsProfile :keyword security_profile: The security settings of an agent pool. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolSecurityProfile :keyword gpu_profile: GPU settings for the Agent Pool. - :paramtype gpu_profile: ~azure.mgmt.containerservice.v2025_02_01.models.GPUProfile + :paramtype gpu_profile: ~azure.mgmt.containerservice.v2025_03_01.models.GPUProfile """ super().__init__(**kwargs) - self.e_tag = None + self.e_tag: Optional[str] = None self.count = count self.vm_size = vm_size self.os_disk_size_gb = os_disk_size_gb @@ -4130,10 +4151,10 @@ def __init__( # pylint: disable=too-many-locals self.type = type self.mode = mode self.orchestrator_version = orchestrator_version - self.current_orchestrator_version = None - self.node_image_version = None + self.current_orchestrator_version: Optional[str] = None + self.node_image_version: Optional[str] = None self.upgrade_settings = upgrade_settings - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.power_state = power_state self.availability_zones = availability_zones self.enable_node_public_ip = enable_node_public_ip @@ -4189,15 +4210,15 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): after creation. For more information see `Ephemeral OS `_. Known values are: "Managed" and "Ephemeral". - :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSDiskType + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSDiskType :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :vartype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_03_01.models.KubeletDiskType :ivar workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer" and "WasmWasi". :vartype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_02_01.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_03_01.models.WorkloadRuntime :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -4206,22 +4227,22 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype vnet_subnet_id: str :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :vartype pod_subnet_id: str :ivar max_pods: The maximum number of pods that can run on a node. :vartype max_pods: int :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :ivar max_count: The maximum number of nodes for auto-scaling. :vartype max_count: int :ivar min_count: The minimum number of nodes for auto-scaling. @@ -4230,14 +4251,14 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :vartype enable_auto_scaling: bool :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". - :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.ScaleDownMode + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.ScaleDownMode :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and "AvailabilitySet". - :vartype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolType + :vartype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolType :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System" and "User". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolMode :ivar orchestrator_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -4257,14 +4278,14 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :vartype node_image_version: str :ivar upgrade_settings: Settings for upgrading the agentpool. :vartype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :vartype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :vartype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :vartype availability_zones: list[str] @@ -4276,16 +4297,16 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): The default is false. :vartype enable_node_public_ip: bool :ivar node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :vartype node_public_ip_prefix_id: str :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :vartype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetPriority :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :vartype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetEvictionPolicy :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -4300,9 +4321,9 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar proximity_placement_group_id: The ID for Proximity Placement Group. :vartype proximity_placement_group_id: str :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_02_01.models.KubeletConfig + :vartype kubelet_config: ~azure.mgmt.containerservice.v2025_03_01.models.KubeletConfig :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_02_01.models.LinuxOSConfig + :vartype linux_os_config: ~azure.mgmt.containerservice.v2025_03_01.models.LinuxOSConfig :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -4316,29 +4337,29 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :vartype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_02_01.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_03_01.models.GPUInstanceProfile :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :vartype capacity_reservation_group_id: str :ivar host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :vartype host_group_id: str :ivar network_profile: Network-related settings of an agent pool. :vartype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolNetworkProfile :ivar windows_profile: The Windows agent pool's specific profile. :vartype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolWindowsProfile :ivar security_profile: The security settings of an agent pool. :vartype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolSecurityProfile :ivar gpu_profile: GPU settings for the Agent Pool. - :vartype gpu_profile: ~azure.mgmt.containerservice.v2025_02_01.models.GPUProfile + :vartype gpu_profile: ~azure.mgmt.containerservice.v2025_03_01.models.GPUProfile :ivar name: Windows agent pool names must be 6 characters or less. Required. :vartype name: str """ @@ -4472,15 +4493,15 @@ def __init__( # pylint: disable=too-many-locals after creation. For more information see `Ephemeral OS `_. Known values are: "Managed" and "Ephemeral". - :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSDiskType + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSDiskType :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Known values are: "OS" and "Temporary". :paramtype kubelet_disk_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.KubeletDiskType + ~azure.mgmt.containerservice.v2025_03_01.models.KubeletDiskType :keyword workload_runtime: Determines the type of workload a node can run. Known values are: "OCIContainer" and "WasmWasi". :paramtype workload_runtime: str or - ~azure.mgmt.containerservice.v2025_02_01.models.WorkloadRuntime + ~azure.mgmt.containerservice.v2025_03_01.models.WorkloadRuntime :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be @@ -4489,22 +4510,22 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype vnet_subnet_id: str :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. :paramtype pod_subnet_id: str :keyword max_pods: The maximum number of pods that can run on a node. :paramtype max_pods: int :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :keyword os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :keyword max_count: The maximum number of nodes for auto-scaling. :paramtype max_count: int :keyword min_count: The minimum number of nodes for auto-scaling. @@ -4514,14 +4535,14 @@ def __init__( # pylint: disable=too-many-locals :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Known values are: "Delete" and "Deallocate". :paramtype scale_down_mode: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleDownMode + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleDownMode :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and "AvailabilitySet". - :paramtype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolType + :paramtype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolType :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System" and "User". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolMode :keyword orchestrator_version: Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same once @@ -4535,12 +4556,12 @@ def __init__( # pylint: disable=too-many-locals :paramtype orchestrator_version: str :keyword upgrade_settings: Settings for upgrading the agentpool. :paramtype upgrade_settings: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeSettings + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeSettings :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :paramtype power_state: ~azure.mgmt.containerservice.v2025_02_01.models.PowerState + :paramtype power_state: ~azure.mgmt.containerservice.v2025_03_01.models.PowerState :keyword availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. :paramtype availability_zones: list[str] @@ -4548,20 +4569,20 @@ def __init__( # pylint: disable=too-many-locals their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node - `_. # pylint: disable=line-too-long + `_. The default is false. :paramtype enable_node_public_ip: bool :keyword node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. :paramtype node_public_ip_prefix_id: str :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Known values are: "Spot" and "Regular". :paramtype scale_set_priority: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetPriority + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetPriority :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Known values are: "Delete" and "Deallocate". :paramtype scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ScaleSetEvictionPolicy + ~azure.mgmt.containerservice.v2025_03_01.models.ScaleSetEvictionPolicy :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. @@ -4576,9 +4597,9 @@ def __init__( # pylint: disable=too-many-locals :keyword proximity_placement_group_id: The ID for Proximity Placement Group. :paramtype proximity_placement_group_id: str :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. - :paramtype kubelet_config: ~azure.mgmt.containerservice.v2025_02_01.models.KubeletConfig + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2025_03_01.models.KubeletConfig :keyword linux_os_config: The OS configuration of Linux agent nodes. - :paramtype linux_os_config: ~azure.mgmt.containerservice.v2025_02_01.models.LinuxOSConfig + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2025_03_01.models.LinuxOSConfig :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. @@ -4593,29 +4614,29 @@ def __init__( # pylint: disable=too-many-locals profile for supported GPU VM SKU. Known values are: "MIG1g", "MIG2g", "MIG3g", "MIG4g", and "MIG7g". :paramtype gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2025_02_01.models.GPUInstanceProfile + ~azure.mgmt.containerservice.v2025_03_01.models.GPUInstanceProfile :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the Capacity Reservation Group. :paramtype capacity_reservation_group_id: str :keyword host_group_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see `Azure dedicated hosts `_. :paramtype host_group_id: str :keyword network_profile: Network-related settings of an agent pool. :paramtype network_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolNetworkProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolNetworkProfile :keyword windows_profile: The Windows agent pool's specific profile. :paramtype windows_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolWindowsProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolWindowsProfile :keyword security_profile: The security settings of an agent pool. :paramtype security_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolSecurityProfile + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolSecurityProfile :keyword gpu_profile: GPU settings for the Agent Pool. - :paramtype gpu_profile: ~azure.mgmt.containerservice.v2025_02_01.models.GPUProfile + :paramtype gpu_profile: ~azure.mgmt.containerservice.v2025_03_01.models.GPUProfile :keyword name: Windows agent pool names must be 6 characters or less. Required. :paramtype name: str """ @@ -4689,6 +4710,12 @@ class ManagedClusterAPIServerAccessProfile(_serialization.Model): :vartype enable_private_cluster_public_fqdn: bool :ivar disable_run_command: Whether to disable run command for the cluster or not. :vartype disable_run_command: bool + :ivar enable_vnet_integration: Whether to enable apiserver vnet integration for the cluster or + not. See aka.ms/AksVnetIntegration for more details. + :vartype enable_vnet_integration: bool + :ivar subnet_id: It is required when creating a new cluster with BYO Vnet, or when updating an + existing cluster to enable apiserver vnet integration. + :vartype subnet_id: str """ _attribute_map = { @@ -4697,6 +4724,8 @@ class ManagedClusterAPIServerAccessProfile(_serialization.Model): "private_dns_zone": {"key": "privateDNSZone", "type": "str"}, "enable_private_cluster_public_fqdn": {"key": "enablePrivateClusterPublicFQDN", "type": "bool"}, "disable_run_command": {"key": "disableRunCommand", "type": "bool"}, + "enable_vnet_integration": {"key": "enableVnetIntegration", "type": "bool"}, + "subnet_id": {"key": "subnetId", "type": "str"}, } def __init__( @@ -4707,6 +4736,8 @@ def __init__( private_dns_zone: Optional[str] = None, enable_private_cluster_public_fqdn: Optional[bool] = None, disable_run_command: Optional[bool] = None, + enable_vnet_integration: Optional[bool] = None, + subnet_id: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -4727,6 +4758,12 @@ def __init__( :paramtype enable_private_cluster_public_fqdn: bool :keyword disable_run_command: Whether to disable run command for the cluster or not. :paramtype disable_run_command: bool + :keyword enable_vnet_integration: Whether to enable apiserver vnet integration for the cluster + or not. See aka.ms/AksVnetIntegration for more details. + :paramtype enable_vnet_integration: bool + :keyword subnet_id: It is required when creating a new cluster with BYO Vnet, or when updating + an existing cluster to enable apiserver vnet integration. + :paramtype subnet_id: str """ super().__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges @@ -4734,6 +4771,8 @@ def __init__( self.private_dns_zone = private_dns_zone self.enable_private_cluster_public_fqdn = enable_private_cluster_public_fqdn self.disable_run_command = disable_run_command + self.enable_vnet_integration = enable_vnet_integration + self.subnet_id = subnet_id class ManagedClusterAutoUpgradeProfile(_serialization.Model): @@ -4742,11 +4781,11 @@ class ManagedClusterAutoUpgradeProfile(_serialization.Model): :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. Known values are: "rapid", "stable", "patch", "node-image", and "none". - :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2025_02_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2025_03_01.models.UpgradeChannel :ivar node_os_upgrade_channel: Manner in which the OS on your nodes is updated. The default is NodeImage. Known values are: "None", "Unmanaged", "NodeImage", and "SecurityPatch". :vartype node_os_upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NodeOSUpgradeChannel + ~azure.mgmt.containerservice.v2025_03_01.models.NodeOSUpgradeChannel """ _attribute_map = { @@ -4766,11 +4805,11 @@ def __init__( channel `_. Known values are: "rapid", "stable", "patch", "node-image", and "none". :paramtype upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_02_01.models.UpgradeChannel + ~azure.mgmt.containerservice.v2025_03_01.models.UpgradeChannel :keyword node_os_upgrade_channel: Manner in which the OS on your nodes is updated. The default is NodeImage. Known values are: "None", "Unmanaged", "NodeImage", and "SecurityPatch". :paramtype node_os_upgrade_channel: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NodeOSUpgradeChannel + ~azure.mgmt.containerservice.v2025_03_01.models.NodeOSUpgradeChannel """ super().__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -4785,7 +4824,7 @@ class ManagedClusterAzureMonitorProfile(_serialization.Model): and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. :vartype metrics: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAzureMonitorProfileMetrics + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAzureMonitorProfileMetrics """ _attribute_map = { @@ -4801,7 +4840,7 @@ def __init__( and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. :paramtype metrics: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAzureMonitorProfileMetrics + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAzureMonitorProfileMetrics """ super().__init__(**kwargs) self.metrics = metrics @@ -4869,7 +4908,7 @@ class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. :vartype kube_state_metrics: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAzureMonitorProfileKubeStateMetrics """ _validation = { @@ -4897,7 +4936,7 @@ def __init__( These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. :paramtype kube_state_metrics: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAzureMonitorProfileKubeStateMetrics """ super().__init__(**kwargs) self.enabled = enabled @@ -4909,7 +4948,7 @@ class ManagedClusterBootstrapProfile(_serialization.Model): :ivar artifact_source: The source where the artifacts are downloaded from. Known values are: "Cache" and "Direct". - :vartype artifact_source: str or ~azure.mgmt.containerservice.v2025_02_01.models.ArtifactSource + :vartype artifact_source: str or ~azure.mgmt.containerservice.v2025_03_01.models.ArtifactSource :ivar container_registry_id: The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. :vartype container_registry_id: str @@ -4931,7 +4970,7 @@ def __init__( :keyword artifact_source: The source where the artifacts are downloaded from. Known values are: "Cache" and "Direct". :paramtype artifact_source: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ArtifactSource + ~azure.mgmt.containerservice.v2025_03_01.models.ArtifactSource :keyword container_registry_id: The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. :paramtype container_registry_id: str @@ -5027,16 +5066,16 @@ class ManagedClusterIdentity(_serialization.Model): :ivar type: For more information see `use managed identities in AKS `_. Known values are: "SystemAssigned", "UserAssigned", and "None". - :vartype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.ResourceIdentityType :ivar delegated_resources: The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only. :vartype delegated_resources: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.DelegatedResource] + ~azure.mgmt.containerservice.v2025_03_01.models.DelegatedResource] :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :vartype user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -5069,20 +5108,20 @@ def __init__( :keyword type: For more information see `use managed identities in AKS `_. Known values are: "SystemAssigned", "UserAssigned", and "None". - :paramtype type: str or ~azure.mgmt.containerservice.v2025_02_01.models.ResourceIdentityType + :paramtype type: str or ~azure.mgmt.containerservice.v2025_03_01.models.ResourceIdentityType :keyword delegated_resources: The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only. :paramtype delegated_resources: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.DelegatedResource] + ~azure.mgmt.containerservice.v2025_03_01.models.DelegatedResource] :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type self.delegated_resources = delegated_resources self.user_assigned_identities = user_assigned_identities @@ -5095,7 +5134,7 @@ class ManagedClusterIngressProfile(_serialization.Model): and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. :vartype web_app_routing: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIngressProfileWebAppRouting + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIngressProfileWebAppRouting """ _attribute_map = { @@ -5110,7 +5149,7 @@ def __init__( overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. :paramtype web_app_routing: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIngressProfileWebAppRouting + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIngressProfileWebAppRouting """ super().__init__(**kwargs) self.web_app_routing = web_app_routing @@ -5122,7 +5161,7 @@ class ManagedClusterIngressProfileNginx(_serialization.Model): :ivar default_ingress_controller_type: Ingress type for the default NginxIngressController custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". :vartype default_ingress_controller_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NginxIngressControllerType + ~azure.mgmt.containerservice.v2025_03_01.models.NginxIngressControllerType """ _attribute_map = { @@ -5139,7 +5178,7 @@ def __init__( :keyword default_ingress_controller_type: Ingress type for the default NginxIngressController custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". :paramtype default_ingress_controller_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.NginxIngressControllerType + ~azure.mgmt.containerservice.v2025_03_01.models.NginxIngressControllerType """ super().__init__(**kwargs) self.default_ingress_controller_type = default_ingress_controller_type @@ -5160,13 +5199,13 @@ class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): # pylint :ivar nginx: Configuration for the default NginxIngressController. See more at https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. :vartype nginx: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIngressProfileNginx + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIngressProfileNginx :ivar identity: Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See `this overview of the add-on `_ for more instructions. - :vartype identity: ~azure.mgmt.containerservice.v2025_02_01.models.UserAssignedIdentity + :vartype identity: ~azure.mgmt.containerservice.v2025_03_01.models.UserAssignedIdentity """ _validation = { @@ -5198,15 +5237,15 @@ def __init__( same resource group and all private DNS zones must be in the same resource group. :paramtype dns_zone_resource_ids: list[str] :keyword nginx: Configuration for the default NginxIngressController. See more at - https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. # pylint: disable=line-too-long + https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. :paramtype nginx: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterIngressProfileNginx + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterIngressProfileNginx """ super().__init__(**kwargs) self.enabled = enabled self.dns_zone_resource_ids = dns_zone_resource_ids self.nginx = nginx - self.identity = None + self.identity: Optional["_models.UserAssignedIdentity"] = None class ManagedClusterListResult(_serialization.Model): @@ -5215,7 +5254,7 @@ class ManagedClusterListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of managed clusters. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -5232,11 +5271,11 @@ class ManagedClusterListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.ManagedCluster"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of managed clusters. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedClusterLoadBalancerProfile(_serialization.Model): @@ -5246,17 +5285,17 @@ class ManagedClusterLoadBalancerProfile(_serialization.Model): :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. :vartype managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. :vartype outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. :vartype outbound_i_ps: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. :vartype effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2025_02_01.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_03_01.models.ResourceReference] :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. @@ -5270,7 +5309,7 @@ class ManagedClusterLoadBalancerProfile(_serialization.Model): :ivar backend_pool_type: The type of the managed inbound Load Balancer BackendPool. Known values are: "NodeIPConfiguration" and "NodeIP". :vartype backend_pool_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.BackendPoolType + ~azure.mgmt.containerservice.v2025_03_01.models.BackendPoolType """ _validation = { @@ -5311,14 +5350,14 @@ def __init__( """ :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. :paramtype managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. :paramtype outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. :paramtype outbound_i_ps: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. @@ -5332,13 +5371,13 @@ def __init__( :keyword backend_pool_type: The type of the managed inbound Load Balancer BackendPool. Known values are: "NodeIPConfiguration" and "NodeIP". :paramtype backend_pool_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.BackendPoolType + ~azure.mgmt.containerservice.v2025_03_01.models.BackendPoolType """ super().__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes self.outbound_i_ps = outbound_i_ps - self.effective_outbound_i_ps = None + self.effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None self.allocated_outbound_ports = allocated_outbound_ports self.idle_timeout_in_minutes = idle_timeout_in_minutes self.enable_multiple_standard_load_balancers = enable_multiple_standard_load_balancers @@ -5389,7 +5428,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): :ivar public_ip_prefixes: A list of public IP prefix resources. :vartype public_ip_prefixes: - list[~azure.mgmt.containerservice.v2025_02_01.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_03_01.models.ResourceReference] """ _attribute_map = { @@ -5402,7 +5441,7 @@ def __init__( """ :keyword public_ip_prefixes: A list of public IP prefix resources. :paramtype public_ip_prefixes: - list[~azure.mgmt.containerservice.v2025_02_01.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_03_01.models.ResourceReference] """ super().__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -5412,7 +5451,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pyl """Desired outbound IP resources for the cluster load balancer. :ivar public_i_ps: A list of public IP resources. - :vartype public_i_ps: list[~azure.mgmt.containerservice.v2025_02_01.models.ResourceReference] + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2025_03_01.models.ResourceReference] """ _attribute_map = { @@ -5422,7 +5461,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pyl def __init__(self, *, public_i_ps: Optional[List["_models.ResourceReference"]] = None, **kwargs: Any) -> None: """ :keyword public_i_ps: A list of public IP resources. - :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2025_02_01.models.ResourceReference] + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2025_03_01.models.ResourceReference] """ super().__init__(**kwargs) self.public_i_ps = public_i_ps @@ -5459,7 +5498,7 @@ class ManagedClusterMetricsProfile(_serialization.Model): :ivar cost_analysis: The cost analysis configuration for the cluster. :vartype cost_analysis: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterCostAnalysis + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterCostAnalysis """ _attribute_map = { @@ -5470,7 +5509,7 @@ def __init__(self, *, cost_analysis: Optional["_models.ManagedClusterCostAnalysi """ :keyword cost_analysis: The cost analysis configuration for the cluster. :paramtype cost_analysis: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterCostAnalysis + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterCostAnalysis """ super().__init__(**kwargs) self.cost_analysis = cost_analysis @@ -5484,10 +5523,10 @@ class ManagedClusterNATGatewayProfile(_serialization.Model): :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. :vartype managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterManagedOutboundIPProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterManagedOutboundIPProfile :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. :vartype effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2025_02_01.models.ResourceReference] + list[~azure.mgmt.containerservice.v2025_03_01.models.ResourceReference] :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. :vartype idle_timeout_in_minutes: int @@ -5518,14 +5557,14 @@ def __init__( :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. :paramtype managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterManagedOutboundIPProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterManagedOutboundIPProfile :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. :paramtype idle_timeout_in_minutes: int """ super().__init__(**kwargs) self.managed_outbound_ip_profile = managed_outbound_ip_profile - self.effective_outbound_i_ps = None + self.effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None self.idle_timeout_in_minutes = idle_timeout_in_minutes @@ -5535,7 +5574,7 @@ class ManagedClusterNodeResourceGroupProfile(_serialization.Model): :ivar restriction_level: The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. Known values are: "Unrestricted" and "ReadOnly". :vartype restriction_level: str or - ~azure.mgmt.containerservice.v2025_02_01.models.RestrictionLevel + ~azure.mgmt.containerservice.v2025_03_01.models.RestrictionLevel """ _attribute_map = { @@ -5550,7 +5589,7 @@ def __init__( If not specified, the default is 'Unrestricted'. Known values are: "Unrestricted" and "ReadOnly". :paramtype restriction_level: str or - ~azure.mgmt.containerservice.v2025_02_01.models.RestrictionLevel + ~azure.mgmt.containerservice.v2025_03_01.models.RestrictionLevel """ super().__init__(**kwargs) self.restriction_level = restriction_level @@ -5582,7 +5621,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: :paramtype enabled: bool """ super().__init__(**kwargs) - self.issuer_url = None + self.issuer_url: Optional[str] = None self.enabled = enabled @@ -5600,14 +5639,14 @@ class ManagedClusterPodIdentity(_serialization.Model): :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. :vartype binding_selector: str :ivar identity: The user assigned identity details. Required. - :vartype identity: ~azure.mgmt.containerservice.v2025_02_01.models.UserAssignedIdentity + :vartype identity: ~azure.mgmt.containerservice.v2025_03_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Known values are: "Assigned", "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningState + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningState :ivar provisioning_info: :vartype provisioning_info: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningInfo + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningInfo """ _validation = { @@ -5644,15 +5683,15 @@ def __init__( :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. :paramtype binding_selector: str :keyword identity: The user assigned identity details. Required. - :paramtype identity: ~azure.mgmt.containerservice.v2025_02_01.models.UserAssignedIdentity + :paramtype identity: ~azure.mgmt.containerservice.v2025_03_01.models.UserAssignedIdentity """ super().__init__(**kwargs) self.name = name self.namespace = namespace self.binding_selector = binding_selector self.identity = identity - self.provisioning_state = None - self.provisioning_info = None + self.provisioning_state: Optional[Union[str, "_models.ManagedClusterPodIdentityProvisioningState"]] = None + self.provisioning_info: Optional["_models.ManagedClusterPodIdentityProvisioningInfo"] = None class ManagedClusterPodIdentityException(_serialization.Model): @@ -5706,15 +5745,15 @@ class ManagedClusterPodIdentityProfile(_serialization.Model): :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity - `_ # pylint: disable=line-too-long + `_ for more information. :vartype allow_network_plugin_kubenet: bool :ivar user_assigned_identities: The pod identities to use in the cluster. :vartype user_assigned_identities: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentity] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentity] :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. :vartype user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityException] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityException] """ _attribute_map = { @@ -5742,15 +5781,15 @@ def __init__( :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity - `_ # pylint: disable=line-too-long + `_ for more information. :paramtype allow_network_plugin_kubenet: bool :keyword user_assigned_identities: The pod identities to use in the cluster. :paramtype user_assigned_identities: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentity] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentity] :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. :paramtype user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityException] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityException] """ super().__init__(**kwargs) self.enabled = enabled @@ -5764,7 +5803,7 @@ class ManagedClusterPodIdentityProvisioningError(_serialization.Model): # pylin :ivar error: Details about the error. :vartype error: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningErrorBody + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ _attribute_map = { @@ -5777,7 +5816,7 @@ def __init__( """ :keyword error: Details about the error. :paramtype error: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningErrorBody + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ super().__init__(**kwargs) self.error = error @@ -5797,7 +5836,7 @@ class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): # p :vartype target: str :ivar details: A list of additional details about the error. :vartype details: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ _attribute_map = { @@ -5828,7 +5867,7 @@ def __init__( :paramtype target: str :keyword details: A list of additional details about the error. :paramtype details: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ super().__init__(**kwargs) self.code = code @@ -5842,7 +5881,7 @@ class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): # pylint :ivar error: Pod identity assignment error (if any). :vartype error: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningError + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningError """ _attribute_map = { @@ -5855,7 +5894,7 @@ def __init__( """ :keyword error: Pod identity assignment error (if any). :paramtype error: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPodIdentityProvisioningError + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPodIdentityProvisioningError """ super().__init__(**kwargs) self.error = error @@ -5872,10 +5911,10 @@ class ManagedClusterPoolUpgradeProfile(_serialization.Model): :vartype name: str :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :ivar upgrades: List of orchestrator types and versions available for upgrade. :vartype upgrades: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ _validation = { @@ -5906,10 +5945,10 @@ def __init__( :paramtype name: str :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :paramtype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :keyword upgrades: List of orchestrator types and versions available for upgrade. :paramtype upgrades: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ super().__init__(**kwargs) self.kubernetes_version = kubernetes_version @@ -5967,7 +6006,7 @@ class ManagedClusterPropertiesAutoScalerProfile(_serialization.Model): # pylint :ivar expander: If not specified, the default is 'random'. See `expanders `_ for more information. Known values are: "least-waste", "most-pods", "priority", and "random". - :vartype expander: str or ~azure.mgmt.containerservice.v2025_02_01.models.Expander + :vartype expander: str or ~azure.mgmt.containerservice.v2025_03_01.models.Expander :ivar max_empty_bulk_delete: The default is 10. :vartype max_empty_bulk_delete: str :ivar max_graceful_termination_sec: The default is 600. @@ -6076,7 +6115,7 @@ def __init__( :keyword expander: If not specified, the default is 'random'. See `expanders `_ for more information. Known values are: "least-waste", "most-pods", "priority", and "random". - :paramtype expander: str or ~azure.mgmt.containerservice.v2025_02_01.models.Expander + :paramtype expander: str or ~azure.mgmt.containerservice.v2025_03_01.models.Expander :keyword max_empty_bulk_delete: The default is 10. :paramtype max_empty_bulk_delete: str :keyword max_graceful_termination_sec: The default is 600. @@ -6146,19 +6185,19 @@ class ManagedClusterSecurityProfile(_serialization.Model): :ivar defender: Microsoft Defender settings for the security profile. :vartype defender: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileDefender + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileDefender :ivar azure_key_vault_kms: Azure Key Vault `key management service `_ settings for the security profile. - :vartype azure_key_vault_kms: ~azure.mgmt.containerservice.v2025_02_01.models.AzureKeyVaultKms + :vartype azure_key_vault_kms: ~azure.mgmt.containerservice.v2025_03_01.models.AzureKeyVaultKms :ivar workload_identity: Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. :vartype workload_identity: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileWorkloadIdentity + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileWorkloadIdentity :ivar image_cleaner: Image Cleaner settings for the security profile. :vartype image_cleaner: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileImageCleaner + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileImageCleaner :ivar custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more information see `Custom CA Trust Certificates `_. @@ -6190,20 +6229,20 @@ def __init__( """ :keyword defender: Microsoft Defender settings for the security profile. :paramtype defender: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileDefender + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileDefender :keyword azure_key_vault_kms: Azure Key Vault `key management service `_ settings for the security profile. :paramtype azure_key_vault_kms: - ~azure.mgmt.containerservice.v2025_02_01.models.AzureKeyVaultKms + ~azure.mgmt.containerservice.v2025_03_01.models.AzureKeyVaultKms :keyword workload_identity: Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. :paramtype workload_identity: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileWorkloadIdentity + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileWorkloadIdentity :keyword image_cleaner: Image Cleaner settings for the security profile. :paramtype image_cleaner: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileImageCleaner + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileImageCleaner :keyword custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more information see `Custom CA Trust Certificates `_. @@ -6228,7 +6267,7 @@ class ManagedClusterSecurityProfileDefender(_serialization.Model): :ivar security_monitoring: Microsoft Defender threat detection for Cloud settings for the security profile. :vartype security_monitoring: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring """ _attribute_map = { @@ -6255,7 +6294,7 @@ def __init__( :keyword security_monitoring: Microsoft Defender threat detection for Cloud settings for the security profile. :paramtype security_monitoring: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring """ super().__init__(**kwargs) self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id @@ -6366,11 +6405,11 @@ class ManagedClusterSKU(_serialization.Model): """The SKU of a Managed Cluster. :ivar name: The name of a managed cluster SKU. "Base" - :vartype name: str or ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSKUName + :vartype name: str or ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSKUName :ivar tier: If not specified, the default is 'Free'. See `AKS Pricing Tier `_ for more details. Known values are: "Premium", "Standard", and "Free". - :vartype tier: str or ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSKUTier + :vartype tier: str or ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -6387,11 +6426,11 @@ def __init__( ) -> None: """ :keyword name: The name of a managed cluster SKU. "Base" - :paramtype name: str or ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSKUName + :paramtype name: str or ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSKUName :keyword tier: If not specified, the default is 'Free'. See `AKS Pricing Tier `_ for more details. Known values are: "Premium", "Standard", and "Free". - :paramtype tier: str or ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterSKUTier + :paramtype tier: str or ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterSKUTier """ super().__init__(**kwargs) self.name = name @@ -6403,16 +6442,16 @@ class ManagedClusterStorageProfile(_serialization.Model): :ivar disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. :vartype disk_csi_driver: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileDiskCSIDriver + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileDiskCSIDriver :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. :vartype file_csi_driver: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileFileCSIDriver + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileFileCSIDriver :ivar snapshot_controller: Snapshot Controller settings for the storage profile. :vartype snapshot_controller: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileSnapshotController + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileSnapshotController :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. :vartype blob_csi_driver: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileBlobCSIDriver + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileBlobCSIDriver """ _attribute_map = { @@ -6434,16 +6473,16 @@ def __init__( """ :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. :paramtype disk_csi_driver: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileDiskCSIDriver + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileDiskCSIDriver :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. :paramtype file_csi_driver: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileFileCSIDriver + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileFileCSIDriver :keyword snapshot_controller: Snapshot Controller settings for the storage profile. :paramtype snapshot_controller: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileSnapshotController + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileSnapshotController :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. :paramtype blob_csi_driver: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterStorageProfileBlobCSIDriver + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterStorageProfileBlobCSIDriver """ super().__init__(**kwargs) self.disk_csi_driver = disk_csi_driver @@ -6548,10 +6587,10 @@ class ManagedClusterUpgradeProfile(_serialization.Model): :ivar control_plane_profile: The list of available upgrade versions for the control plane. Required. :vartype control_plane_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPoolUpgradeProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPoolUpgradeProfile :ivar agent_pool_profiles: The list of available upgrade versions for agent pools. Required. :vartype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPoolUpgradeProfile] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPoolUpgradeProfile] """ _validation = { @@ -6581,15 +6620,15 @@ def __init__( :keyword control_plane_profile: The list of available upgrade versions for the control plane. Required. :paramtype control_plane_profile: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPoolUpgradeProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPoolUpgradeProfile :keyword agent_pool_profiles: The list of available upgrade versions for agent pools. Required. :paramtype agent_pool_profiles: - list[~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterPoolUpgradeProfile] + list[~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterPoolUpgradeProfile] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.control_plane_profile = control_plane_profile self.agent_pool_profiles = agent_pool_profiles @@ -6618,12 +6657,12 @@ class ManagedClusterWindowsProfile(_serialization.Model): :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Known values are: "None" and "Windows_Server". - :vartype license_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.LicenseType + :vartype license_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.LicenseType :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. :vartype enable_csi_proxy: bool :ivar gmsa_profile: The Windows gMSA Profile in the Managed Cluster. - :vartype gmsa_profile: ~azure.mgmt.containerservice.v2025_02_01.models.WindowsGmsaProfile + :vartype gmsa_profile: ~azure.mgmt.containerservice.v2025_03_01.models.WindowsGmsaProfile """ _validation = { @@ -6668,12 +6707,12 @@ def __init__( :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Known values are: "None" and "Windows_Server". - :paramtype license_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.LicenseType + :paramtype license_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.LicenseType :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. :paramtype enable_csi_proxy: bool :keyword gmsa_profile: The Windows gMSA Profile in the Managed Cluster. - :paramtype gmsa_profile: ~azure.mgmt.containerservice.v2025_02_01.models.WindowsGmsaProfile + :paramtype gmsa_profile: ~azure.mgmt.containerservice.v2025_03_01.models.WindowsGmsaProfile """ super().__init__(**kwargs) self.admin_username = admin_username @@ -6689,11 +6728,11 @@ class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. :vartype keda: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWorkloadAutoScalerProfileKeda + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWorkloadAutoScalerProfileKeda :ivar vertical_pod_autoscaler: VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. :vartype vertical_pod_autoscaler: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler """ _attribute_map = { @@ -6717,11 +6756,11 @@ def __init__( :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. :paramtype keda: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWorkloadAutoScalerProfileKeda + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWorkloadAutoScalerProfileKeda :keyword vertical_pod_autoscaler: VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. :paramtype vertical_pod_autoscaler: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler """ super().__init__(**kwargs) self.keda = keda @@ -6806,8 +6845,8 @@ class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None + self.principal_id: Optional[str] = None + self.client_id: Optional[str] = None class MeshRevision(_serialization.Model): @@ -6820,7 +6859,7 @@ class MeshRevision(_serialization.Model): :ivar compatible_with: List of items this revision of service mesh is compatible with, and their associated versions. :vartype compatible_with: - list[~azure.mgmt.containerservice.v2025_02_01.models.CompatibleVersions] + list[~azure.mgmt.containerservice.v2025_03_01.models.CompatibleVersions] """ _attribute_map = { @@ -6845,7 +6884,7 @@ def __init__( :keyword compatible_with: List of items this revision of service mesh is compatible with, and their associated versions. :paramtype compatible_with: - list[~azure.mgmt.containerservice.v2025_02_01.models.CompatibleVersions] + list[~azure.mgmt.containerservice.v2025_03_01.models.CompatibleVersions] """ super().__init__(**kwargs) self.revision = revision @@ -6860,7 +6899,7 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -6869,7 +6908,7 @@ class ProxyResource(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData """ @@ -6879,7 +6918,7 @@ class MeshRevisionProfile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -6888,10 +6927,10 @@ class MeshRevisionProfile(ProxyResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar properties: Mesh revision profile properties for a mesh. :vartype properties: - ~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfileProperties + ~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfileProperties """ _validation = { @@ -6913,7 +6952,7 @@ def __init__(self, *, properties: Optional["_models.MeshRevisionProfilePropertie """ :keyword properties: Mesh revision profile properties for a mesh. :paramtype properties: - ~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfileProperties + ~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfileProperties """ super().__init__(**kwargs) self.properties = properties @@ -6925,7 +6964,7 @@ class MeshRevisionProfileList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Array of service mesh add-on revision profiles for all supported mesh modes. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfile] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfile] :ivar next_link: The URL to get the next set of mesh revision profile. :vartype next_link: str """ @@ -6942,18 +6981,18 @@ class MeshRevisionProfileList(_serialization.Model): def __init__(self, *, value: Optional[List["_models.MeshRevisionProfile"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of service mesh add-on revision profiles for all supported mesh modes. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfile] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfile] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MeshRevisionProfileProperties(_serialization.Model): """Mesh revision profile properties for a mesh. :ivar mesh_revisions: - :vartype mesh_revisions: list[~azure.mgmt.containerservice.v2025_02_01.models.MeshRevision] + :vartype mesh_revisions: list[~azure.mgmt.containerservice.v2025_03_01.models.MeshRevision] """ _attribute_map = { @@ -6963,7 +7002,7 @@ class MeshRevisionProfileProperties(_serialization.Model): def __init__(self, *, mesh_revisions: Optional[List["_models.MeshRevision"]] = None, **kwargs: Any) -> None: """ :keyword mesh_revisions: - :paramtype mesh_revisions: list[~azure.mgmt.containerservice.v2025_02_01.models.MeshRevision] + :paramtype mesh_revisions: list[~azure.mgmt.containerservice.v2025_03_01.models.MeshRevision] """ super().__init__(**kwargs) self.mesh_revisions = mesh_revisions @@ -6975,7 +7014,7 @@ class MeshUpgradeProfile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -6984,10 +7023,10 @@ class MeshUpgradeProfile(ProxyResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar properties: Mesh upgrade profile properties for a major.minor release. :vartype properties: - ~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfileProperties + ~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfileProperties """ _validation = { @@ -7009,7 +7048,7 @@ def __init__(self, *, properties: Optional["_models.MeshUpgradeProfileProperties """ :keyword properties: Mesh upgrade profile properties for a major.minor release. :paramtype properties: - ~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfileProperties + ~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfileProperties """ super().__init__(**kwargs) self.properties = properties @@ -7021,7 +7060,7 @@ class MeshUpgradeProfileList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Array of supported service mesh add-on upgrade profiles. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfile] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfile] :ivar next_link: The URL to get the next set of mesh upgrade profile. :vartype next_link: str """ @@ -7038,11 +7077,11 @@ class MeshUpgradeProfileList(_serialization.Model): def __init__(self, *, value: Optional[List["_models.MeshUpgradeProfile"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of supported service mesh add-on upgrade profiles. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfile] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfile] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class MeshUpgradeProfileProperties(MeshRevision): @@ -7055,7 +7094,7 @@ class MeshUpgradeProfileProperties(MeshRevision): :ivar compatible_with: List of items this revision of service mesh is compatible with, and their associated versions. :vartype compatible_with: - list[~azure.mgmt.containerservice.v2025_02_01.models.CompatibleVersions] + list[~azure.mgmt.containerservice.v2025_03_01.models.CompatibleVersions] """ @@ -7065,7 +7104,7 @@ class OperationListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.OperationValue] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.OperationValue] """ _validation = { @@ -7079,7 +7118,7 @@ class OperationListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.OperationValue"]] = None class OperationValue(_serialization.Model): @@ -7122,12 +7161,12 @@ class OperationValue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None + self.origin: Optional[str] = None + self.name: Optional[str] = None + self.operation: Optional[str] = None + self.resource: Optional[str] = None + self.description: Optional[str] = None + self.provider: Optional[str] = None class OutboundEnvironmentEndpoint(_serialization.Model): @@ -7137,7 +7176,7 @@ class OutboundEnvironmentEndpoint(_serialization.Model): azure-resource-management, apiserver, etc. :vartype category: str :ivar endpoints: The endpoints that AKS agent nodes connect to. - :vartype endpoints: list[~azure.mgmt.containerservice.v2025_02_01.models.EndpointDependency] + :vartype endpoints: list[~azure.mgmt.containerservice.v2025_03_01.models.EndpointDependency] """ _attribute_map = { @@ -7157,7 +7196,7 @@ def __init__( azure-resource-management, apiserver, etc. :paramtype category: str :keyword endpoints: The endpoints that AKS agent nodes connect to. - :paramtype endpoints: list[~azure.mgmt.containerservice.v2025_02_01.models.EndpointDependency] + :paramtype endpoints: list[~azure.mgmt.containerservice.v2025_03_01.models.EndpointDependency] """ super().__init__(**kwargs) self.category = category @@ -7173,7 +7212,7 @@ class OutboundEnvironmentEndpointCollection(_serialization.Model): :ivar value: Collection of resources. Required. :vartype value: - list[~azure.mgmt.containerservice.v2025_02_01.models.OutboundEnvironmentEndpoint] + list[~azure.mgmt.containerservice.v2025_03_01.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -7192,11 +7231,11 @@ def __init__(self, *, value: List["_models.OutboundEnvironmentEndpoint"], **kwar """ :keyword value: Collection of resources. Required. :paramtype value: - list[~azure.mgmt.containerservice.v2025_02_01.models.OutboundEnvironmentEndpoint] + list[~azure.mgmt.containerservice.v2025_03_01.models.OutboundEnvironmentEndpoint] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class PortRange(_serialization.Model): @@ -7209,7 +7248,7 @@ class PortRange(_serialization.Model): 65535, and be greater than or equal to portStart. :vartype port_end: int :ivar protocol: The network protocol of the port. Known values are: "TCP" and "UDP". - :vartype protocol: str or ~azure.mgmt.containerservice.v2025_02_01.models.Protocol + :vartype protocol: str or ~azure.mgmt.containerservice.v2025_03_01.models.Protocol """ _validation = { @@ -7239,7 +7278,7 @@ def __init__( to 65535, and be greater than or equal to portStart. :paramtype port_end: int :keyword protocol: The network protocol of the port. Known values are: "TCP" and "UDP". - :paramtype protocol: str or ~azure.mgmt.containerservice.v2025_02_01.models.Protocol + :paramtype protocol: str or ~azure.mgmt.containerservice.v2025_03_01.models.Protocol """ super().__init__(**kwargs) self.port_start = port_start @@ -7252,7 +7291,7 @@ class PowerState(_serialization.Model): :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and "Stopped". - :vartype code: str or ~azure.mgmt.containerservice.v2025_02_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2025_03_01.models.Code """ _attribute_map = { @@ -7263,7 +7302,7 @@ def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwarg """ :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and "Stopped". - :paramtype code: str or ~azure.mgmt.containerservice.v2025_02_01.models.Code + :paramtype code: str or ~azure.mgmt.containerservice.v2025_03_01.models.Code """ super().__init__(**kwargs) self.code = code @@ -7303,13 +7342,13 @@ class PrivateEndpointConnection(_serialization.Model): :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", "Creating", "Deleting", "Failed", and "Succeeded". :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnectionProvisioningState + ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnectionProvisioningState :ivar private_endpoint: The resource of private endpoint. - :vartype private_endpoint: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpoint + :vartype private_endpoint: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpoint :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkServiceConnectionState + ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkServiceConnectionState """ _validation = { @@ -7340,17 +7379,17 @@ def __init__( ) -> None: """ :keyword private_endpoint: The resource of private endpoint. - :paramtype private_endpoint: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpoint + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpoint :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkServiceConnectionState + ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkServiceConnectionState """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = None self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state @@ -7359,7 +7398,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): """A list of private endpoint connections. :ivar value: The collection value. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -7370,7 +7409,7 @@ def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] """ :keyword value: The collection value. :paramtype value: - list[~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection] + list[~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection] """ super().__init__(**kwargs) self.value = value @@ -7437,14 +7476,14 @@ def __init__( self.type = type self.group_id = group_id self.required_members = required_members - self.private_link_service_id = None + self.private_link_service_id: Optional[str] = None class PrivateLinkResourcesListResult(_serialization.Model): """A list of private link resources. :ivar value: The collection value. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource] """ _attribute_map = { @@ -7454,7 +7493,7 @@ class PrivateLinkResourcesListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: """ :keyword value: The collection value. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource] """ super().__init__(**kwargs) self.value = value @@ -7465,7 +7504,7 @@ class PrivateLinkServiceConnectionState(_serialization.Model): :ivar status: The private link service connection status. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". - :vartype status: str or ~azure.mgmt.containerservice.v2025_02_01.models.ConnectionStatus + :vartype status: str or ~azure.mgmt.containerservice.v2025_03_01.models.ConnectionStatus :ivar description: The private link service connection description. :vartype description: str """ @@ -7485,7 +7524,7 @@ def __init__( """ :keyword status: The private link service connection status. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". - :paramtype status: str or ~azure.mgmt.containerservice.v2025_02_01.models.ConnectionStatus + :paramtype status: str or ~azure.mgmt.containerservice.v2025_03_01.models.ConnectionStatus :keyword description: The private link service connection description. :paramtype description: str """ @@ -7505,10 +7544,10 @@ class RelativeMonthlySchedule(_serialization.Model): :vartype interval_months: int :ivar week_index: Specifies on which week of the month the dayOfWeek applies. Required. Known values are: "First", "Second", "Third", "Fourth", and "Last". - :vartype week_index: str or ~azure.mgmt.containerservice.v2025_02_01.models.Type + :vartype week_index: str or ~azure.mgmt.containerservice.v2025_03_01.models.Type :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_01.models.WeekDay + :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_03_01.models.WeekDay """ _validation = { @@ -7537,11 +7576,11 @@ def __init__( :paramtype interval_months: int :keyword week_index: Specifies on which week of the month the dayOfWeek applies. Required. Known values are: "First", "Second", "Third", "Fourth", and "Last". - :paramtype week_index: str or ~azure.mgmt.containerservice.v2025_02_01.models.Type + :paramtype week_index: str or ~azure.mgmt.containerservice.v2025_03_01.models.Type :keyword day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_01.models.WeekDay + :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_03_01.models.WeekDay """ super().__init__(**kwargs) self.interval_months = interval_months @@ -7653,13 +7692,13 @@ class RunCommandResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None + self.id: Optional[str] = None + self.provisioning_state: Optional[str] = None + self.exit_code: Optional[int] = None + self.started_at: Optional[datetime.datetime] = None + self.finished_at: Optional[datetime.datetime] = None + self.logs: Optional[str] = None + self.reason: Optional[str] = None class Schedule(_serialization.Model): @@ -7667,17 +7706,17 @@ class Schedule(_serialization.Model): 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. :ivar daily: For schedules like: 'recur every day' or 'recur every 3 days'. - :vartype daily: ~azure.mgmt.containerservice.v2025_02_01.models.DailySchedule + :vartype daily: ~azure.mgmt.containerservice.v2025_03_01.models.DailySchedule :ivar weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - :vartype weekly: ~azure.mgmt.containerservice.v2025_02_01.models.WeeklySchedule + :vartype weekly: ~azure.mgmt.containerservice.v2025_03_01.models.WeeklySchedule :ivar absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. :vartype absolute_monthly: - ~azure.mgmt.containerservice.v2025_02_01.models.AbsoluteMonthlySchedule + ~azure.mgmt.containerservice.v2025_03_01.models.AbsoluteMonthlySchedule :ivar relative_monthly: For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. :vartype relative_monthly: - ~azure.mgmt.containerservice.v2025_02_01.models.RelativeMonthlySchedule + ~azure.mgmt.containerservice.v2025_03_01.models.RelativeMonthlySchedule """ _attribute_map = { @@ -7698,18 +7737,18 @@ def __init__( ) -> None: """ :keyword daily: For schedules like: 'recur every day' or 'recur every 3 days'. - :paramtype daily: ~azure.mgmt.containerservice.v2025_02_01.models.DailySchedule + :paramtype daily: ~azure.mgmt.containerservice.v2025_03_01.models.DailySchedule :keyword weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - :paramtype weekly: ~azure.mgmt.containerservice.v2025_02_01.models.WeeklySchedule + :paramtype weekly: ~azure.mgmt.containerservice.v2025_03_01.models.WeeklySchedule :keyword absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. :paramtype absolute_monthly: - ~azure.mgmt.containerservice.v2025_02_01.models.AbsoluteMonthlySchedule + ~azure.mgmt.containerservice.v2025_03_01.models.AbsoluteMonthlySchedule :keyword relative_monthly: For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. :paramtype relative_monthly: - ~azure.mgmt.containerservice.v2025_02_01.models.RelativeMonthlySchedule + ~azure.mgmt.containerservice.v2025_03_01.models.RelativeMonthlySchedule """ super().__init__(**kwargs) self.daily = daily @@ -7724,9 +7763,9 @@ class ServiceMeshProfile(_serialization.Model): All required parameters must be populated in order to send to server. :ivar mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". - :vartype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.ServiceMeshMode + :vartype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.ServiceMeshMode :ivar istio: Istio service mesh configuration. - :vartype istio: ~azure.mgmt.containerservice.v2025_02_01.models.IstioServiceMesh + :vartype istio: ~azure.mgmt.containerservice.v2025_03_01.models.IstioServiceMesh """ _validation = { @@ -7747,9 +7786,9 @@ def __init__( ) -> None: """ :keyword mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". - :paramtype mode: str or ~azure.mgmt.containerservice.v2025_02_01.models.ServiceMeshMode + :paramtype mode: str or ~azure.mgmt.containerservice.v2025_03_01.models.ServiceMeshMode :keyword istio: Istio service mesh configuration. - :paramtype istio: ~azure.mgmt.containerservice.v2025_02_01.models.IstioServiceMesh + :paramtype istio: ~azure.mgmt.containerservice.v2025_03_01.models.IstioServiceMesh """ super().__init__(**kwargs) self.mode = mode @@ -7764,7 +7803,7 @@ class Snapshot(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -7773,28 +7812,28 @@ class Snapshot(TrackedResource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :vartype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :ivar snapshot_type: The type of a snapshot. The default is NodePool. "NodePool" - :vartype snapshot_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.SnapshotType + :vartype snapshot_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.SnapshotType :ivar kubernetes_version: The version of Kubernetes. :vartype kubernetes_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSType :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "CBLMariner", - "Windows2019", and "Windows2022". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_02_01.models.OSSKU + "Windows2019", "Windows2022", and "Ubuntu2204". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2025_03_01.models.OSSKU :ivar vm_size: The size of the VM. :vartype vm_size: str :ivar enable_fips: Whether to use a FIPS-enabled OS. @@ -7848,19 +7887,19 @@ def __init__( :paramtype location: str :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.v2025_02_01.models.CreationData + :paramtype creation_data: ~azure.mgmt.containerservice.v2025_03_01.models.CreationData :keyword snapshot_type: The type of a snapshot. The default is NodePool. "NodePool" - :paramtype snapshot_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.SnapshotType + :paramtype snapshot_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.SnapshotType """ super().__init__(tags=tags, location=location, **kwargs) self.creation_data = creation_data self.snapshot_type = snapshot_type - self.kubernetes_version = None - self.node_image_version = None - self.os_type = None - self.os_sku = None - self.vm_size = None - self.enable_fips = None + self.kubernetes_version: Optional[str] = None + self.node_image_version: Optional[str] = None + self.os_type: Optional[Union[str, "_models.OSType"]] = None + self.os_sku: Optional[Union[str, "_models.OSSKU"]] = None + self.vm_size: Optional[str] = None + self.enable_fips: Optional[bool] = None class SnapshotListResult(_serialization.Model): @@ -7869,7 +7908,7 @@ class SnapshotListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of snapshots. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.Snapshot] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.Snapshot] :ivar next_link: The URL to get the next set of snapshot results. :vartype next_link: str """ @@ -7886,11 +7925,11 @@ class SnapshotListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of snapshots. - :paramtype value: list[~azure.mgmt.containerservice.v2025_02_01.models.Snapshot] + :paramtype value: list[~azure.mgmt.containerservice.v2025_03_01.models.Snapshot] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class SysctlConfig(_serialization.Model): @@ -8120,7 +8159,7 @@ class SystemData(_serialization.Model): :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.containerservice.v2025_02_01.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2025_03_01.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. @@ -8128,7 +8167,7 @@ class SystemData(_serialization.Model): :ivar last_modified_by_type: The type of identity that last modified the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :vartype last_modified_by_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.CreatedByType + ~azure.mgmt.containerservice.v2025_03_01.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -8159,7 +8198,7 @@ def __init__( :keyword created_by_type: The type of identity that created the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :paramtype created_by_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.CreatedByType + ~azure.mgmt.containerservice.v2025_03_01.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. @@ -8167,7 +8206,7 @@ def __init__( :keyword last_modified_by_type: The type of identity that last modified the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". :paramtype last_modified_by_type: str or - ~azure.mgmt.containerservice.v2025_02_01.models.CreatedByType + ~azure.mgmt.containerservice.v2025_03_01.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ @@ -8205,7 +8244,7 @@ class TimeInWeek(_serialization.Model): :ivar day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day: str or ~azure.mgmt.containerservice.v2025_02_01.models.WeekDay + :vartype day: str or ~azure.mgmt.containerservice.v2025_03_01.models.WeekDay :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. @@ -8227,7 +8266,7 @@ def __init__( """ :keyword day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day: str or ~azure.mgmt.containerservice.v2025_02_01.models.WeekDay + :paramtype day: str or ~azure.mgmt.containerservice.v2025_03_01.models.WeekDay :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. @@ -8278,7 +8317,7 @@ class TrustedAccessRole(_serialization.Model): :ivar rules: List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster Role `_. - :vartype rules: list[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleRule] + :vartype rules: list[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleRule] """ _validation = { @@ -8296,9 +8335,9 @@ class TrustedAccessRole(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.source_resource_type = None - self.name = None - self.rules = None + self.source_resource_type: Optional[str] = None + self.name: Optional[str] = None + self.rules: Optional[List["_models.TrustedAccessRoleRule"]] = None class TrustedAccessRoleBinding(Resource): @@ -8309,7 +8348,7 @@ class TrustedAccessRoleBinding(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -8318,11 +8357,11 @@ class TrustedAccessRoleBinding(Resource): :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. - :vartype system_data: ~azure.mgmt.containerservice.v2025_02_01.models.SystemData + :vartype system_data: ~azure.mgmt.containerservice.v2025_03_01.models.SystemData :ivar provisioning_state: The current provisioning state of trusted access role binding. Known values are: "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBindingProvisioningState + ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBindingProvisioningState :ivar source_resource_id: The ARM resource ID of source resource that trusted access is configured for. Required. :vartype source_resource_id: str @@ -8361,7 +8400,7 @@ def __init__(self, *, source_resource_id: str, roles: List[str], **kwargs: Any) :paramtype roles: list[str] """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.TrustedAccessRoleBindingProvisioningState"]] = None self.source_resource_id = source_resource_id self.roles = roles @@ -8372,7 +8411,7 @@ class TrustedAccessRoleBindingListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Role binding list. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -8390,11 +8429,11 @@ def __init__(self, *, value: Optional[List["_models.TrustedAccessRoleBinding"]] """ :keyword value: Role binding list. :paramtype value: - list[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + list[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class TrustedAccessRoleListResult(_serialization.Model): @@ -8403,7 +8442,7 @@ class TrustedAccessRoleListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Role list. - :vartype value: list[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRole] + :vartype value: list[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRole] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -8421,8 +8460,8 @@ class TrustedAccessRoleListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.TrustedAccessRole"]] = None + self.next_link: Optional[str] = None class TrustedAccessRoleRule(_serialization.Model): @@ -8461,11 +8500,11 @@ class TrustedAccessRoleRule(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.verbs = None - self.api_groups = None - self.resources = None - self.resource_names = None - self.non_resource_ur_ls = None + self.verbs: Optional[List[str]] = None + self.api_groups: Optional[List[str]] = None + self.resources: Optional[List[str]] = None + self.resource_names: Optional[List[str]] = None + self.non_resource_ur_ls: Optional[List[str]] = None class UpgradeOverrideSettings(_serialization.Model): @@ -8515,7 +8554,7 @@ class WeeklySchedule(_serialization.Model): :vartype interval_weeks: int :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_01.models.WeekDay + :vartype day_of_week: str or ~azure.mgmt.containerservice.v2025_03_01.models.WeekDay """ _validation = { @@ -8536,7 +8575,7 @@ def __init__(self, *, interval_weeks: int, day_of_week: Union[str, "_models.Week :keyword day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_02_01.models.WeekDay + :paramtype day_of_week: str or ~azure.mgmt.containerservice.v2025_03_01.models.WeekDay """ super().__init__(**kwargs) self.interval_weeks = interval_weeks diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/models/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/__init__.py similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/__init__.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/__init__.py diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_agent_pools_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_agent_pools_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_agent_pools_operations.py index cfe87c5a4441..a9209fcb8b33 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_agent_pools_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ def build_abort_latest_operation_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -93,14 +91,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -133,14 +131,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -183,7 +181,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,7 +189,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -240,14 +238,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -289,14 +287,14 @@ def build_get_upgrade_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -332,7 +330,7 @@ def build_delete_machines_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -340,7 +338,7 @@ def build_delete_machines_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -378,14 +376,14 @@ def build_get_available_agent_pool_versions_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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -418,14 +416,14 @@ def build_upgrade_node_image_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -461,7 +459,7 @@ class AgentPoolsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`agent_pools` attribute. """ @@ -469,10 +467,10 @@ class AgentPoolsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _abort_latest_operation_initial( @@ -489,7 +487,7 @@ def _abort_latest_operation_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_abort_latest_operation_request( @@ -557,7 +555,7 @@ def begin_abort_latest_operation( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -609,13 +607,13 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: An iterator like instance of either AgentPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -696,7 +694,7 @@ def get( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPool or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPool + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -710,7 +708,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) _request = build_get_request( @@ -763,7 +761,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -839,7 +837,7 @@ def begin_create_or_update( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :param parameters: The agent pool to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPool + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPool :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -851,7 +849,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -892,7 +890,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -920,7 +918,7 @@ def begin_create_or_update( :type agent_pool_name: str :param parameters: The agent pool to create or update. Is either a AgentPool type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPool or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPool or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -929,13 +927,13 @@ def begin_create_or_update( :type if_none_match: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1002,7 +1000,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1079,7 +1077,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1135,7 +1133,7 @@ def get_upgrade_profile( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: AgentPoolUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1149,7 +1147,7 @@ def get_upgrade_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) _request = build_get_upgrade_profile_request( @@ -1200,7 +1198,7 @@ def _delete_machines_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1277,7 +1275,7 @@ def begin_delete_machines( :type agent_pool_name: str :param machines: A list of machines from the agent pool to be deleted. Required. :type machines: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolDeleteMachinesParameter + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolDeleteMachinesParameter :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1341,7 +1339,7 @@ def begin_delete_machines( :param machines: A list of machines from the agent pool to be deleted. Is either a AgentPoolDeleteMachinesParameter type or a IO[bytes] type. Required. :type machines: - ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolDeleteMachinesParameter or IO[bytes] + ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolDeleteMachinesParameter or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1349,7 +1347,7 @@ def begin_delete_machines( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1406,7 +1404,7 @@ def get_available_agent_pool_versions( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: AgentPoolAvailableVersions or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.AgentPoolAvailableVersions + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1420,7 +1418,7 @@ def get_available_agent_pool_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) _request = build_get_available_agent_pool_versions_request( @@ -1465,7 +1463,7 @@ def _upgrade_node_image_version_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_upgrade_node_image_version_request( @@ -1527,13 +1525,13 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.AgentPool] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_machines_operations.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_machines_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_machines_operations.py index b7c0feb97b5e..7cad8c25cd06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_machines_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +43,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -92,14 +91,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -138,7 +137,7 @@ class MachinesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`machines` attribute. """ @@ -146,10 +145,10 @@ class MachinesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -168,13 +167,13 @@ def list( :param agent_pool_name: The name of the agent pool. Required. :type agent_pool_name: str :return: An iterator like instance of either Machine or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.Machine] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.Machine] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -258,7 +257,7 @@ def get( :param machine_name: host name of the machine. Required. :type machine_name: str :return: Machine or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Machine + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -272,7 +271,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.Machine] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_maintenance_configurations_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_maintenance_configurations_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_maintenance_configurations_operations.py index 0b572ca7fe60..4901cba12ba1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_maintenance_configurations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +44,14 @@ def build_list_by_managed_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -85,14 +84,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -126,7 +125,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -170,14 +169,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -211,7 +210,7 @@ class MaintenanceConfigurationsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`maintenance_configurations` attribute. """ @@ -219,10 +218,10 @@ class MaintenanceConfigurationsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -241,13 +240,13 @@ def list_by_managed_cluster( :return: An iterator like instance of either MaintenanceConfiguration or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -328,7 +327,7 @@ def get( :param config_name: The name of the maintenance configuration. Required. :type config_name: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -342,7 +341,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) _request = build_get_request( @@ -397,12 +396,12 @@ def create_or_update( :param config_name: The name of the maintenance configuration. Required. :type config_name: str :param parameters: The maintenance configuration to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -434,7 +433,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ @@ -460,10 +459,10 @@ def create_or_update( :type config_name: str :param parameters: The maintenance configuration to create or update. Is either a MaintenanceConfiguration type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration or IO[bytes] :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MaintenanceConfiguration + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -477,7 +476,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) @@ -551,7 +550,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_managed_clusters_operations.py similarity index 96% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_managed_clusters_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_managed_clusters_operations.py index 3befe7310461..c2f85adab30d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,14 +46,14 @@ def build_list_kubernetes_versions_request(location: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -76,7 +74,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,14 +100,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -134,14 +132,14 @@ def build_get_upgrade_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -174,14 +172,14 @@ def build_get_access_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -220,14 +218,14 @@ def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-lo _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -268,14 +266,14 @@ def build_list_cluster_user_credentials_request( # pylint: disable=name-too-lon _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -317,14 +315,14 @@ def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=n _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -357,14 +355,14 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -403,7 +401,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -411,7 +409,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -450,7 +448,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -458,7 +456,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -495,14 +493,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -537,7 +535,7 @@ def build_reset_service_principal_profile_request( # pylint: disable=name-too-l _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -545,7 +543,7 @@ def build_reset_service_principal_profile_request( # pylint: disable=name-too-l _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -580,7 +578,7 @@ def build_reset_aad_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -588,7 +586,7 @@ def build_reset_aad_profile_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -623,14 +621,14 @@ def build_rotate_cluster_certificates_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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -663,14 +661,14 @@ def build_abort_latest_operation_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -703,14 +701,14 @@ def build_rotate_service_account_signing_keys_request( # pylint: disable=name-t _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -743,14 +741,14 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -783,14 +781,14 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -823,7 +821,7 @@ def build_run_command_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -831,7 +829,7 @@ def build_run_command_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -866,14 +864,14 @@ def build_get_command_result_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -907,14 +905,14 @@ def build_list_outbound_network_dependencies_endpoints_request( # pylint: disab _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -947,14 +945,14 @@ def build_list_mesh_revision_profiles_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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -977,14 +975,14 @@ def build_get_mesh_revision_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -1015,14 +1013,14 @@ def build_list_mesh_upgrade_profiles_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1055,14 +1053,14 @@ def build_get_mesh_upgrade_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -1103,7 +1101,7 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`managed_clusters` attribute. """ @@ -1111,10 +1109,10 @@ class ManagedClustersOperations: # pylint: disable=too-many-public-methods def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -1127,7 +1125,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :param location: The name of the Azure region. Required. :type location: str :return: KubernetesVersionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.KubernetesVersionListResult + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1141,7 +1139,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) _request = build_list_kubernetes_versions_request( @@ -1179,13 +1177,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1259,13 +1257,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite :type resource_group_name: str :return: An iterator like instance of either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1343,7 +1341,7 @@ def get_upgrade_profile( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedClusterUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1357,7 +1355,7 @@ def get_upgrade_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) _request = build_get_upgrade_profile_request( @@ -1407,7 +1405,7 @@ def get_access_profile( :param role_name: The name of the role for managed cluster accessProfile resource. Required. :type role_name: str :return: ManagedClusterAccessProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAccessProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1421,7 +1419,7 @@ def get_access_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) _request = build_get_access_profile_request( @@ -1469,7 +1467,7 @@ def list_cluster_admin_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1483,7 +1481,7 @@ def list_cluster_admin_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) _request = build_list_cluster_admin_credentials_request( @@ -1539,9 +1537,9 @@ def list_cluster_user_credentials( 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. Known values are: "azure", "exec", and "exec". Default value is None. - :type format: str or ~azure.mgmt.containerservice.v2025_02_01.models.Format + :type format: str or ~azure.mgmt.containerservice.v2025_03_01.models.Format :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1555,7 +1553,7 @@ def list_cluster_user_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) _request = build_list_cluster_user_credentials_request( @@ -1604,7 +1602,7 @@ def list_cluster_monitoring_user_credentials( :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. :type server_fqdn: str :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.CredentialResults + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1618,7 +1616,7 @@ def list_cluster_monitoring_user_credentials( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) _request = build_list_cluster_monitoring_user_credentials_request( @@ -1662,7 +1660,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: ManagedCluster or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1676,7 +1674,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) _request = build_get_request( @@ -1727,7 +1725,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1799,7 +1797,7 @@ def begin_create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The managed cluster to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -1812,7 +1810,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1851,7 +1849,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1876,7 +1874,7 @@ def begin_create_or_update( :type resource_name: str :param parameters: The managed cluster to create or update. Is either a ManagedCluster type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -1886,13 +1884,13 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1957,7 +1955,7 @@ def _update_tags_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2027,7 +2025,7 @@ def begin_update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str @@ -2037,7 +2035,7 @@ def begin_update_tags( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2072,7 +2070,7 @@ def begin_update_tags( :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2096,20 +2094,20 @@ def begin_update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject or IO[bytes] :param if_match: The request should only proceed if an entity matches this string. Default value is None. :type if_match: str :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.ManagedCluster] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.ManagedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2168,7 +2166,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -2232,7 +2230,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2288,7 +2286,7 @@ def _reset_service_principal_profile_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2361,7 +2359,7 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterServicePrincipalProfile + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterServicePrincipalProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2419,7 +2417,7 @@ def begin_reset_service_principal_profile( :param parameters: The service principal profile to set on the managed cluster. Is either a ManagedClusterServicePrincipalProfile type or a IO[bytes] type. Required. :type parameters: - ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterServicePrincipalProfile or + ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterServicePrincipalProfile or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] @@ -2428,7 +2426,7 @@ def begin_reset_service_principal_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2488,7 +2486,7 @@ def _reset_aad_profile_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2562,7 +2560,7 @@ def begin_reset_aad_profile( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The AAD profile to set on the Managed Cluster. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAADProfile + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAADProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2623,7 +2621,7 @@ def begin_reset_aad_profile( :type resource_name: str :param parameters: The AAD profile to set on the Managed Cluster. Is either a ManagedClusterAADProfile type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.ManagedClusterAADProfile or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.ManagedClusterAADProfile or IO[bytes] :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] @@ -2632,7 +2630,7 @@ def begin_reset_aad_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2688,7 +2686,7 @@ def _rotate_cluster_certificates_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_rotate_cluster_certificates_request( @@ -2749,7 +2747,7 @@ def begin_rotate_cluster_certificates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2802,7 +2800,7 @@ def _abort_latest_operation_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_abort_latest_operation_request( @@ -2867,7 +2865,7 @@ def begin_abort_latest_operation( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2920,7 +2918,7 @@ def _rotate_service_account_signing_keys_initial( # pylint: disable=name-too-lo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_rotate_service_account_signing_keys_request( @@ -2980,7 +2978,7 @@ def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3031,7 +3029,7 @@ def _stop_initial(self, resource_group_name: str, resource_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_stop_request( @@ -3093,7 +3091,7 @@ def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3144,7 +3142,7 @@ def _start_initial(self, resource_group_name: str, resource_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_start_request( @@ -3203,7 +3201,7 @@ def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3260,7 +3258,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3334,14 +3332,14 @@ def begin_run_command( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param request_payload: The run command request. Required. - :type request_payload: ~azure.mgmt.containerservice.v2025_02_01.models.RunCommandRequest + :type request_payload: ~azure.mgmt.containerservice.v2025_03_01.models.RunCommandRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3374,7 +3372,7 @@ def begin_run_command( :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3399,18 +3397,18 @@ def begin_run_command( :type resource_name: str :param request_payload: The run command request. Is either a RunCommandRequest type or a IO[bytes] type. Required. - :type request_payload: ~azure.mgmt.containerservice.v2025_02_01.models.RunCommandRequest or + :type request_payload: ~azure.mgmt.containerservice.v2025_03_01.models.RunCommandRequest or IO[bytes] :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3472,7 +3470,7 @@ def get_command_result( :param command_id: Id of the command. Required. :type command_id: str :return: RunCommandResult or None or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.RunCommandResult or None + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3486,7 +3484,7 @@ def get_command_result( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) _request = build_get_command_result_request( @@ -3542,13 +3540,13 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.OutboundEnvironmentEndpoint] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.OutboundEnvironmentEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -3624,13 +3622,13 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ :type location: str :return: An iterator like instance of either MeshRevisionProfile or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfile] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -3706,7 +3704,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :param mode: The mode of the mesh. Required. :type mode: str :return: MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MeshRevisionProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3720,7 +3718,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) _request = build_get_mesh_revision_profile_request( @@ -3766,13 +3764,13 @@ def list_mesh_upgrade_profiles( :type resource_name: str :return: An iterator like instance of either MeshUpgradeProfile or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfile] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfile] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -3853,7 +3851,7 @@ def get_mesh_upgrade_profile( :param mode: The mode of the mesh. Required. :type mode: str :return: MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.MeshUpgradeProfile + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3867,7 +3865,7 @@ def get_mesh_upgrade_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) _request = build_get_mesh_upgrade_profile_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_operations.py similarity index 87% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_operations.py index 520c9d3a4469..0033bc660a06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +61,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`operations` attribute. """ @@ -71,10 +69,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -85,13 +83,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: :return: An iterator like instance of either OperationValue or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.OperationValue] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.OperationValue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_private_endpoint_connections_operations.py similarity index 94% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_private_endpoint_connections_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_private_endpoint_connections_operations.py index ca2ecfeb3e5f..125a7ce92152 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,12 +30,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,14 +46,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -91,14 +90,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -138,7 +137,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -146,7 +145,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -188,14 +187,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -231,7 +230,7 @@ class PrivateEndpointConnectionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`private_endpoint_connections` attribute. """ @@ -239,10 +238,10 @@ class PrivateEndpointConnectionsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -260,7 +259,7 @@ def list( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnectionListResult + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -274,7 +273,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) _request = build_list_request( @@ -322,7 +321,7 @@ def get( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -336,7 +335,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( @@ -391,12 +390,12 @@ def update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param parameters: The updated private endpoint connection. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -428,7 +427,7 @@ def update( Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -454,10 +453,10 @@ def update( :type private_endpoint_connection_name: str :param parameters: The updated private endpoint connection. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection or IO[bytes] :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -471,7 +470,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -529,7 +528,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -588,7 +587,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_private_link_resources_operations.py similarity index 86% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_private_link_resources_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_private_link_resources_operations.py index f0f753090394..23b4e0470d17 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +41,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -82,7 +81,7 @@ class PrivateLinkResourcesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`private_link_resources` attribute. """ @@ -90,10 +89,10 @@ class PrivateLinkResourcesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -111,7 +110,7 @@ def list( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResourcesListResult + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -125,7 +124,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) _request = build_list_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_resolve_private_link_service_id_operations.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_resolve_private_link_service_id_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_resolve_private_link_service_id_operations.py index 6b8c74050953..d4792e7eb815 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_resolve_private_link_service_id_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_post_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -51,7 +50,7 @@ def build_post_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -86,7 +85,7 @@ class ResolvePrivateLinkServiceIdOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`resolve_private_link_service_id` attribute. """ @@ -94,10 +93,10 @@ class ResolvePrivateLinkServiceIdOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload @@ -120,12 +119,12 @@ def post( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -154,7 +153,7 @@ def post( Default value is "application/json". :paramtype content_type: str :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -177,10 +176,10 @@ def post( :type resource_name: str :param parameters: Parameters required in order to resolve a private link service ID. Is either a PrivateLinkResource type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource or + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource or IO[bytes] :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.PrivateLinkResource + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -194,7 +193,7 @@ def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_snapshots_operations.py similarity index 93% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_snapshots_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_snapshots_operations.py index f7772b6e0545..3f53d7bc43a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_snapshots_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,14 +66,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -97,14 +96,14 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +136,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +144,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -180,7 +179,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -188,7 +187,7 @@ def build_update_tags_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -223,14 +222,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -263,7 +262,7 @@ class SnapshotsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`snapshots` attribute. """ @@ -271,10 +270,10 @@ class SnapshotsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -284,13 +283,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: Gets a list of snapshots in the specified subscription. :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.Snapshot] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -363,13 +362,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite Required. :type resource_group_name: str :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.Snapshot] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.Snapshot] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -445,7 +444,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -459,7 +458,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) _request = build_get_request( @@ -510,12 +509,12 @@ def create_or_update( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: The snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -544,7 +543,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -567,9 +566,9 @@ def create_or_update( :type resource_name: str :param parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -583,7 +582,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -646,12 +645,12 @@ def update_tags( :param resource_name: The name of the managed cluster resource. Required. :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -680,7 +679,7 @@ def update_tags( Default value is "application/json". :paramtype content_type: str :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ @@ -703,9 +702,9 @@ def update_tags( :type resource_name: str :param parameters: Parameters supplied to the Update snapshot Tags operation. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.v2025_02_01.models.TagsObject or IO[bytes] + :type parameters: ~azure.mgmt.containerservice.v2025_03_01.models.TagsObject or IO[bytes] :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.Snapshot + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -719,7 +718,7 @@ def update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) @@ -790,7 +789,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_trusted_access_role_bindings_operations.py similarity index 95% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_trusted_access_role_bindings_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_trusted_access_role_bindings_operations.py index 5917282c8dd6..1870735b61d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_trusted_access_role_bindings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -93,14 +92,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -145,7 +144,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,7 +152,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -200,14 +199,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -248,7 +247,7 @@ class TrustedAccessRoleBindingsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`trusted_access_role_bindings` attribute. """ @@ -256,10 +255,10 @@ class TrustedAccessRoleBindingsOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -278,13 +277,13 @@ def list( :return: An iterator like instance of either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -365,7 +364,7 @@ def get( :param trusted_access_role_binding_name: The name of trusted access role binding. Required. :type trusted_access_role_binding_name: str :return: TrustedAccessRoleBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding + :rtype: ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -379,7 +378,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) _request = build_get_request( @@ -430,7 +429,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -504,14 +503,14 @@ def begin_create_or_update( :type trusted_access_role_binding_name: str :param trusted_access_role_binding: A trusted access role binding. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding + ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -545,7 +544,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -572,17 +571,17 @@ def begin_create_or_update( :param trusted_access_role_binding: A trusted access role binding. Is either a TrustedAccessRoleBinding type or a IO[bytes] type. Required. :type trusted_access_role_binding: - ~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding or IO[bytes] + ~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding or IO[bytes] :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRoleBinding] + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRoleBinding] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -641,7 +640,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -705,7 +704,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_trusted_access_roles_operations.py similarity index 88% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_trusted_access_roles_operations.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_trusted_access_roles_operations.py index 47d537f36857..f2b42ec2c7b3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/operations/_trusted_access_roles_operations.py @@ -5,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from collections.abc import MutableMapping from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import ContainerServiceClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +40,14 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -72,7 +70,7 @@ class TrustedAccessRolesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.v2025_02_01.ContainerServiceClient`'s + :class:`~azure.mgmt.containerservice.v2025_03_01.ContainerServiceClient`'s :attr:`trusted_access_roles` attribute. """ @@ -80,10 +78,10 @@ class TrustedAccessRolesOperations: 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: ContainerServiceClientConfiguration = 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") self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace @@ -96,13 +94,13 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR :type location: str :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_02_01.models.TrustedAccessRole] + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2025_03_01.models.TrustedAccessRole] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2025-03-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/py.typed similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_02_01/py.typed rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2025_03_01/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py index c1357ebf8734..0884674ae73d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsAbortOperation.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsAbortOperation.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_crg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_crg.py index 0e9489c2df3b..357dfe3f36a7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_crg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_crg.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_CRG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_CRG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py index 28f66689f4e5..6e383a52d42a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -67,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_CustomNodeConfig.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_CustomNodeConfig.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py index 7aed444c28fc..8e540b416fe8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_DedicatedHostGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_DedicatedHostGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py index 052980e94f61..7571761ca28a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py index 7fc0ead9a97b..97ad01d5cf37 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_EnableFIPS.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_EnableFIPS.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py index aed6d7406b94..becbfd2669a0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_EnableUltraSSD.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_EnableUltraSSD.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py index 98c7592b8c2d..c4ab4ec598d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_Ephemeral.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_Ephemeral.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py index 72aace08257b..cbc16765c984 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_GPUMIG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_GPUMIG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py index 74138f565b86..1fb65a77d0e7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -49,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_MessageOfTheDay.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_MessageOfTheDay.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py index b5266cf774e8..84c6ed7f51eb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_OSSKU.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_OSSKU.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py index 0f8d846b98f4..f2ecb80119bc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_PPG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_PPG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py index 406eec8e0c80..915ca132f360 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_Snapshot.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_Snapshot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py index 3efe6c630740..d585ba316871 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_Spot.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_Spot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py index df4235302c65..8aa25a76217c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py index fcd21e1fce7e..e28a34296496 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -49,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_WasmWasi.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_WasmWasi.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py index 3684d8f0f9f8..b1703027fcca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py index b4f052688ca3..96a36ca009ca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsCreate_WindowsOSSKU.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_WindowsOSSKU.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py index 2b5b17e62af0..381d13dae623 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py index e17df4af1659..422719cb8e70 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsDeleteMachines.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsDeleteMachines.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py index 8c414b652809..836d498064f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py index add5d0275de8..3083b2d300b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py index 178aafe4632e..07e269eac738 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsGetUpgradeProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsGetUpgradeProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py index d908ffa71880..be830dfbd5f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py index 440d918c9054..d3361c103429 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPools_Start.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPools_Start.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py index dbb343f38666..5b126f5668d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPools_Stop.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPools_Stop.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py index 75c2a63ffbac..c6959ddcd100 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPools_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPools_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py index 7deb421954be..30117a3bd5c0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/AgentPoolsUpgradeNodeImageVersion.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsUpgradeNodeImageVersion.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py index 3e19b3a892ae..7d807e0767e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/KubernetesVersions_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/KubernetesVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py index b3ff9fa30589..22b9eb59b44c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MachineGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py index 3e1ca699a5f7..96cf1860634d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MachineList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update.py index ac9f793167d4..c0ae4c407b4d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsCreate_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py index 507ebc42e4c6..2b2b7560341b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -53,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete.py index faf7d1d9b03c..288726ff0c23 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py index b60b852427f3..180e7155d78c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get.py index d17923f884e9..447643a370a0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py index c8d80af4c3f9..c7be24fdcfe3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list.py index 5b7f488817ef..0bb56b06833c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py index 5f19632615cd..178ff12c3705 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py index 6e1c3c48fdb6..e8ab3cb4a3a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersAbortOperation.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersAbortOperation.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py index 682a0cf1e4a7..64ddd52bbadc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,7 +57,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -75,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py index 1b243beea348..183e1353f9b3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,7 +57,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -93,6 +93,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_AzureServiceMesh.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_AzureServiceMesh.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_crg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_crg.py index aeaa14bae8d5..c41697c9c4ea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_crg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_crg.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -50,9 +51,8 @@ def main(): } ], "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, - "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_CRG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_CRG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py index 788ef75262f7..0e8ec6e735ee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -49,9 +50,8 @@ def main(): } ], "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, - "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_CustomCATrustCertificates.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_CustomCATrustCertificates.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py index 4216063f016b..6617c404e1ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,7 +52,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": False, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_DedicatedHostGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_DedicatedHostGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py index 069204b6661b..d0ee8c843f31 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "apiServerAccessProfile": {"disableRunCommand": True}, "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_DisableRunCommand.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_DisableRunCommand.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py index c36745610b63..df5b1ccad4f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -67,7 +68,6 @@ def main(): }, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -87,6 +87,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_DualStackNetworking.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_DualStackNetworking.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py index 78ed41a2c784..032599368fe7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py index cff7600e29d9..4f250a297efa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_EnableUltraSSD.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_EnableUltraSSD.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py index 914f5fdec08f..b6398bbfedff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": False, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_EnabledFIPS.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_EnabledFIPS.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py index c1928d57f832..f55981ac9f76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "httpProxyConfig": { "httpProxy": "http://myproxy.server.com:8080", @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_GPUMIG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_GPUMIG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py index 8ed526a98a52..20d7913a484f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,7 +52,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "httpProxyConfig": { "httpProxy": "http://myproxy.server.com:8080", @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_HTTPProxy.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_HTTPProxy.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py index 9ee756749cc9..a2558df4b5e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -71,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py index 9af1ba2a10d6..34f5dd74117a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,7 +52,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_ManagedNATGateway.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_ManagedNATGateway.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py index e44b9881b7e7..fb0b40da8bbd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py index e3973847ad6f..316850fcde54 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "httpProxyConfig": { "httpProxy": "http://myproxy.server.com:8080", @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_OSSKU.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_OSSKU.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py index 6d7c9da984ea..ccb5e8114c77 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,7 +52,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_PodIdentity.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_PodIdentity.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py index 8d01ae4e8a61..8e42cfa2defb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_PPG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_PPG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py index 86a9713c91a0..8ca88821514c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "apiServerAccessProfile": {"disableRunCommand": True}, "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_Premium.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_Premium.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py index 53ecca69ae6f..d587aa0d9068 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -54,7 +55,6 @@ def main(): "privateDNSZone": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io", }, "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, - "enablePodSecurityPolicy": True, "enableRBAC": True, "fqdnSubdomain": "domain1", "kubernetesVersion": "", @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py index 4f658d0ecfc2..34b30e9a7d77 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,7 +53,6 @@ def main(): "apiServerAccessProfile": {"enablePrivateCluster": True, "enablePrivateClusterPublicFQDN": True}, "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py index 7a18422f7a96..12d7e5f0d31e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -70,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_SecurityProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_SecurityProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py index abe7c4c4bd5c..c406c1f15807 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +56,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": False, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_Snapshot.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_Snapshot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py index 33a58ee054f9..a02f552f36e4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -67,7 +68,6 @@ def main(): }, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -87,6 +87,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py index 1197ce600af0..9e074a8452f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -58,7 +59,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -81,6 +81,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py index 38f413e9a306..d676c1a2e2f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -58,7 +59,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -81,6 +81,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_UpdateWithAHUB.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_UpdateWithAHUB.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py index 7025f81d64f2..6fdaf322be17 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -53,7 +54,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py index f2dc406ab6f1..b7d2418d59a6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,7 +52,6 @@ def main(): "autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"}, "diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", "dnsPrefix": "dnsprefix1", - "enablePodSecurityPolicy": True, "enableRBAC": True, "kubernetesVersion": "", "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py index fe7865bbae5d..b40ce992b340 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py index 57a043ae0e22..bd5dfe666a0e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py index 89ce23d5646d..e7325d0de36f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersGetAccessProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersGetAccessProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py index 640d7484035f..5ef443b3ef13 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersGet_MeshRevisionProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersGet_MeshRevisionProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py index 9bff40459873..1e2e2c2d32fb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersGet_MeshUpgradeProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersGet_MeshUpgradeProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py index 2e7bd59c6594..a01eb9e4c041 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersGetUpgradeProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersGetUpgradeProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py index 049b5281eee3..3382378dbce5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py index 137dffe5b03e..5462afae710e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersListByResourceGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py index db02648ddb80..8256b7efcef5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersListClusterAdminCredentials.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersListClusterAdminCredentials.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_monitoring_user_credentials.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_monitoring_user_credentials.py index c50a1cd2b9b8..37fe846bd481 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_monitoring_user_credentials.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_monitoring_user_credentials.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py index 842e2bf24177..a6a6e2d8056b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersListClusterUserCredentials.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersListClusterUserCredentials.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py index cceba68e3b41..4d1972d53be9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersList_MeshRevisionProfiles.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersList_MeshRevisionProfiles.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py index ec36a1caf63d..2ec53a2ffd78 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersList_MeshUpgradeProfiles.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersList_MeshUpgradeProfiles.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py index c60f7c7bb33b..9d264a2f79cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersResetAADProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersResetAADProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py index f63a669f94fd..313f43020a0f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersResetServicePrincipalProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersResetServicePrincipalProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py index 6c0e8cc6f9f0..22ec49cdda5b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersRotateClusterCertificates.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersRotateClusterCertificates.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py index 1be25bd47822..5261a504e591 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py index ed0f8d93f804..b0eaf4c51732 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersStart.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersStart.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py index 3c398590cf8c..db2a7e9066f5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersStop.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersStop.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py index 78b4d22f798a..3020744d4f97 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ManagedClustersUpdateTags.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py index 79403f29d1dd..2c80cd85ce3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/Operation_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/Operation_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py index 714e14244395..fbc3593a1f67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/OutboundNetworkDependenciesEndpointsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/OutboundNetworkDependenciesEndpointsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py index d11a87c729fd..d2e543032ea1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/PrivateEndpointConnectionsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/PrivateEndpointConnectionsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py index 60e8339e0d5b..6e9a737c7188 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/PrivateEndpointConnectionsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/PrivateEndpointConnectionsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py index 2d3c7857105e..d23cdac572cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/PrivateEndpointConnectionsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/PrivateEndpointConnectionsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py index f438cdff10e1..00f175de7717 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/PrivateEndpointConnectionsUpdate.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/PrivateEndpointConnectionsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py index 79167749e701..0429341e53f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/PrivateLinkResourcesList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/PrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py index 1b49385576bf..70f376620e7d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/ResolvePrivateLinkServiceId.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ResolvePrivateLinkServiceId.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py index 1d064eaba16e..78fcbaa2a920 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/RunCommandRequest.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/RunCommandRequest.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py index e1436c67b30c..5dde0f0dcce4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/RunCommandResultFailed.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/RunCommandResultFailed.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py index 3d35742ead80..52111c70f2c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/RunCommandResultSucceed.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/RunCommandResultSucceed.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py index 58a4421516ca..ce26b75aa48f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/SnapshotsCreate.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/SnapshotsCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py index 81083d599655..3e77e7502732 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/SnapshotsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/SnapshotsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py index c235c5a9d778..7b7ea8485a75 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/SnapshotsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/SnapshotsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py index 7a07bea22a1e..96d69486769b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/SnapshotsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/SnapshotsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py index 56c958ae5909..f9f76ee012c3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/SnapshotsListByResourceGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/SnapshotsListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py index bcb94d6b7116..73a280b608f1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/SnapshotsUpdateTags.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/SnapshotsUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py index 36b1ef96991b..b6afd8588369 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py index ac83c52f670a..8b33ddd20a3c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/TrustedAccessRoleBindings_Delete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/TrustedAccessRoleBindings_Delete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py index 03ada8f5cd49..77615659c91d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/TrustedAccessRoleBindings_Get.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/TrustedAccessRoleBindings_Get.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py index e6fa1ead1e47..a8e0893d4a16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/TrustedAccessRoleBindings_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/TrustedAccessRoleBindings_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py index 9bb99e2b4a99..cc25f10c1336 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-02-01/examples/TrustedAccessRoles_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/TrustedAccessRoles_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py index c69023c959a1..c4631612d56c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -25,7 +25,7 @@ def test_agent_pools_begin_abort_latest_operation(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_agent_pools_list(self, resource_group): response = self.client.agent_pools.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_agent_pools_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -159,13 +159,19 @@ def test_agent_pools_begin_create_or_update(self, resource_group): "spotMaxPrice": -1, "tags": {"str": "str"}, "type": "str", - "upgradeSettings": {"drainTimeoutInMinutes": 0, "maxSurge": "str", "nodeSoakDurationInMinutes": 0}, + "upgradeSettings": { + "drainTimeoutInMinutes": 0, + "maxSurge": "str", + "maxUnavailable": "str", + "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", + }, "vmSize": "str", "vnetSubnetID": "str", "windowsProfile": {"disableOutboundNat": bool}, "workloadRuntime": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -178,7 +184,7 @@ def test_agent_pools_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -191,7 +197,7 @@ def test_agent_pools_get_upgrade_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -205,7 +211,7 @@ def test_agent_pools_begin_delete_machines(self, resource_group): resource_name="str", agent_pool_name="str", machines={"machineNames": ["str"]}, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -217,7 +223,7 @@ def test_agent_pools_get_available_agent_pool_versions(self, resource_group): response = self.client.agent_pools.get_available_agent_pool_versions( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -230,7 +236,7 @@ def test_agent_pools_begin_upgrade_node_image_version(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py index 8d48196f1715..30c9de8b571c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -27,7 +27,7 @@ async def test_agent_pools_begin_abort_latest_operation(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -40,7 +40,7 @@ async def test_agent_pools_list(self, resource_group): response = self.client.agent_pools.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -53,7 +53,7 @@ async def test_agent_pools_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -163,13 +163,19 @@ async def test_agent_pools_begin_create_or_update(self, resource_group): "spotMaxPrice": -1, "tags": {"str": "str"}, "type": "str", - "upgradeSettings": {"drainTimeoutInMinutes": 0, "maxSurge": "str", "nodeSoakDurationInMinutes": 0}, + "upgradeSettings": { + "drainTimeoutInMinutes": 0, + "maxSurge": "str", + "maxUnavailable": "str", + "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", + }, "vmSize": "str", "vnetSubnetID": "str", "windowsProfile": {"disableOutboundNat": bool}, "workloadRuntime": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -184,7 +190,7 @@ async def test_agent_pools_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -198,7 +204,7 @@ async def test_agent_pools_get_upgrade_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -213,7 +219,7 @@ async def test_agent_pools_begin_delete_machines(self, resource_group): resource_name="str", agent_pool_name="str", machines={"machineNames": ["str"]}, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -226,7 +232,7 @@ async def test_agent_pools_get_available_agent_pool_versions(self, resource_grou response = await self.client.agent_pools.get_available_agent_pool_versions( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -240,7 +246,7 @@ async def test_agent_pools_begin_upgrade_node_image_version(self, resource_group resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py index 5729ad07ad2e..79a6ae15e826 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -25,7 +25,7 @@ def test_machines_list(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_machines_get(self, resource_group): resource_name="str", agent_pool_name="str", machine_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py index efb7eb9e951c..5cadb5afc6bb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -26,7 +26,7 @@ async def test_machines_list(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_machines_get(self, resource_group): resource_name="str", agent_pool_name="str", machine_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py index 4f0b1e11977d..032d69594143 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_maintenance_configurations_list_by_managed_cluster(self, resource_group response = self.client.maintenance_configurations.list_by_managed_cluster( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_maintenance_configurations_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -78,7 +78,7 @@ def test_maintenance_configurations_create_or_update(self, resource_group): "timeInWeek": [{"day": "str", "hourSlots": [0]}], "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -91,7 +91,7 @@ def test_maintenance_configurations_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py index 6604cc8b7448..7d7f3b647320 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_maintenance_configurations_list_by_managed_cluster(self, resource response = self.client.maintenance_configurations.list_by_managed_cluster( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_maintenance_configurations_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -79,7 +79,7 @@ async def test_maintenance_configurations_create_or_update(self, resource_group) "timeInWeek": [{"day": "str", "hourSlots": [0]}], "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -92,7 +92,7 @@ async def test_maintenance_configurations_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py index fba8269b9fd0..0511d2303144 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -23,7 +23,7 @@ def setup_method(self, method): def test_managed_clusters_list_kubernetes_versions(self, resource_group): response = self.client.managed_clusters.list_kubernetes_versions( location="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_managed_clusters_list_kubernetes_versions(self, resource_group): @recorded_by_proxy def test_managed_clusters_list(self, resource_group): response = self.client.managed_clusters.list( - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ def test_managed_clusters_list(self, resource_group): def test_managed_clusters_list_by_resource_group(self, resource_group): response = self.client.managed_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_managed_clusters_get_upgrade_profile(self, resource_group): response = self.client.managed_clusters.get_upgrade_profile( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_managed_clusters_get_access_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", role_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -81,7 +81,7 @@ def test_managed_clusters_list_cluster_admin_credentials(self, resource_group): response = self.client.managed_clusters.list_cluster_admin_credentials( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -93,7 +93,7 @@ def test_managed_clusters_list_cluster_user_credentials(self, resource_group): response = self.client.managed_clusters.list_cluster_user_credentials( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -105,7 +105,7 @@ def test_managed_clusters_list_cluster_monitoring_user_credentials(self, resourc response = self.client.managed_clusters.list_cluster_monitoring_user_credentials( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -117,7 +117,7 @@ def test_managed_clusters_get(self, resource_group): response = self.client.managed_clusters.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -246,7 +246,9 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): "upgradeSettings": { "drainTimeoutInMinutes": 0, "maxSurge": "str", + "maxUnavailable": "str", "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", }, "vmSize": "str", "vnetSubnetID": "str", @@ -259,7 +261,9 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): "disableRunCommand": bool, "enablePrivateCluster": bool, "enablePrivateClusterPublicFQDN": bool, + "enableVnetIntegration": bool, "privateDNSZone": "str", + "subnetId": "str", }, "autoScalerProfile": { "balance-similar-node-groups": "str", @@ -297,7 +301,6 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): "diskEncryptionSetID": "str", "dnsPrefix": "str", "eTag": "str", - "enablePodSecurityPolicy": bool, "enableRBAC": bool, "extendedLocation": {"name": "str", "type": "str"}, "fqdn": "str", @@ -459,7 +462,7 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): }, "workloadAutoScalerProfile": {"keda": {"enabled": bool}, "verticalPodAutoscaler": {"enabled": False}}, }, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -472,7 +475,7 @@ def test_managed_clusters_begin_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -484,7 +487,7 @@ def test_managed_clusters_begin_delete(self, resource_group): response = self.client.managed_clusters.begin_delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -497,7 +500,7 @@ def test_managed_clusters_begin_reset_service_principal_profile(self, resource_g resource_group_name=resource_group.name, resource_name="str", parameters={"clientId": "str", "secret": "str"}, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -518,7 +521,7 @@ def test_managed_clusters_begin_reset_aad_profile(self, resource_group): "serverAppSecret": "str", "tenantID": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -530,7 +533,7 @@ def test_managed_clusters_begin_rotate_cluster_certificates(self, resource_group response = self.client.managed_clusters.begin_rotate_cluster_certificates( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -542,7 +545,7 @@ def test_managed_clusters_begin_abort_latest_operation(self, resource_group): response = self.client.managed_clusters.begin_abort_latest_operation( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -554,7 +557,7 @@ def test_managed_clusters_begin_rotate_service_account_signing_keys(self, resour response = self.client.managed_clusters.begin_rotate_service_account_signing_keys( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -566,7 +569,7 @@ def test_managed_clusters_begin_stop(self, resource_group): response = self.client.managed_clusters.begin_stop( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -578,7 +581,7 @@ def test_managed_clusters_begin_start(self, resource_group): response = self.client.managed_clusters.begin_start( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -591,7 +594,7 @@ def test_managed_clusters_begin_run_command(self, resource_group): resource_group_name=resource_group.name, resource_name="str", request_payload={"command": "str", "clusterToken": "str", "context": "str"}, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -604,7 +607,7 @@ def test_managed_clusters_get_command_result(self, resource_group): resource_group_name=resource_group.name, resource_name="str", command_id="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -616,7 +619,7 @@ def test_managed_clusters_list_outbound_network_dependencies_endpoints(self, res response = self.client.managed_clusters.list_outbound_network_dependencies_endpoints( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -627,7 +630,7 @@ def test_managed_clusters_list_outbound_network_dependencies_endpoints(self, res def test_managed_clusters_list_mesh_revision_profiles(self, resource_group): response = self.client.managed_clusters.list_mesh_revision_profiles( location="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -639,7 +642,7 @@ def test_managed_clusters_get_mesh_revision_profile(self, resource_group): response = self.client.managed_clusters.get_mesh_revision_profile( location="str", mode="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -651,7 +654,7 @@ def test_managed_clusters_list_mesh_upgrade_profiles(self, resource_group): response = self.client.managed_clusters.list_mesh_upgrade_profiles( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -664,7 +667,7 @@ def test_managed_clusters_get_mesh_upgrade_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mode="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py index 9c7735fdb229..cc17bdf7ec99 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_managed_clusters_list_kubernetes_versions(self, resource_group): response = await self.client.managed_clusters.list_kubernetes_versions( location="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_managed_clusters_list_kubernetes_versions(self, resource_group): @recorded_by_proxy_async async def test_managed_clusters_list(self, resource_group): response = self.client.managed_clusters.list( - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ async def test_managed_clusters_list(self, resource_group): async def test_managed_clusters_list_by_resource_group(self, resource_group): response = self.client.managed_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -57,7 +57,7 @@ async def test_managed_clusters_get_upgrade_profile(self, resource_group): response = await self.client.managed_clusters.get_upgrade_profile( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_managed_clusters_get_access_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", role_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ async def test_managed_clusters_list_cluster_admin_credentials(self, resource_gr response = await self.client.managed_clusters.list_cluster_admin_credentials( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -94,7 +94,7 @@ async def test_managed_clusters_list_cluster_user_credentials(self, resource_gro response = await self.client.managed_clusters.list_cluster_user_credentials( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -106,7 +106,7 @@ async def test_managed_clusters_list_cluster_monitoring_user_credentials(self, r response = await self.client.managed_clusters.list_cluster_monitoring_user_credentials( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -118,7 +118,7 @@ async def test_managed_clusters_get(self, resource_group): response = await self.client.managed_clusters.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -248,7 +248,9 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): "upgradeSettings": { "drainTimeoutInMinutes": 0, "maxSurge": "str", + "maxUnavailable": "str", "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", }, "vmSize": "str", "vnetSubnetID": "str", @@ -261,7 +263,9 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): "disableRunCommand": bool, "enablePrivateCluster": bool, "enablePrivateClusterPublicFQDN": bool, + "enableVnetIntegration": bool, "privateDNSZone": "str", + "subnetId": "str", }, "autoScalerProfile": { "balance-similar-node-groups": "str", @@ -299,7 +303,6 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): "diskEncryptionSetID": "str", "dnsPrefix": "str", "eTag": "str", - "enablePodSecurityPolicy": bool, "enableRBAC": bool, "extendedLocation": {"name": "str", "type": "str"}, "fqdn": "str", @@ -476,7 +479,7 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): "verticalPodAutoscaler": {"enabled": False}, }, }, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -491,7 +494,7 @@ async def test_managed_clusters_begin_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -505,7 +508,7 @@ async def test_managed_clusters_begin_delete(self, resource_group): await self.client.managed_clusters.begin_delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -520,7 +523,7 @@ async def test_managed_clusters_begin_reset_service_principal_profile(self, reso resource_group_name=resource_group.name, resource_name="str", parameters={"clientId": "str", "secret": "str"}, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -543,7 +546,7 @@ async def test_managed_clusters_begin_reset_aad_profile(self, resource_group): "serverAppSecret": "str", "tenantID": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -557,7 +560,7 @@ async def test_managed_clusters_begin_rotate_cluster_certificates(self, resource await self.client.managed_clusters.begin_rotate_cluster_certificates( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -571,7 +574,7 @@ async def test_managed_clusters_begin_abort_latest_operation(self, resource_grou await self.client.managed_clusters.begin_abort_latest_operation( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -585,7 +588,7 @@ async def test_managed_clusters_begin_rotate_service_account_signing_keys(self, await self.client.managed_clusters.begin_rotate_service_account_signing_keys( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -599,7 +602,7 @@ async def test_managed_clusters_begin_stop(self, resource_group): await self.client.managed_clusters.begin_stop( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -613,7 +616,7 @@ async def test_managed_clusters_begin_start(self, resource_group): await self.client.managed_clusters.begin_start( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -628,7 +631,7 @@ async def test_managed_clusters_begin_run_command(self, resource_group): resource_group_name=resource_group.name, resource_name="str", request_payload={"command": "str", "clusterToken": "str", "context": "str"}, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -642,7 +645,7 @@ async def test_managed_clusters_get_command_result(self, resource_group): resource_group_name=resource_group.name, resource_name="str", command_id="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -654,7 +657,7 @@ async def test_managed_clusters_list_outbound_network_dependencies_endpoints(sel response = self.client.managed_clusters.list_outbound_network_dependencies_endpoints( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -665,7 +668,7 @@ async def test_managed_clusters_list_outbound_network_dependencies_endpoints(sel async def test_managed_clusters_list_mesh_revision_profiles(self, resource_group): response = self.client.managed_clusters.list_mesh_revision_profiles( location="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -677,7 +680,7 @@ async def test_managed_clusters_get_mesh_revision_profile(self, resource_group): response = await self.client.managed_clusters.get_mesh_revision_profile( location="str", mode="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -689,7 +692,7 @@ async def test_managed_clusters_list_mesh_upgrade_profiles(self, resource_group) response = self.client.managed_clusters.list_mesh_upgrade_profiles( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -702,7 +705,7 @@ async def test_managed_clusters_get_mesh_upgrade_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mode="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py index fbaf61e9314e..ca791c4640a0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py index c6ba7057d1ae..9d1d2e675501 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py index 461cf9deb795..5c497ecc314d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_private_endpoint_connections_list(self, resource_group): response = self.client.private_endpoint_connections.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -58,7 +58,7 @@ def test_private_endpoint_connections_update(self, resource_group): "provisioningState": "str", "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -71,7 +71,7 @@ def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py index ee94c675fa06..f7c91a4d115b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_private_endpoint_connections_list(self, resource_group): response = await self.client.private_endpoint_connections.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -59,7 +59,7 @@ async def test_private_endpoint_connections_update(self, resource_group): "provisioningState": "str", "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -73,7 +73,7 @@ async def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py index cf65541f98f2..137b9c941620 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_private_link_resources_list(self, resource_group): response = self.client.private_link_resources.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py index 09de5c39c52b..8d9b3ab6ab72 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_private_link_resources_list(self, resource_group): response = await self.client.private_link_resources.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py index 2bbbc272ea99..0c65b984de32 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -32,7 +32,7 @@ def test_resolve_private_link_service_id_post(self, resource_group): "requiredMembers": ["str"], "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py index 9baf2684241a..73d046f1965e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -33,7 +33,7 @@ async def test_resolve_private_link_service_id_post(self, resource_group): "requiredMembers": ["str"], "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py index c9af94f0cb8a..308a01daaabc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_snapshots_list(self, resource_group): response = self.client.snapshots.list( - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_snapshots_list(self, resource_group): def test_snapshots_list_by_resource_group(self, resource_group): response = self.client.snapshots.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_snapshots_get(self, resource_group): response = self.client.snapshots.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -80,7 +80,7 @@ def test_snapshots_create_or_update(self, resource_group): "type": "str", "vmSize": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -93,7 +93,7 @@ def test_snapshots_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -105,7 +105,7 @@ def test_snapshots_delete(self, resource_group): response = self.client.snapshots.delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py index d92b4cd41755..4b336264055e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_snapshots_list(self, resource_group): response = self.client.snapshots.list( - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_snapshots_list(self, resource_group): async def test_snapshots_list_by_resource_group(self, resource_group): response = self.client.snapshots.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_snapshots_get(self, resource_group): response = await self.client.snapshots.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -81,7 +81,7 @@ async def test_snapshots_create_or_update(self, resource_group): "type": "str", "vmSize": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -94,7 +94,7 @@ async def test_snapshots_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -106,7 +106,7 @@ async def test_snapshots_delete(self, resource_group): response = await self.client.snapshots.delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py index 671d1524d5f7..38f643ec3ec0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_trusted_access_role_bindings_list(self, resource_group): response = self.client.trusted_access_role_bindings.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_trusted_access_role_bindings_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -66,7 +66,7 @@ def test_trusted_access_role_bindings_begin_create_or_update(self, resource_grou }, "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -79,7 +79,7 @@ def test_trusted_access_role_bindings_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py index 3c12d36eea85..d0d8c17a426f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_trusted_access_role_bindings_list(self, resource_group): response = self.client.trusted_access_role_bindings.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_trusted_access_role_bindings_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ async def test_trusted_access_role_bindings_begin_create_or_update(self, resourc }, "type": "str", }, - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result @@ -83,7 +83,7 @@ async def test_trusted_access_role_bindings_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-02-01", + api_version="2025-03-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py index 92f473d441e5..9ab82b318453 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01 import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -23,7 +23,7 @@ def setup_method(self, method): def test_trusted_access_roles_list(self, resource_group): response = self.client.trusted_access_roles.list( location="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py index f23db3638235..20c28aad2ddc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient +from azure.mgmt.containerservice.v2025_03_01.aio import ContainerServiceClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_trusted_access_roles_list(self, resource_group): response = self.client.trusted_access_roles.list( location="str", - api_version="2025-02-01", + api_version="2025-03-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/setup.py b/sdk/containerservice/azure-mgmt-containerservice/setup.py index 2aae6908860b..510295f89ee7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/setup.py +++ b/sdk/containerservice/azure-mgmt-containerservice/setup.py @@ -53,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -77,7 +76,7 @@ "isodate>=0.6.1", "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", )